The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

jam.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 1993, 1995 Christopher Seiwald.
00003  *
00004  * This file is part of Jam - see jam.c for Copyright information.
00005  */
00006 
00007 /*  This file is ALSO:
00008  *  (C) Copyright David Abrahams 2001-2002. Permission to copy, use,
00009  *  modify, sell and distribute this software is granted provided this
00010  *  copyright notice appears in all copies. This software is provided
00011  *  "as is" without express or implied warranty, and with no claim as
00012  *  to its suitability for any purpose.
00013  */
00014 
00015 /*
00016  * jam.h - includes and globals for jam
00017  *
00018  * 04/08/94 (seiwald) - Coherent/386 support added.
00019  * 04/21/94 (seiwald) - DGUX is __DGUX__, not just __DGUX.
00020  * 05/04/94 (seiwald) - new globs.jobs (-j jobs)
00021  * 11/01/94 (wingerd) - let us define path of Jambase at compile time.
00022  * 12/30/94 (wingerd) - changed command buffer size for NT (MS-DOS shell).
00023  * 02/22/95 (seiwald) - Jambase now in /usr/local/lib.
00024  * 04/30/95 (seiwald) - FreeBSD added.  Live Free or Die.
00025  * 05/10/95 (seiwald) - SPLITPATH character set up here.
00026  * 08/20/95 (seiwald) - added LINUX.
00027  * 08/21/95 (seiwald) - added NCR.
00028  * 10/23/95 (seiwald) - added SCO.
00029  * 01/03/96 (seiwald) - SINIX (nixdorf) added.
00030  * 03/13/96 (seiwald) - Jambase now compiled in; remove JAMBASE variable.
00031  * 04/29/96 (seiwald) - AIX now has 31 and 42 OSVERs.
00032  * 11/21/96 (peterk)  - added BeOS with MW CW mwcc
00033  * 12/21/96 (seiwald) - OSPLAT now defined for NT.
00034  * 07/19/99 (sickel)  - Mac OS X Server and Client support added
00035  * 02/18/00 (belmonte)- Support for Cygwin.
00036  * 09/12/00 (seiwald) - OSSYMS split to OSMAJOR/OSMINOR/OSPLAT
00037  * 12/29/00 (seiwald) - OSVER dropped.
00038  */
00039 
00040 #ifndef JAM_H_VP_2003_08_01
00041 #define JAM_H_VP_2003_08_01
00042 /*
00043  * VMS, OPENVMS
00044  */
00045 
00046 # ifdef VMS
00047 
00048 # include <types.h>
00049 # include <file.h>
00050 # include <stat.h>
00051 # include <stdio.h>
00052 # include <ctype.h>
00053 # include <stdlib.h>
00054 # include <signal.h>
00055 # include <string.h>
00056 # include <time.h>
00057 # include <unistd.h>
00058 # include <unixlib.h>
00059 
00060 # define OSMINOR "OS=VMS"
00061 # define OSMAJOR "VMS=true"
00062 # define OS_VMS
00063 # define MAXLINE 1024 /* longest 'together' actions */
00064 # define SPLITPATH ','
00065 # define EXITOK 1
00066 # define EXITBAD 0
00067 # define DOWNSHIFT_PATHS
00068 
00069 /* This may be inaccurate */
00070 # ifndef __DECC
00071 # define OSPLAT "OSPLAT=VAX"
00072 # endif 
00073 
00074 # endif
00075 
00076 /*
00077  * Windows NT
00078  */
00079 
00080 # ifdef NT
00081 
00082 # include <fcntl.h>
00083 # include <stdlib.h>
00084 # include <stdio.h>
00085 # include <ctype.h>
00086 # include <malloc.h>
00087 # ifndef __MWERKS__
00088 # include <memory.h>
00089 #endif
00090 # include <signal.h>
00091 # include <string.h>
00092 # include <time.h>
00093 
00094 # define OSMAJOR "NT=true"
00095 # define OSMINOR "OS=NT"
00096 # define OS_NT
00097 # define SPLITPATH ';'
00098 /* Windows NT 3.51 only allows 996 chars per line, but we deal */
00099 /* with problem in "execnt.c".                                 */
00100 # define MAXLINE (maxline())    /* longest 'together' actions */
00101 # define USE_EXECNT
00102 # define USE_PATHUNIX
00103 # define PATH_DELIM '\\'
00104 # define DOWNSHIFT_PATHS
00105 
00106 /* AS400 cross-compile from NT */
00107 
00108 # ifdef AS400
00109 # undef OSMINOR
00110 # undef OSMAJOR
00111 # define OSMAJOR "AS400=true"
00112 # define OSMINOR "OS=AS400"
00113 # define OS_AS400
00114 # endif
00115 
00116 # endif
00117 
00118 /*
00119  * Windows MingW32
00120  */
00121 
00122 # ifdef MINGW
00123 
00124 # include <fcntl.h>
00125 # include <stdlib.h>
00126 # include <stdio.h>
00127 # include <ctype.h>
00128 # include <malloc.h>
00129 # include <memory.h>
00130 # include <signal.h>
00131 # include <string.h>
00132 # include <time.h>
00133 
00134 # define OSMAJOR "MINGW=true"
00135 # define OSMINOR "OS=MINGW"
00136 # define OS_NT
00137 # define SPLITPATH ';'
00138 # define MAXLINE 996    /* longest 'together' actions */
00139 # define USE_EXECUNIX
00140 # define USE_PATHUNIX
00141 # define PATH_DELIM '\\'
00142 # define DOWNSHIFT_PATHS
00143 
00144 # endif
00145 
00146 /*
00147  * OS2
00148  */
00149 
00150 # ifdef __OS2__
00151 
00152 # include <fcntl.h>
00153 # include <stdlib.h>
00154 # include <stdio.h>
00155 # include <ctype.h>
00156 # include <malloc.h>
00157 # include <signal.h>
00158 # include <string.h>
00159 # include <time.h>
00160 
00161 # define OSMAJOR "OS2=true"
00162 # define OSMINOR "OS=OS2"
00163 # define OS_OS2
00164 # define SPLITPATH ';'
00165 # define MAXLINE 996    /* longest 'together' actions */
00166 # define USE_EXECUNIX
00167 # define USE_PATHUNIX
00168 # define PATH_DELIM '\\'
00169 # define DOWNSHIFT_PATHS
00170 
00171 # ifdef __EMX__
00172 #   define USE_FILEUNIX
00173 # endif
00174 
00175 # endif
00176 
00177 /*
00178  * Macintosh MPW
00179  */
00180 
00181 # ifdef macintosh
00182 
00183 # include <time.h>
00184 # include <stdlib.h>
00185 # include <string.h>
00186 # include <stdio.h>
00187 
00188 # define OSMAJOR "MAC=true"
00189 # define OSMINOR "OS=MAC"
00190 # define OS_MAC
00191 # define SPLITPATH ','
00192 
00193 # endif
00194 
00195 /*
00196  * God fearing UNIX
00197  */
00198 
00199 # ifndef OSMINOR
00200 
00201 # define OSMAJOR "UNIX=true"
00202 # define USE_EXECUNIX
00203 # define USE_FILEUNIX
00204 # define USE_PATHUNIX
00205 # define PATH_DELIM '/'
00206 
00207 # ifdef _AIX
00208 # define unix
00209 # define OSMINOR "OS=AIX"
00210 # define OS_AIX
00211 # define NO_VFORK
00212 # endif
00213 # ifdef AMIGA
00214 # define OSMINOR "OS=AMIGA"
00215 # define OS_AMIGA
00216 # endif
00217 # ifdef __BEOS__
00218 # define unix
00219 # define OSMINOR "OS=BEOS"
00220 # define OS_BEOS
00221 # define NO_VFORK
00222 # endif
00223 # ifdef __bsdi__
00224 # define OSMINOR "OS=BSDI"
00225 # define OS_BSDI
00226 # endif
00227 # if defined (COHERENT) && defined (_I386)
00228 # define OSMINOR "OS=COHERENT"
00229 # define OS_COHERENT
00230 # define NO_VFORK
00231 # endif
00232 # if defined(__cygwin__) || defined(__CYGWIN__)
00233 # define OSMINOR "OS=CYGWIN"
00234 # define OS_CYGWIN
00235 # endif
00236 # ifdef __FreeBSD__
00237 # define OSMINOR "OS=FREEBSD"
00238 # define OS_FREEBSD
00239 # endif
00240 # ifdef __DGUX__
00241 # define OSMINOR "OS=DGUX"
00242 # define OS_DGUX
00243 # endif
00244 # ifdef __hpux
00245 # define OSMINOR "OS=HPUX"
00246 # define OS_HPUX
00247 # endif
00248 # ifdef __OPENNT
00249 # define unix
00250 # define OSMINOR "OS=INTERIX"
00251 # define OS_INTERIX
00252 # define NO_VFORK
00253 # endif
00254 # ifdef __sgi
00255 # define OSMINOR "OS=IRIX"
00256 # define OS_IRIX
00257 # define NO_VFORK
00258 # endif
00259 # ifdef __ISC
00260 # define OSMINOR "OS=ISC"
00261 # define OS_ISC
00262 # define NO_VFORK
00263 # endif
00264 # ifdef linux
00265 # define OSMINOR "OS=LINUX"
00266 # define OS_LINUX
00267 # endif
00268 # ifdef __Lynx__
00269 # define OSMINOR "OS=LYNX"
00270 # define OS_LYNX
00271 # define NO_VFORK
00272 # define unix
00273 # endif
00274 # ifdef __MACHTEN__
00275 # define OSMINOR "OS=MACHTEN"
00276 # define OS_MACHTEN
00277 # endif
00278 # ifdef mpeix
00279 # define unix
00280 # define OSMINOR "OS=MPEIX"
00281 # define OS_MPEIX
00282 # define NO_VFORK
00283 # endif
00284 # ifdef __MVS__
00285 # define unix
00286 # define OSMINOR "OS=MVS"
00287 # define OS_MVS
00288 # endif
00289 # ifdef _ATT4
00290 # define OSMINOR "OS=NCR"
00291 # define OS_NCR
00292 # endif
00293 # ifdef __NetBSD__
00294 # define unix
00295 # define OSMINOR "OS=NETBSD"
00296 # define OS_NETBSD
00297 # define NO_VFORK
00298 # endif
00299 # ifdef __QNX__
00300 # ifdef __QNXNTO__
00301 # define OSMINOR "OS=QNXNTO"
00302 # define OS_QNXNTO
00303 # else
00304 # define unix
00305 # define OSMINOR "OS=QNX"
00306 # define OS_QNX
00307 # define NO_VFORK
00308 # define MAXLINE 996
00309 # endif
00310 # endif
00311 # ifdef NeXT
00312 # ifdef __APPLE__
00313 # define OSMINOR "OS=RHAPSODY"
00314 # define OS_RHAPSODY
00315 # else
00316 # define OSMINOR "OS=NEXT"
00317 # define OS_NEXT
00318 # endif
00319 # endif
00320 # ifdef __APPLE__
00321 # define unix
00322 # define OSMINOR "OS=MACOSX"
00323 # define OS_MACOSX
00324 # endif
00325 # ifdef __osf__
00326 # define OSMINOR "OS=OSF"
00327 # define OS_OSF
00328 # endif
00329 # ifdef _SEQUENT_
00330 # define OSMINOR "OS=PTX"
00331 # define OS_PTX
00332 # endif
00333 # ifdef M_XENIX
00334 # define OSMINOR "OS=SCO"
00335 # define OS_SCO
00336 # define NO_VFORK
00337 # endif
00338 # ifdef sinix
00339 # define unix
00340 # define OSMINOR "OS=SINIX"
00341 # define OS_SINIX
00342 # endif
00343 # ifdef sun
00344 # if defined(__svr4__) || defined(__SVR4)
00345 # define OSMINOR "OS=SOLARIS"
00346 # define OS_SOLARIS
00347 # else
00348 # define OSMINOR "OS=SUNOS"
00349 # define OS_SUNOS
00350 # endif
00351 # endif
00352 # ifdef ultrix
00353 # define OSMINOR "OS=ULTRIX"
00354 # define OS_ULTRIX
00355 # endif
00356 # ifdef _UNICOS
00357 # define OSMINOR "OS=UNICOS"
00358 # define OS_UNICOS
00359 # endif
00360 # if defined(__USLC__) && !defined(M_XENIX)
00361 # define OSMINOR "OS=UNIXWARE"
00362 # define OS_UNIXWARE
00363 # endif
00364 # ifdef __OpenBSD__
00365 # define OSMINOR "OS=OPENBSD"
00366 # define OS_OPENBSD
00367 # define unix
00368 # endif
00369 # ifndef OSMINOR
00370 # define OSMINOR "OS=UNKNOWN"
00371 # endif
00372 
00373 /* All the UNIX includes */
00374 
00375 # include <sys/types.h>
00376 # include <sys/stat.h>
00377 
00378 # ifndef OS_MPEIX
00379 # include <sys/file.h>
00380 # endif
00381 
00382 # include <fcntl.h>
00383 # include <stdio.h>
00384 # include <ctype.h>
00385 # include <signal.h>
00386 # include <string.h>
00387 # include <time.h>
00388 
00389 # ifndef OS_QNX
00390 # include <memory.h>
00391 # endif
00392 
00393 # ifndef OS_ULTRIX
00394 # include <stdlib.h>
00395 # endif
00396 
00397 # if !defined(OS_BSDI) && \
00398      !defined(OS_FREEBSD) && \
00399      !defined(OS_NEXT) && \
00400      !defined(OS_MACHTEN) && \
00401      !defined(OS_MACOSX) && \
00402      !defined(OS_RHAPSODY) && \
00403      !defined(OS_MVS) && \
00404      !defined(OS_OPENBSD)
00405 # include <malloc.h>
00406 # endif
00407 
00408 # endif 
00409 
00410 /* 
00411  * OSPLAT definitions - suppressed when it's a one-of-a-kind
00412  */
00413 
00414 # if defined( _M_PPC ) || \
00415      defined( PPC ) || \
00416      defined( ppc ) || \
00417      defined( __powerpc__ ) || \
00418      defined( __ppc__ )
00419 # define OSPLAT "OSPLAT=PPC"
00420 # endif
00421 
00422 # if defined( _ALPHA_ ) || \
00423      defined( __alpha__ )
00424 # define OSPLAT "OSPLAT=AXP"
00425 # endif
00426 
00427 # if defined( _i386_ ) || \
00428      defined( __i386__ ) || \
00429      defined( _M_IX86 )
00430 # if !defined( OS_FREEBSD ) && \
00431      !defined( OS_OS2 ) && \
00432      !defined( OS_AS400 )
00433 # define OSPLAT "OSPLAT=X86"
00434 # endif
00435 # endif 
00436 
00437 # ifdef __sparc__
00438 # if !defined( OS_SUNOS ) && \
00439      !defined( OS_SOLARIS )
00440 # define OSPLAT "OSPLAT=SPARC"
00441 # endif
00442 # endif
00443 
00444 # ifdef __mips__
00445 # if !defined( OS_SGI )
00446 # define OSPLAT "OSPLAT=MIPS"
00447 # endif
00448 # endif
00449 
00450 # ifdef __arm__
00451 # define OSPLAT "OSPLAT=ARM"
00452 # endif
00453 
00454 # if defined( __ia64__ ) || defined( __IA64__ )
00455 # define OSPLAT "OSPLAT=IA64"
00456 # endif
00457 
00458 # ifdef __s390__
00459 # define OSPLAT "OSPLAT=390"
00460 # endif
00461 
00462 # ifndef OSPLAT
00463 # define OSPLAT ""
00464 # endif
00465 
00466 /*
00467  * Jam implementation misc.
00468  */
00469 
00470 # ifndef MAXLINE
00471 # define MAXLINE 102400 /* longest 'together' actions' */
00472 # endif
00473 
00474 # ifndef EXITOK
00475 # define EXITOK 0
00476 # define EXITBAD 1
00477 # endif
00478 
00479 # ifndef SPLITPATH
00480 # define SPLITPATH ':'
00481 # endif
00482 
00483 /* You probably don't need to muck with these. */
00484 
00485 # define MAXSYM 1024    /* longest symbol in the environment */
00486 # define MAXJPATH 1024  /* longest filename */
00487 
00488 # define MAXJOBS 64     /* silently enforce -j limit */
00489 # define MAXARGC 32     /* words in $(JAMSHELL) */
00490 
00491 /* Jam private definitions below. */
00492 
00493 # define DEBUG_MAX      14
00494 
00495 struct globs {
00496         int     noexec;
00497         int     jobs;
00498         int     quitquick;
00499         int     newestfirst;            /* build newest sources first */
00500         char    debug[DEBUG_MAX];
00501         FILE    *cmdout;                /* print cmds, not run them */
00502 } ;
00503 
00504 extern struct globs globs;
00505 
00506 # define DEBUG_MAKE     ( globs.debug[ 1 ] )    /* show actions when executed */
00507 # define DEBUG_MAKEQ    ( globs.debug[ 2 ] )    /* show even quiet actions */
00508 # define DEBUG_EXEC     ( globs.debug[ 2 ] )    /* show text of actons */
00509 # define DEBUG_MAKEPROG ( globs.debug[ 3 ] )    /* show progress of make0 */
00510 # define DEBUG_BIND     ( globs.debug[ 3 ] )    /* show when files bound */
00511 
00512 # define DEBUG_EXECCMD  ( globs.debug[ 4 ] )    /* show execcmds()'s work */
00513 
00514 # define DEBUG_COMPILE  ( globs.debug[ 5 ] )    /* show rule invocations */
00515 
00516 # define DEBUG_HEADER   ( globs.debug[ 6 ] )    /* show result of header scan */
00517 # define DEBUG_BINDSCAN ( globs.debug[ 6 ] )    /* show result of dir scan */
00518 # define DEBUG_SEARCH   ( globs.debug[ 6 ] )    /* show attempts at binding */
00519 
00520 # define DEBUG_VARSET   ( globs.debug[ 7 ] )    /* show variable settings */
00521 # define DEBUG_VARGET   ( globs.debug[ 8 ] )    /* show variable fetches */
00522 # define DEBUG_VAREXP   ( globs.debug[ 8 ] )    /* show variable expansions */
00523 # define DEBUG_IF       ( globs.debug[ 8 ] )    /* show 'if' calculations */
00524 # define DEBUG_LISTS    ( globs.debug[ 9 ] )    /* show list manipulation */
00525 # define DEBUG_SCAN     ( globs.debug[ 9 ] )    /* show scanner tokens */
00526 # define DEBUG_MEM      ( globs.debug[ 9 ] )    /* show memory use */
00527 
00528 # define DEBUG_PROFILE  ( globs.debug[ 10 ] )   /* dump rule execution times */
00529 # define DEBUG_PARSE    ( globs.debug[ 11 ] )   /* debug parsing */
00530 # define DEBUG_GRAPH    ( globs.debug[ 12 ] )   /* debug dependencies */
00531 # define DEBUG_FATE ( globs.debug[ 13 ] )  /* show changes to fate in make0() */
00532 
00533 #endif

Generated on Mon Nov 8 17:07:36 2004 for MPT by  doxygen 1.3.9.1