Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/jam/src/jam.h @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 11.5 KB
Line 
1/*
2 * Copyright 1993, 1995 Christopher Seiwald.
3 *
4 * This file is part of Jam - see jam.c for Copyright information.
5 */
6
7/*  This file is ALSO:
8 *  Copyright 2001-2004 David Abrahams.
9 *  Distributed under the Boost Software License, Version 1.0.
10 *  (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
11 */
12
13/*
14 * jam.h - includes and globals for jam
15 *
16 * 04/08/94 (seiwald) - Coherent/386 support added.
17 * 04/21/94 (seiwald) - DGUX is __DGUX__, not just __DGUX.
18 * 05/04/94 (seiwald) - new globs.jobs (-j jobs)
19 * 11/01/94 (wingerd) - let us define path of Jambase at compile time.
20 * 12/30/94 (wingerd) - changed command buffer size for NT (MS-DOS shell).
21 * 02/22/95 (seiwald) - Jambase now in /usr/local/lib.
22 * 04/30/95 (seiwald) - FreeBSD added.  Live Free or Die.
23 * 05/10/95 (seiwald) - SPLITPATH character set up here.
24 * 08/20/95 (seiwald) - added LINUX.
25 * 08/21/95 (seiwald) - added NCR.
26 * 10/23/95 (seiwald) - added SCO.
27 * 01/03/96 (seiwald) - SINIX (nixdorf) added.
28 * 03/13/96 (seiwald) - Jambase now compiled in; remove JAMBASE variable.
29 * 04/29/96 (seiwald) - AIX now has 31 and 42 OSVERs.
30 * 11/21/96 (peterk)  - added BeOS with MW CW mwcc
31 * 12/21/96 (seiwald) - OSPLAT now defined for NT.
32 * 07/19/99 (sickel)  - Mac OS X Server and Client support added
33 * 02/18/00 (belmonte)- Support for Cygwin.
34 * 09/12/00 (seiwald) - OSSYMS split to OSMAJOR/OSMINOR/OSPLAT
35 * 12/29/00 (seiwald) - OSVER dropped.
36 */
37
38#ifndef JAM_H_VP_2003_08_01
39#define JAM_H_VP_2003_08_01
40
41#ifdef HAVE_PYTHON
42#include <Python.h>
43#endif
44
45/* Assume popen support is available unless known otherwise. */
46#define HAVE_POPEN 1
47
48/*
49 * VMS, OPENVMS
50 */
51
52# ifdef VMS
53
54# include <types.h>
55# include <file.h>
56# include <stat.h>
57# include <stdio.h>
58# include <ctype.h>
59# include <stdlib.h>
60# include <signal.h>
61# include <string.h>
62# include <time.h>
63# include <unistd.h>
64# include <unixlib.h>
65
66# define OSMINOR "OS=VMS"
67# define OSMAJOR "VMS=true"
68# define OS_VMS
69# define MAXLINE 1024 /* longest 'together' actions */
70# define SPLITPATH ','
71# define EXITOK 1
72# define EXITBAD 0
73# define DOWNSHIFT_PATHS
74
75/* This may be inaccurate */
76# ifndef __DECC
77# define OSPLAT "OSPLAT=VAX"
78# endif
79
80# endif
81
82/*
83 * Windows NT
84 */
85
86# ifdef NT
87
88# include <fcntl.h>
89# include <stdlib.h>
90# include <stdio.h>
91# include <ctype.h>
92# include <malloc.h>
93# ifndef __MWERKS__
94# include <memory.h>
95#endif
96# include <signal.h>
97# include <string.h>
98# include <time.h>
99
100# define OSMAJOR "NT=true"
101# define OSMINOR "OS=NT"
102# define OS_NT
103# define SPLITPATH ';'
104/* Windows NT 3.51 only allows 996 chars per line, but we deal */
105/* with problem in "execnt.c".                                 */
106# define MAXLINE (maxline())    /* longest 'together' actions */
107# define USE_EXECNT
108# define USE_PATHUNIX
109# define PATH_DELIM '\\'
110# define DOWNSHIFT_PATHS
111
112/* AS400 cross-compile from NT */
113
114# ifdef AS400
115# undef OSMINOR
116# undef OSMAJOR
117# define OSMAJOR "AS400=true"
118# define OSMINOR "OS=AS400"
119# define OS_AS400
120# endif
121
122/* Metrowerks Standard Library on Windows. */
123
124# ifdef __MSL__
125#undef HAVE_POPEN
126#endif
127
128# endif
129
130/*
131 * Windows MingW32
132 */
133
134# ifdef MINGW
135
136# include <fcntl.h>
137# include <stdlib.h>
138# include <stdio.h>
139# include <ctype.h>
140# include <malloc.h>
141# include <memory.h>
142# include <signal.h>
143# include <string.h>
144# include <time.h>
145
146# define OSMAJOR "MINGW=true"
147# define OSMINOR "OS=MINGW"
148# define OS_NT
149# define SPLITPATH ';'
150# define MAXLINE 996    /* longest 'together' actions */
151# define USE_EXECUNIX
152# define USE_PATHUNIX
153# define PATH_DELIM '\\'
154# define DOWNSHIFT_PATHS
155
156# endif
157
158/*
159 * OS2
160 */
161
162# ifdef __OS2__
163
164# include <fcntl.h>
165# include <stdlib.h>
166# include <stdio.h>
167# include <ctype.h>
168# include <malloc.h>
169# include <signal.h>
170# include <string.h>
171# include <time.h>
172
173# define OSMAJOR "OS2=true"
174# define OSMINOR "OS=OS2"
175# define OS_OS2
176# define SPLITPATH ';'
177# define MAXLINE 996    /* longest 'together' actions */
178# define USE_EXECUNIX
179# define USE_PATHUNIX
180# define PATH_DELIM '\\'
181# define DOWNSHIFT_PATHS
182
183# ifdef __EMX__
184#   define USE_FILEUNIX
185# endif
186
187# endif
188
189/*
190 * Macintosh MPW
191 */
192
193# ifdef macintosh
194
195# include <time.h>
196# include <stdlib.h>
197# include <string.h>
198# include <stdio.h>
199
200# define OSMAJOR "MAC=true"
201# define OSMINOR "OS=MAC"
202# define OS_MAC
203# define SPLITPATH ','
204
205# endif
206
207/*
208 * God fearing UNIX
209 */
210
211# ifndef OSMINOR
212
213# define OSMAJOR "UNIX=true"
214# define USE_EXECUNIX
215# define USE_FILEUNIX
216# define USE_PATHUNIX
217# define PATH_DELIM '/'
218
219# ifdef _AIX
220# define unix
221# define OSMINOR "OS=AIX"
222# define OS_AIX
223# define NO_VFORK
224# endif
225# ifdef AMIGA
226# define OSMINOR "OS=AMIGA"
227# define OS_AMIGA
228# endif
229# ifdef __BEOS__
230# define unix
231# define OSMINOR "OS=BEOS"
232# define OS_BEOS
233# define NO_VFORK
234# endif
235# ifdef __bsdi__
236# define OSMINOR "OS=BSDI"
237# define OS_BSDI
238# endif
239# if defined (COHERENT) && defined (_I386)
240# define OSMINOR "OS=COHERENT"
241# define OS_COHERENT
242# define NO_VFORK
243# endif
244# if defined(__cygwin__) || defined(__CYGWIN__)
245# define OSMINOR "OS=CYGWIN"
246# define OS_CYGWIN
247# endif
248# if defined(__FreeBSD__) && !defined(__DragonFly__)
249# define OSMINOR "OS=FREEBSD"
250# define OS_FREEBSD
251# endif
252# ifdef __DragonFly__
253# define OSMINOR "OS=DRAGONFLYBSD"
254# define OS_DRAGONFLYBSD
255# endif
256# ifdef __DGUX__
257# define OSMINOR "OS=DGUX"
258# define OS_DGUX
259# endif
260# ifdef __hpux
261# define OSMINOR "OS=HPUX"
262# define OS_HPUX
263# endif
264# ifdef __OPENNT
265# define unix
266# define OSMINOR "OS=INTERIX"
267# define OS_INTERIX
268# define NO_VFORK
269# endif
270# ifdef __sgi
271# define OSMINOR "OS=IRIX"
272# define OS_IRIX
273# define NO_VFORK
274# endif
275# ifdef __ISC
276# define OSMINOR "OS=ISC"
277# define OS_ISC
278# define NO_VFORK
279# endif
280# ifdef linux
281# define OSMINOR "OS=LINUX"
282# define OS_LINUX
283# endif
284# ifdef __Lynx__
285# define OSMINOR "OS=LYNX"
286# define OS_LYNX
287# define NO_VFORK
288# define unix
289# endif
290# ifdef __MACHTEN__
291# define OSMINOR "OS=MACHTEN"
292# define OS_MACHTEN
293# endif
294# ifdef mpeix
295# define unix
296# define OSMINOR "OS=MPEIX"
297# define OS_MPEIX
298# define NO_VFORK
299# endif
300# ifdef __MVS__
301# define unix
302# define OSMINOR "OS=MVS"
303# define OS_MVS
304# endif
305# ifdef _ATT4
306# define OSMINOR "OS=NCR"
307# define OS_NCR
308# endif
309# ifdef __NetBSD__
310# define unix
311# define OSMINOR "OS=NETBSD"
312# define OS_NETBSD
313# define NO_VFORK
314# endif
315# ifdef __QNX__
316# define unix
317# ifdef __QNXNTO__
318# define OSMINOR "OS=QNXNTO"
319# define OS_QNXNTO
320# else
321# define OSMINOR "OS=QNX"
322# define OS_QNX
323# define NO_VFORK
324# define MAXLINE 996
325# endif
326# endif
327# ifdef NeXT
328# ifdef __APPLE__
329# define OSMINOR "OS=RHAPSODY"
330# define OS_RHAPSODY
331# else
332# define OSMINOR "OS=NEXT"
333# define OS_NEXT
334# endif
335# endif
336# ifdef __APPLE__
337# define unix
338# define OSMINOR "OS=MACOSX"
339# define OS_MACOSX
340# endif
341# ifdef __osf__
342# ifndef unix
343# define unix
344# endif
345# define OSMINOR "OS=OSF"
346# define OS_OSF
347# endif
348# ifdef _SEQUENT_
349# define OSMINOR "OS=PTX"
350# define OS_PTX
351# endif
352# ifdef M_XENIX
353# define OSMINOR "OS=SCO"
354# define OS_SCO
355# define NO_VFORK
356# endif
357# ifdef sinix
358# define unix
359# define OSMINOR "OS=SINIX"
360# define OS_SINIX
361# endif
362# ifdef sun
363# if defined(__svr4__) || defined(__SVR4)
364# define OSMINOR "OS=SOLARIS"
365# define OS_SOLARIS
366# else
367# define OSMINOR "OS=SUNOS"
368# define OS_SUNOS
369# endif
370# endif
371# ifdef ultrix
372# define OSMINOR "OS=ULTRIX"
373# define OS_ULTRIX
374# endif
375# ifdef _UNICOS
376# define OSMINOR "OS=UNICOS"
377# define OS_UNICOS
378# endif
379# if defined(__USLC__) && !defined(M_XENIX)
380# define OSMINOR "OS=UNIXWARE"
381# define OS_UNIXWARE
382# endif
383# ifdef __OpenBSD__
384# define OSMINOR "OS=OPENBSD"
385# define OS_OPENBSD
386# define unix
387# endif
388# if defined (__FreeBSD_kernel__) && !defined(__FreeBSD__)
389# define OSMINOR "OS=KFREEBSD"
390# define OS_KFREEBSD
391# endif
392# ifndef OSMINOR
393# define OSMINOR "OS=UNKNOWN"
394# endif
395
396/* All the UNIX includes */
397
398# include <sys/types.h>
399# include <sys/stat.h>
400
401# ifndef OS_MPEIX
402# include <sys/file.h>
403# endif
404
405# include <fcntl.h>
406# include <stdio.h>
407# include <ctype.h>
408# include <signal.h>
409# include <string.h>
410# include <time.h>
411
412# ifndef OS_QNX
413# include <memory.h>
414# endif
415
416# ifndef OS_ULTRIX
417# include <stdlib.h>
418# endif
419
420# if !defined(OS_BSDI) && \
421     !defined(OS_FREEBSD) && \
422     !defined(OS_DRAGONFLYBSD) && \
423     !defined(OS_NEXT) && \
424     !defined(OS_MACHTEN) && \
425     !defined(OS_MACOSX) && \
426     !defined(OS_RHAPSODY) && \
427     !defined(OS_MVS) && \
428     !defined(OS_OPENBSD)
429# include <malloc.h>
430# endif
431
432# endif
433
434/*
435 * OSPLAT definitions - suppressed when it's a one-of-a-kind
436 */
437
438# if defined( _M_PPC ) || \
439     defined( PPC ) || \
440     defined( ppc ) || \
441     defined( __powerpc__ ) || \
442     defined( __ppc__ )
443# define OSPLAT "OSPLAT=PPC"
444# endif
445
446# if defined( _ALPHA_ ) || \
447     defined( __alpha__ )
448# define OSPLAT "OSPLAT=AXP"
449# endif
450
451# if defined( _i386_ ) || \
452     defined( __i386__ ) || \
453     defined( _M_IX86 )
454# if !defined( OS_FREEBSD ) && \
455     !defined( OS_DRAGONFLYBSD ) && \
456     !defined( OS_OS2 ) && \
457     !defined( OS_AS400 )
458# define OSPLAT "OSPLAT=X86"
459# endif
460# endif
461
462# ifdef __sparc__
463# if !defined( OS_SUNOS ) && \
464     !defined( OS_SOLARIS )
465# define OSPLAT "OSPLAT=SPARC"
466# endif
467# endif
468
469# ifdef __mips__
470# if !defined( OS_SGI )
471# define OSPLAT "OSPLAT=MIPS"
472# endif
473# endif
474
475# ifdef __arm__
476# define OSPLAT "OSPLAT=ARM"
477# endif
478
479# if defined( __ia64__ ) || defined( __IA64__ )
480# define OSPLAT "OSPLAT=IA64"
481# endif
482
483# ifdef __s390__
484# define OSPLAT "OSPLAT=390"
485# endif
486
487# ifndef OSPLAT
488# define OSPLAT ""
489# endif
490
491/*
492 * Jam implementation misc.
493 */
494
495# ifndef MAXLINE
496# define MAXLINE 102400 /* longest 'together' actions' */
497# endif
498
499# ifndef EXITOK
500# define EXITOK 0
501# define EXITBAD 1
502# endif
503
504# ifndef SPLITPATH
505# define SPLITPATH ':'
506# endif
507
508/* You probably don't need to muck with these. */
509
510# define MAXSYM 1024    /* longest symbol in the environment */
511# define MAXJPATH 1024  /* longest filename */
512
513# define MAXJOBS 64     /* silently enforce -j limit */
514# define MAXARGC 32     /* words in $(JAMSHELL) */
515
516/* Jam private definitions below. */
517
518# define DEBUG_MAX      14
519
520struct globs {
521        int     noexec;
522        int     jobs;
523        int     quitquick;
524        int     newestfirst;            /* build newest sources first */
525        char    debug[DEBUG_MAX];
526        FILE    *cmdout;                /* print cmds, not run them */
527    long timeout; /* number of seconds to limit actions to, default 0 for no limit. */
528} ;
529
530extern struct globs globs;
531
532# define DEBUG_MAKE     ( globs.debug[ 1 ] )    /* show actions when executed */
533# define DEBUG_MAKEQ    ( globs.debug[ 2 ] )    /* show even quiet actions */
534# define DEBUG_EXEC     ( globs.debug[ 2 ] )    /* show text of actons */
535# define DEBUG_MAKEPROG ( globs.debug[ 3 ] )    /* show progress of make0 */
536# define DEBUG_BIND     ( globs.debug[ 3 ] )    /* show when files bound */
537
538# define DEBUG_EXECCMD  ( globs.debug[ 4 ] )    /* show execcmds()'s work */
539
540# define DEBUG_COMPILE  ( globs.debug[ 5 ] )    /* show rule invocations */
541
542# define DEBUG_HEADER   ( globs.debug[ 6 ] )    /* show result of header scan */
543# define DEBUG_BINDSCAN ( globs.debug[ 6 ] )    /* show result of dir scan */
544# define DEBUG_SEARCH   ( globs.debug[ 6 ] )    /* show attempts at binding */
545
546# define DEBUG_VARSET   ( globs.debug[ 7 ] )    /* show variable settings */
547# define DEBUG_VARGET   ( globs.debug[ 8 ] )    /* show variable fetches */
548# define DEBUG_VAREXP   ( globs.debug[ 8 ] )    /* show variable expansions */
549# define DEBUG_IF       ( globs.debug[ 8 ] )    /* show 'if' calculations */
550# define DEBUG_LISTS    ( globs.debug[ 9 ] )    /* show list manipulation */
551# define DEBUG_SCAN     ( globs.debug[ 9 ] )    /* show scanner tokens */
552# define DEBUG_MEM      ( globs.debug[ 9 ] )    /* show memory use */
553
554# define DEBUG_PROFILE  ( globs.debug[ 10 ] )   /* dump rule execution times */
555# define DEBUG_PARSE    ( globs.debug[ 11 ] )   /* debug parsing */
556# define DEBUG_GRAPH    ( globs.debug[ 12 ] )   /* debug dependencies */
557# define DEBUG_FATE ( globs.debug[ 13 ] )  /* show changes to fate in make0() */
558
559#endif
Note: See TracBrowser for help on using the repository browser.