2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
3 * This file is part of Jam - see jam.c for Copyright information.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * jam.h - includes and globals for jam
24 #if defined(__GNUC__) && __GNUC__ > 2
25 # define JAMFA_PURE __attribute__((pure))
26 # define JAMFA_CONST __attribute__((const))
27 # define JAMFA_NORETURN __attribute__((noreturn))
28 # define JAMFA_PRINTF(m,n) __attribute__((format(printf, m, n)))
29 # define JAMFA_SENTINEL __attribute__((sentinel))
33 # define JAMFA_NORETURN
34 # define JAMFA_PRINTF(m,n)
35 # define JAMFA_SENTINEL
50 # define OSMAJOR "NT=true"
51 # define OSMINOR "OS=NT"
53 # define SPLITPATH ';'
54 # define MAXLINE 2046 /* longest 'together' actions */
55 /*# define USE_EXECNT*/
56 # define PATH_DELIM '\\'
57 # define DOWNSHIFT_PATHS
72 # define OSMAJOR "MINGW=true"
73 # define OSMINOR "OS=MINGW"
75 # define SPLITPATH ';'
76 # define MAXLINE 2046 /* longest 'together' actions */
77 # define PATH_DELIM '\\'
78 # define DOWNSHIFT_PATHS
82 /* God fearing UNIX */
84 # define OSMAJOR "UNIX=true"
86 # define PATH_DELIM '/'
88 # define OSMINOR "OS=FREEBSD"
92 # define OSMINOR "OS=LINUX"
97 # define OSMINOR "OS=NETBSD"
103 # define OSMINOR "OS=QNXNTO"
107 # define OSMINOR "OS=QNX"
115 # define OSMINOR "OS=MACOSX"
119 # define OSMINOR "OS=UNKNOWN"
121 /* All the UNIX includes */
122 # include <sys/types.h>
123 # include <sys/stat.h>
124 # include <sys/file.h>
135 # if !defined(OS_FREEBSD) && !defined(OS_MACOSX)
138 # include <sys/types.h>
139 # include <sys/wait.h>
144 /* OSPLAT definitions - suppressed when it's a one-of-a-kind */
145 #if defined(_M_PPC) || \
148 defined(__powerpc__) || \
149 defined(__POWERPC__) || \
151 # define OSPLAT "OSPLAT=PPC"
154 #if defined(_i386_) || \
155 defined(__i386__) || \
157 # if !defined(OS_FREEBSD)
158 # define OSPLAT "OSPLAT=X86"
162 #if defined(__x86_64__)
166 # define OSPLAT "OSPLAT=X86_64"
170 # define OSPLAT "OSPLAT=SPARC"
174 # define OSPLAT "OSPLAT=MIPS"
178 # define OSPLAT "OSPLAT=ARM"
181 #if defined(__ia64__) || defined(__IA64__) || defined(_M_IA64)
182 # define OSPLAT "OSPLAT=IA64"
186 # define OSPLAT "OSPLAT=390"
194 /* Jam implementation misc. */
195 /* longest 'together' actions' */
197 # define MAXLINE (10240)
206 # define SPLITPATH ':'
210 /* You probably don't need to muck with these. */
211 #define MAXJPATH (8192) /* longest filename */
213 #define MAXJOBS (64) /* silently enforce -j limit */
214 #define MAXARGC (32) /* words in $(JAMSHELL) */
217 /* Jam private definitions below. */
218 #define DEBUG_MAX (16)
224 int newestfirst
; /* build newest sources first */
225 char debug
[DEBUG_MAX
];
226 FILE *cmdout
; /* print cmds, not run them */
227 //#ifdef OPT_IMPROVED_PROGRESS_EXT
228 int updating
; /* # targets we are updating */
229 void *progress
; /* progress data (progress.h) */
233 extern struct globs globs
;
236 #define DEBUG_MAKE (globs.debug[1]) /* -da show actions when executed */
237 #define DEBUG_MAKEPROG (globs.debug[3]) /* -dm show progress of make0 */
239 #define DEBUG_EXECCMD (globs.debug[4]) /* show execcmds()'s work */
241 #define DEBUG_COMPILE (globs.debug[5]) /* show rule invocations */
243 #define DEBUG_HEADER (globs.debug[6]) /* show result of header scan */
244 #define DEBUG_BINDSCAN (globs.debug[6]) /* show result of dir scan */
245 #define DEBUG_SEARCH (globs.debug[6]) /* show attempts at binding */
247 #define DEBUG_VARSET (globs.debug[7]) /* show variable settings */
248 #define DEBUG_VARGET (globs.debug[8]) /* show variable fetches */
249 #define DEBUG_VAREXP (globs.debug[8]) /* show variable expansions */
250 #define DEBUG_IF (globs.debug[8]) /* show 'if' calculations */
251 #define DEBUG_LISTS (globs.debug[9]) /* show list manipulation */
252 #define DEBUG_MEM (globs.debug[9]) /* show memory use */
254 #define DEBUG_MAKEQ (globs.debug[11]) /* -da show even quiet actions */
255 #define DEBUG_EXEC (globs.debug[12]) /* -dx show text of actions */
256 #define DEBUG_DEPENDS (globs.debug[13]) /* -dd show dependency graph */
257 #define DEBUG_CAUSES (globs.debug[14]) /* -dc show dependency graph */
258 #define DEBUG_SCAN (globs.debug[15]) /* show scanner tokens */
261 extern void jambase_unpack (void);
264 #define JAM_OPT_SEMAPHORE
267 /******************************************************************************/
272 const char *restr
; /* regexp string; DON'T DELETE, DON'T MOVE, DON'T CHANGE! */
273 re9_prog_t
*re
; /* compiled regexp */
274 int flags
; /* flags for re9_execute() */
275 /*REGEXP9_DEBUG_MEMSIZE*/
283 * u: this is utf-8 string
284 * m: '.' matches newline
285 * default mode: non-utf-8 (it can be only reset with /.../u)
287 extern regexp_t
*regexp_compile (const char *str
, int flags
);
288 extern int regexp_execute (regexp_t
*re
, const char *bol
, re9_sub_t
*mp
, int ms
);
289 extern void regexp_free (regexp_t
*re
);
290 extern void regexp_done (void);