cosmetic fixes
[k8jam.git] / jam.h
blobc26f8d9334ed87ec7ee6788d22a82337569c8c7c
1 /*
2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
4 * This file is part of Jam - see jam.c for Copyright information.
5 */
7 /*
8 * jam.h - includes and globals for jam
10 * 04/08/94 (seiwald) - Coherent/386 support added.
11 * 04/21/94 (seiwald) - DGUX is __DGUX__, not just __DGUX.
12 * 05/04/94 (seiwald) - new globs.jobs (-j jobs)
13 * 11/01/94 (wingerd) - let us define path of Jambase at compile time.
14 * 12/30/94 (wingerd) - changed command buffer size for NT (MS-DOS shell).
15 * 02/22/95 (seiwald) - Jambase now in /usr/local/lib.
16 * 04/30/95 (seiwald) - FreeBSD added. Live Free or Die.
17 * 05/10/95 (seiwald) - SPLITPATH character set up here.
18 * 08/20/95 (seiwald) - added LINUX.
19 * 08/21/95 (seiwald) - added NCR.
20 * 10/23/95 (seiwald) - added SCO.
21 * 01/03/96 (seiwald) - SINIX (nixdorf) added.
22 * 03/13/96 (seiwald) - Jambase now compiled in; remove JAMBASE variable.
23 * 04/29/96 (seiwald) - AIX now has 31 and 42 OSVERs.
24 * 11/21/96 (peterk) - added BeOS with MW CW mwcc
25 * 12/21/96 (seiwald) - OSPLAT now defined for NT.
26 * 07/19/99 (sickel) - Mac OS X Server and Client support added
27 * 02/22/01 (seiwald) - downshift paths on case-insensitive macintosh
28 * 03/23/01 (seiwald) - VMS C++ changes.
29 * 10/29/01 (brett) - More IA64 ifdefs for MS.
30 * 02/18/00 (belmonte)- Support for Cygwin.
31 * 09/12/00 (seiwald) - OSSYMS split to OSMAJOR/OSMINOR/OSPLAT
32 * 12/29/00 (seiwald) - OSVER dropped.
33 * 01/21/02 (seiwald) - new -q to quit quickly on build failure
34 * 03/16/02 (seiwald) - support for -g (reorder builds by source time)
35 * 03/20/02 (seiwald) - MINGW porting from Max Blagai
36 * 08/16/02 (seiwald) - BEOS porting from Ingo Weinhold
37 * 09/19/02 (seiwald) - new -d displays
38 * 11/05/02 (seiwald) - OSPLAT now set to sparc on solaris.
42 * VMS, OPENVMS
45 # ifdef VMS
47 # define unlink remove
49 # include <types.h>
50 # include <file.h>
51 # include <stat.h>
52 # include <stdio.h>
53 # include <ctype.h>
54 # include <stdlib.h>
55 # include <signal.h>
56 # include <string.h>
57 # include <time.h>
58 # include <unixlib.h>
60 # define OSMINOR "OS=VMS"
61 # define OSMAJOR "VMS=true"
62 # define OS_VMS
63 # define MAXLINE 1024 /* longest 'together' actions */
64 # define SPLITPATH ','
65 # define EXITOK 1
66 # define EXITBAD 0
67 # define DOWNSHIFT_PATHS
69 /* Do any of these work? */
70 # if defined( VAX ) || defined( __VAX ) || defined( vax )
71 # define OSPLAT "OSPLAT=VAX"
72 # endif
74 # endif
78 * Macintosh MPW
81 # ifdef macintosh
83 # include <time.h>
84 # include <stdlib.h>
85 # include <string.h>
86 # include <stdio.h>
87 # include <ctype.h>
89 # define OSMAJOR "MAC=true"
90 # define OSMINOR "OS=MAC"
91 # define OS_MAC
92 # define SPLITPATH ','
93 # define DOWNSHIFT_PATHS
95 # endif
98 * God fearing UNIX
101 # ifndef OSMINOR
103 # define OSMAJOR "UNIX=true"
104 # define USE_EXECUNIX
105 # define USE_FILEUNIX
106 # define USE_PATHUNIX
107 # define PATH_DELIM '/'
109 # ifdef __FreeBSD__
110 # define OSMINOR "OS=FREEBSD"
111 # define OS_FREEBSD
112 # endif
113 # ifdef linux
114 # define OSMINOR "OS=LINUX"
115 # define OS_LINUX
116 # endif
117 # ifdef __NetBSD__
118 # define unix
119 # define OSMINOR "OS=NETBSD"
120 # define OS_NETBSD
121 # define NO_VFORK
122 # endif
123 # ifdef __QNX__
124 # ifdef __QNXNTO__
125 # define OSMINOR "OS=QNXNTO"
126 # define OS_QNXNTO
127 # else
128 # define unix
129 # define OSMINOR "OS=QNX"
130 # define OS_QNX
131 # define NO_VFORK
132 # define MAXLINE 996
133 # endif
134 # endif
135 # ifdef __APPLE__
136 # define unix
137 # define OSMINOR "OS=MACOSX"
138 # define OS_MACOSX
139 # endif
140 # ifndef OSMINOR
141 # define OSMINOR "OS=UNKNOWN"
142 # endif
144 /* All the UNIX includes */
146 # include <sys/types.h>
147 # include <sys/stat.h>
149 # ifndef OS_MPEIX
150 # include <sys/file.h>
151 # endif
153 # include <fcntl.h>
154 # include <stdio.h>
155 # include <ctype.h>
156 # include <signal.h>
157 # include <string.h>
158 # include <time.h>
160 # ifndef OS_QNX
161 # include <memory.h>
162 # endif
164 # ifndef OS_ULTRIX
165 # include <stdlib.h>
166 # endif
168 # if !defined(OS_BSDI) && \
169 !defined(OS_FREEBSD) && \
170 !defined(OS_NEXT) && \
171 !defined(OS_MACHTEN) && \
172 !defined(OS_MACOSX) && \
173 !defined(OS_RHAPSODY) && \
174 !defined(OS_MVS)
175 # include <malloc.h>
176 # endif
178 # endif
181 * OSPLAT definitions - suppressed when it's a one-of-a-kind
184 # if defined( _M_PPC ) || \
185 defined( PPC ) || \
186 defined( ppc ) || \
187 defined( __powerpc__ ) || \
188 defined( __POWERPC__ ) || \
189 defined( __ppc__ )
190 # define OSPLAT "OSPLAT=PPC"
191 # endif
193 # if defined( _ALPHA_ ) || \
194 defined( __alpha__ )
195 # define OSPLAT "OSPLAT=AXP"
196 # endif
198 # if defined( _i386_ ) || \
199 defined( __i386__ ) || \
200 defined( _M_IX86 )
201 # if !defined( OS_FREEBSD ) && \
202 !defined( OS_OS2 ) && \
203 !defined( OS_AS400 )
204 # define OSPLAT "OSPLAT=X86"
205 # endif
206 # endif
208 # ifdef __sparc__
209 # if !defined( OS_SUNOS )
210 # define OSPLAT "OSPLAT=SPARC"
211 # endif
212 # endif
214 # ifdef __mips__
215 # if !defined( OS_SGI )
216 # define OSPLAT "OSPLAT=MIPS"
217 # endif
218 # endif
220 # ifdef __arm__
221 # define OSPLAT "OSPLAT=ARM"
222 # endif
224 # if defined( __ia64__ ) || \
225 defined( __IA64__ ) || \
226 defined( _M_IA64 )
227 # define OSPLAT "OSPLAT=IA64"
228 # endif
230 # ifdef __s390__
231 # define OSPLAT "OSPLAT=390"
232 # endif
234 # ifndef OSPLAT
235 # define OSPLAT ""
236 # endif
239 * Jam implementation misc.
242 # ifndef MAXLINE
243 # define MAXLINE 10240 /* longest 'together' actions' */
244 # endif
246 # ifndef EXITOK
247 # define EXITOK 0
248 # define EXITBAD 1
249 # endif
251 # ifndef SPLITPATH
252 # define SPLITPATH ':'
253 # endif
255 /* You probably don't need to muck with these. */
257 # define MAXSYM 1024 /* longest symbol in the environment */
258 # define MAXJPATH 1024 /* longest filename */
260 # define MAXJOBS 64 /* silently enforce -j limit */
261 # define MAXARGC 32 /* words in $(JAMSHELL) */
263 /* Jam private definitions below. */
265 # define DEBUG_MAX 15
267 struct globs {
268 int noexec;
269 int jobs;
270 int quitquick;
271 int newestfirst; /* build newest sources first */
272 char debug[DEBUG_MAX];
273 FILE *cmdout; /* print cmds, not run them */
276 extern struct globs globs;
278 # define DEBUG_MAKE ( globs.debug[ 1 ] ) /* -da show actions when executed */
279 # define DEBUG_MAKEPROG ( globs.debug[ 3 ] ) /* -dm show progress of make0 */
281 # define DEBUG_EXECCMD ( globs.debug[ 4 ] ) /* show execcmds()'s work */
283 # define DEBUG_COMPILE ( globs.debug[ 5 ] ) /* show rule invocations */
285 # define DEBUG_HEADER ( globs.debug[ 6 ] ) /* show result of header scan */
286 # define DEBUG_BINDSCAN ( globs.debug[ 6 ] ) /* show result of dir scan */
287 # define DEBUG_SEARCH ( globs.debug[ 6 ] ) /* show attempts at binding */
289 # define DEBUG_VARSET ( globs.debug[ 7 ] ) /* show variable settings */
290 # define DEBUG_VARGET ( globs.debug[ 8 ] ) /* show variable fetches */
291 # define DEBUG_VAREXP ( globs.debug[ 8 ] ) /* show variable expansions */
292 # define DEBUG_IF ( globs.debug[ 8 ] ) /* show 'if' calculations */
293 # define DEBUG_LISTS ( globs.debug[ 9 ] ) /* show list manipulation */
294 # define DEBUG_SCAN ( globs.debug[ 9 ] ) /* show scanner tokens */
295 # define DEBUG_MEM ( globs.debug[ 9 ] ) /* show memory use */
297 # define DEBUG_MAKEQ ( globs.debug[ 11 ] ) /* -da show even quiet actions */
298 # define DEBUG_EXEC ( globs.debug[ 12 ] ) /* -dx show text of actions */
299 # define DEBUG_DEPENDS ( globs.debug[ 13 ] ) /* -dd show dependency graph */
300 # define DEBUG_CAUSES ( globs.debug[ 14 ] ) /* -dc show dependency graph */