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, version 3 of the License ONLY.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * jam.h - includes and globals for jam
23 #if defined(__GNUC__) && __GNUC__ > 2
24 # define JAMFA_PURE __attribute__((pure))
26 # define JAMFA_NORETURN __attribute__((noreturn))
27 # define JAMFA_PRINTF(m,n) __attribute__((format(printf, m, n)))
28 # define JAMFA_SENTINEL __attribute__((sentinel))
32 # define JAMFA_NORETURN
33 # define JAMFA_PRINTF(m,n)
34 # define JAMFA_SENTINEL
49 # define OSMAJOR "NT=true"
50 # define OSMINOR "OS=NT"
52 # define SPLITPATH ';'
53 # define MAXLINE 2046 /* longest 'together' actions */
54 /*# define USE_EXECNT*/
55 # define PATH_DELIM '\\'
56 # define DOWNSHIFT_PATHS
71 # define OSMAJOR "MINGW=true"
72 # define OSMINOR "OS=MINGW"
74 # define SPLITPATH ';'
75 # define MAXLINE 2046 /* longest 'together' actions */
76 # define PATH_DELIM '\\'
77 # define DOWNSHIFT_PATHS
81 /* God fearing UNIX */
83 # define OSMAJOR "UNIX=true"
85 # define PATH_DELIM '/'
87 # define OSMINOR "OS=FREEBSD"
91 # define OSMINOR "OS=LINUX"
96 # define OSMINOR "OS=NETBSD"
102 # define OSMINOR "OS=QNXNTO"
106 # define OSMINOR "OS=QNX"
114 # define OSMINOR "OS=MACOSX"
118 # define OSMINOR "OS=AIX"
121 # define OSMINOR "OS=UNKNOWN"
123 /* All the UNIX includes */
124 # include <sys/types.h>
125 # include <sys/stat.h>
126 # include <sys/file.h>
137 # if !defined(OS_FREEBSD) && !defined(OS_MACOSX)
140 # include <sys/types.h>
141 # include <sys/wait.h>
146 /* OSPLAT definitions - suppressed when it's a one-of-a-kind */
147 #if defined(_M_PPC) || \
150 defined(__powerpc__) || \
151 defined(__POWERPC__) || \
153 # define OSPLAT "OSPLAT=PPC"
156 #if defined(_i386_) || \
157 defined(__i386__) || \
159 # if !defined(OS_FREEBSD)
160 # define OSPLAT "OSPLAT=X86"
164 #if defined(__x86_64__)
168 # define OSPLAT "OSPLAT=X86_64"
172 # define OSPLAT "OSPLAT=SPARC"
176 # define OSPLAT "OSPLAT=MIPS"
180 # define OSPLAT "OSPLAT=ARM"
183 #if defined(__ia64__) || defined(__IA64__) || defined(_M_IA64)
184 # define OSPLAT "OSPLAT=IA64"
188 # define OSPLAT "OSPLAT=390"
191 #if defined(__ppc64__)
195 # define OSPLAT "OSPLAT=PPC64"
203 /* Jam implementation misc. */
204 /* longest 'together' actions' */
206 # define MAXLINE (10240)
215 # define SPLITPATH ':'
219 /* You probably don't need to muck with these. */
220 #define MAXJPATH (8192) /* longest filename */
222 #define MAXJOBS (64) /* silently enforce -j limit */
223 #define MAXARGC (32) /* words in $(JAMSHELL) */
226 /* Jam private definitions below. */
227 #define DEBUG_MAX (16)
233 int newestfirst
; /* build newest sources first */
234 char debug
[DEBUG_MAX
];
235 FILE *cmdout
; /* print cmds, not run them */
236 //#ifdef OPT_IMPROVED_PROGRESS_EXT
237 int updating
; /* # targets we are updating */
238 void *progress
; /* progress data (progress.h) */
242 extern struct globs globs
;
245 #define DEBUG_MAKE (globs.debug[1]) /* -da show actions when executed */
246 #define DEBUG_MAKEPROG (globs.debug[3]) /* -dm show progress of make0 */
248 #define DEBUG_EXECCMD (globs.debug[4]) /* show execcmds()'s work */
250 #define DEBUG_COMPILE (globs.debug[5]) /* show rule invocations */
252 #define DEBUG_HEADER (globs.debug[6]) /* show result of header scan */
253 #define DEBUG_BINDSCAN (globs.debug[6]) /* show result of dir scan */
254 #define DEBUG_SEARCH (globs.debug[6]) /* show attempts at binding */
256 #define DEBUG_VARSET (globs.debug[7]) /* show variable settings */
257 #define DEBUG_VARGET (globs.debug[8]) /* show variable fetches */
258 #define DEBUG_VAREXP (globs.debug[8]) /* show variable expansions */
259 #define DEBUG_IF (globs.debug[8]) /* show 'if' calculations */
260 #define DEBUG_LISTS (globs.debug[9]) /* show list manipulation */
261 #define DEBUG_MEM (globs.debug[9]) /* show memory use */
263 #define DEBUG_MAKEQ (globs.debug[11]) /* -da show even quiet actions */
264 #define DEBUG_EXEC (globs.debug[12]) /* -dx show text of actions */
265 #define DEBUG_DEPENDS (globs.debug[13]) /* -dd show dependency graph */
266 #define DEBUG_CAUSES (globs.debug[14]) /* -dc show dependency graph */
267 #define DEBUG_SCAN (globs.debug[15]) /* show scanner tokens */
270 extern void jambase_unpack (void);
273 #define JAM_OPT_SEMAPHORE
276 /******************************************************************************/
281 const char *restr
; /* regexp string; DON'T DELETE, DON'T MOVE, DON'T CHANGE! */
282 re9_prog_t
*re
; /* compiled regexp */
283 int flags
; /* flags for re9_execute() */
284 /*REGEXP9_DEBUG_MEMSIZE*/
292 * u: this is utf-8 string
293 * m: '.' matches newline
294 * default mode: non-utf-8 (it can be only reset with /.../u)
296 extern regexp_t
*regexp_compile (const char *str
, int flags
);
297 extern int regexp_execute (regexp_t
*re
, const char *bol
, re9_sub_t
*mp
, int ms
);
298 extern void regexp_free (regexp_t
*re
);
299 extern void regexp_done (void);