Skip to content

Commit deaa090

Browse files
committed
first steps toward VC-compilable ppremake
1 parent 7cbfc0c commit deaa090

22 files changed

+564
-33
lines changed

ppremake/acconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
/* Define if we're compiling for a Windows platform. */
2424
#undef PLATFORM_WIN32
2525

26-
/* The current version number. */
27-
#define VERSION 0.0
26+
/* Define if we're compiling using Windows Microsoft Visual C++. */
27+
#undef WIN32_VC
2828

2929
/* The platform ppremake is compiled for. This primarily controls the
3030
initial setting of the $[PLATFORM] variable. */

ppremake/config_msvc.h

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* config_msvc.h.
2+
3+
This file was generated by hand for use on Win32 environments when
4+
building with Microsoft Visual Studio. It will have to be kept
5+
up-to-date by hand with the automatically-generated config.h on
6+
other platforms.
7+
*/
8+
9+
/* Define if the C++ compiler uses namespaces. */
10+
#define HAVE_NAMESPACE 1
11+
12+
/* Define if the C++ iostream library supports ios::binary. */
13+
/* #undef HAVE_IOS_BINARY */
14+
15+
/* Define if we're compiling for a Windows platform. */
16+
#define PLATFORM_WIN32 1
17+
18+
/* Define if we're compiling using Windows Microsoft Visual C++. */
19+
#define WIN32_VC 1
20+
21+
/* The platform ppremake is compiled for. This primarily controls the
22+
initial setting of the $[PLATFORM] variable. */
23+
#define PLATFORM "Win32"
24+
25+
/* Define if you have the <alloca.h> header file. */
26+
/* #undef HAVE_ALLOCA_H */
27+
28+
/* Define if you have the `getopt' function. */
29+
/* #undef HAVE_GETOPT */
30+
31+
/* Define if you have the <iostream> header file. */
32+
#define HAVE_IOSTREAM 1
33+
34+
/* Define if you have the <io.h> header file. */
35+
#define HAVE_IO_H 1
36+
37+
/* Define if you have the <malloc.h> header file. */
38+
#define HAVE_MALLOC_H 1
39+
40+
/* Define if you have the <minmax.h> header file. */
41+
/* #undef HAVE_MINMAX_H */
42+
43+
/* Define if you have the <glob.h> header file. */
44+
/* #undef HAVE_GLOB_H */
45+
46+
/* Define if you have the <dirent.h> header file. */
47+
/* #undef HAVE_DIRENT_H */
48+
49+
/* Define if you have the <regex.h> header file. */
50+
/* #undef HAVE_REGEX_H */
51+
52+
/* Define if you have the <string.h> header file. */
53+
#define HAVE_STRING_H 1
54+
55+
/* Define if you have the <strstream.h> header file. */
56+
#define HAVE_STRSTREAM_H 1
57+
58+
/* Define if you have the <sys/types.h> header file. */
59+
/* #undef HAVE_SYS_TYPES_H 1 */
60+
61+
/* Define if you have the <sys/time.h> header file. */
62+
/* #undef HAVE_SYS_TIME_H 1 */
63+
64+
/* Define if you have the <sys/utime.h> header file. */
65+
#define HAVE_SYS_UTIME_H 1
66+
67+
/* Define if you have the <sys/wait.h> header file. */
68+
/* #undef HAVE_SYS_WAIT_H 1 */
69+
70+
/* Define if you have the <unistd.h> header file. */
71+
/* #undef HAVE_UNISTD_H 1 */
72+
73+
/* Define if you have the <utime.h> header file. */
74+
/* #undef HAVE_UTIME_H 1 */
75+
76+
/* Name of package */
77+
#define PACKAGE "ppremake"
78+
79+
/* Define if you have the ANSI C header files. */
80+
#define STDC_HEADERS 1
81+
82+
/* Version number of package */
83+
#define VERSION "1.03"

ppremake/configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ AC_SUBST(libm)
3535

3636
dnl Checks for header files.
3737
AC_HEADER_STDC
38-
AC_CHECK_HEADERS(malloc.h alloca.h unistd.h io.h minmax.h sys/types.h string.h regex.h)
38+
AC_CHECK_HEADERS(malloc.h alloca.h unistd.h utime.h io.h minmax.h glob.h dirent.h sys/types.h sys/time.h sys/utime.h sys/wait.h string.h strstream.h regex.h)
3939

4040
dnl Checks for typedefs, structures, and compiler characteristics.
4141

ppremake/find_searchpath.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
////////////////////////////////////////////////////////////////////
55

66
#include "find_searchpath.h"
7+
#include "include_access.h"
78

9+
#ifdef HAVE_UNISTD_H
810
#include <unistd.h>
11+
#endif
912

1013
string
1114
find_searchpath(const vector<string> &directories, const string &filename) {

ppremake/gnu_getopt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
GNU General Public License for more details. */
1818

1919

20-
#include <ppremake.h>
20+
#include "ppremake.h"
2121

2222
#if !defined(HAVE_GETOPT)
2323

ppremake/gnu_getopt.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern "C" {
3535
Also, when `ordering' is RETURN_IN_ORDER,
3636
each non-option ARGV-element is returned here. */
3737

38-
extern char EXPCL_DTOOL *optarg;
38+
extern char *optarg;
3939

4040
/* Index in ARGV of the next element to be scanned.
4141
This is used for communication to and from the caller
@@ -49,7 +49,7 @@ extern char EXPCL_DTOOL *optarg;
4949
Otherwise, `optind' communicates from one call to the next
5050
how much of ARGV has been scanned so far. */
5151

52-
extern int EXPCL_DTOOL optind;
52+
extern int optind;
5353

5454
/* Callers store zero here to inhibit the error message `getopt' prints
5555
for unrecognized options. */
@@ -101,12 +101,12 @@ struct option
101101
#define required_argument 1
102102
#define optional_argument 2
103103

104-
extern EXPCL_DTOOL int
104+
extern int
105105
getopt (int argc, char *const *argv, const char *shortopts);
106-
extern EXPCL_DTOOL int
106+
extern int
107107
getopt_long (int argc, char *const *argv, const char *shortopts,
108108
const struct option *long_options, int *opt_index);
109-
extern EXPCL_DTOOL int
109+
extern int
110110
getopt_long_only (int argc, char *const *argv,
111111
const char *shortopts,
112112
const struct option *long_options,

ppremake/gnu_regex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#pragma alloca
2525
#endif
2626

27-
#include <ppremake.h>
27+
#include "ppremake.h"
2828

2929
#if !defined(HAVE_REGEX_H)
3030

@@ -2835,7 +2835,7 @@ re_set_registers (bufp, regs, num_regs, starts, ends)
28352835
{
28362836
bufp->regs_allocated = REGS_UNALLOCATED;
28372837
regs->num_regs = 0;
2838-
regs->start = regs->end = (regoff_t) 0;
2838+
regs->start = regs->end = (regoff_t *) 0;
28392839
}
28402840
}
28412841

ppremake/gnu_regex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ typedef struct
393393
unfortunately clutters up the declarations a bit, but I think it's
394394
worth it. */
395395

396-
#if __STDC__
396+
#if defined(__STDC__) || defined(_MSC_VER)
397397

398398
#define _RE_ARGS(args) args
399399

ppremake/include_access.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Filename: include_access.cxx
2+
// Created by: drose (21May02)
3+
//
4+
////////////////////////////////////////////////////////////////////
5+
6+
#ifndef INCLUDE_ACCESS_H
7+
#define INCLUDE_ACCESS_H
8+
9+
// This file includes whatever is necessary to define the access()
10+
// function.
11+
12+
#ifdef HAVE_UNISTD_H
13+
#include <unistd.h>
14+
#endif
15+
16+
#ifdef WIN32_VC
17+
#include <io.h> // Windows requires this for access()
18+
#define access _access
19+
#define F_OK 00
20+
#define W_OK 02
21+
#define R_OK 04
22+
#endif // WIN32_VC
23+
24+
#endif // INCLUDE_ACCESS_H
25+

ppremake/ppCommandFile.cxx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,24 @@
88
#include "ppNamedScopes.h"
99
#include "ppSubroutine.h"
1010
#include "tokenize.h"
11+
#include "include_access.h"
12+
13+
#ifdef HAVE_UNISTD_H
14+
#include <unistd.h>
15+
#endif
16+
17+
#ifdef HAVE_UTIME_H
18+
#include <utime.h>
19+
#endif
20+
21+
#ifdef HAVE_SYS_UTIME_H
22+
#include <sys/utime.h>
23+
#endif
1124

1225
#include <ctype.h>
1326
#include <stdio.h> // for tempnam()
14-
#include <unistd.h>
1527
#include <sys/types.h>
16-
#include <utime.h>
1728
#include <assert.h>
18-
#include <strstream.h>
1929

2030
static const string begin_comment(BEGIN_COMMENT);
2131

@@ -1664,7 +1674,11 @@ compare_output(const string &new_contents, const string &filename,
16641674
}
16651675
}
16661676

1677+
#ifdef WIN32_VC
1678+
ofstream out_b(filename.c_str(), ios::out);
1679+
#else // WIN32_VC
16671680
ofstream out_b(filename.c_str(), ios::out, 0666);
1681+
#endif // WIN32_VC
16681682
if (!out_b) {
16691683
cerr << "Unable to open file " << filename << " for writing.\n";
16701684
return false;

0 commit comments

Comments
 (0)