2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
4 * This file is part of Jam - see jam.c for Copyright information.
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.
47 # define unlink remove
60 # define OSMINOR "OS=VMS"
61 # define OSMAJOR "VMS=true"
63 # define MAXLINE 1024 /* longest 'together' actions */
64 # define SPLITPATH ','
67 # define DOWNSHIFT_PATHS
69 /* Do any of these work? */
70 # if defined( VAX ) || defined( __VAX ) || defined( vax )
71 # define OSPLAT "OSPLAT=VAX"
89 # define OSMAJOR "MAC=true"
90 # define OSMINOR "OS=MAC"
92 # define SPLITPATH ','
93 # define DOWNSHIFT_PATHS
103 # define OSMAJOR "UNIX=true"
104 # define USE_EXECUNIX
105 # define USE_FILEUNIX
106 # define USE_PATHUNIX
107 # define PATH_DELIM '/'
110 # define OSMINOR "OS=FREEBSD"
114 # define OSMINOR "OS=LINUX"
119 # define OSMINOR "OS=NETBSD"
125 # define OSMINOR "OS=QNXNTO"
129 # define OSMINOR "OS=QNX"
137 # define OSMINOR "OS=MACOSX"
141 # define OSMINOR "OS=UNKNOWN"
144 /* All the UNIX includes */
146 # include <sys/types.h>
147 # include <sys/stat.h>
150 # include <sys/file.h>
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) && \
181 * OSPLAT definitions - suppressed when it's a one-of-a-kind
184 # if defined( _M_PPC ) || \
187 defined( __powerpc__ ) || \
188 defined( __POWERPC__ ) || \
190 # define OSPLAT "OSPLAT=PPC"
193 # if defined( _ALPHA_ ) || \
195 # define OSPLAT "OSPLAT=AXP"
198 # if defined( _i386_ ) || \
199 defined( __i386__ ) || \
201 # if !defined( OS_FREEBSD ) && \
202 !defined( OS_OS2 ) && \
204 # define OSPLAT "OSPLAT=X86"
209 # if !defined( OS_SUNOS )
210 # define OSPLAT "OSPLAT=SPARC"
215 # if !defined( OS_SGI )
216 # define OSPLAT "OSPLAT=MIPS"
221 # define OSPLAT "OSPLAT=ARM"
224 # if defined( __ia64__ ) || \
225 defined( __IA64__ ) || \
227 # define OSPLAT "OSPLAT=IA64"
231 # define OSPLAT "OSPLAT=390"
239 * Jam implementation misc.
243 # define MAXLINE 10240 /* longest 'together' actions' */
252 # define SPLITPATH ':'
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
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 */