1 /* $TOG: imakemdep.h /main/101 1997/06/06 09:13:20 bill $ */
4 Copyright (c) 1993, 1994 X Consortium
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 Except as contained in this notice, the name of the X Consortium shall not be
24 used in advertising or otherwise to promote the sale, use or other dealings
25 in this Software without prior written authorization from the X Consortium.
28 /* $XFree86: xc/config/imake/imakemdep.h,v 3.24.2.3 1997/07/27 02:41:05 dawes Exp $ */
32 * This file contains machine-dependent constants for the imake utility.
33 * When porting imake, read each of the steps below and add in any necessary
34 * definitions. In general you should *not* edit ccimake.c or imake.c!
39 * Step 1: imake_ccflags
40 * Define any special flags that will be needed to get imake.c to compile.
41 * These will be passed to the compile along with the contents of the
42 * make variable BOOTSTRAPCFLAGS.
44 #if defined(clipper) || defined(__clipper__)
45 #define imake_ccflags "-O -DSYSV -DBOOTSTRAPCFLAGS=-DSYSV"
50 #define imake_ccflags "-DSYSV"
52 #define imake_ccflags "-Wc,-Nd4000,-Ns3000 -DSYSV"
56 #if defined(macII) || defined(_AUX_SOURCE)
57 #define imake_ccflags "-DmacII -DSYSV"
61 #define imake_ccflags "-DSYSV"
64 #if defined(USL) || defined(__USLC__) || defined(Oki) || defined(NCR)
65 #define imake_ccflags "-Xa -DSVR4"
68 /* SCO may define __USLC__ so put this after the USL check */
69 #if defined(M_UNIX) || defined(_SCO_DS)
73 #define imake_ccflags "-Dsco -DSYSV"
77 #if defined(SYSTYPE_SYSV) || defined(_SYSTYPE_SYSV)
78 #define imake_ccflags "-DSVR4"
80 #include <sys/param.h>
82 #define imake_ccflags "-Dbsd43 -DNOSTDHDRS"
85 #define imake_ccflags "-Dbsd43"
92 #define imake_ccflags "-DSYSV -DUSG"
95 #if defined(_IBMR2) || defined(aix)
96 #define imake_ccflags "-Daix -DSYSV"
100 # if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
101 # define imake_ccflags "-DBSD43"
103 # define imake_ccflags "-DSYSV"
108 #define imake_ccflags "-Dluna -Duniosb"
113 # define imake_ccflags "-Xa -DSVR4"
115 # define imake_ccflags "-DSYSV"
121 # define imake_ccflags "-Xa -DSVR4"
127 # define imake_ccflags "-DSYSV"
132 #define imake_ccflags "-fn -tm c1"
136 #define imake_ccflags "-DX_NOT_POSIX"
141 #define imake_ccflags "-nologo -batch -D__STDC__"
143 #define imake_ccflags "-nologo -D__STDC__"
148 #define imake_ccflags "-DSVR4 -DANSICPP"
152 #define imake_ccflags "-DSYSV -DUSG -DNOSTDHDRS"
156 #define imake_ccflags "-DX_NOT_STDC_ENV -DX_NOT_POSIX"
160 #define imake_ccflags "-DSYSV -DUSG"
163 #if defined(SX) || defined(PC_UX)
164 #define imake_ccflags "-DSYSV"
168 #define imake_ccflags "-DUSG"
171 #if defined(nec_ews_svr4) || defined(_nec_ews_svr4) || defined(_nec_up) || defined(_nec_ft)
172 #define imake_ccflags "-DSVR4"
176 #define imake_ccflags "-DNOSTDHDRS"
179 /* this is for OS/2 under EMX. This won't work with DOS */
181 #define imake_ccflags "-DBSD43"
184 #else /* not CCIMAKE */
188 * If your OS doesn't have a dup2() system call to duplicate one file
189 * descriptor onto another, define such a mechanism here (if you don't
190 * already fall under the existing category(ies).
192 #if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_) && !defined(sco)
193 #define dup2(fd1,fd2) ((fd1 == fd2) ? fd1 : (close(fd2), \
194 fcntl(fd1, F_DUPFD, fd2)))
199 * Step 3: FIXUP_CPP_WHITESPACE
200 * If your cpp collapses tabs macro expansions into a single space and
201 * replaces escaped newlines with a space, define this symbol. This will
202 * cause imake to attempt to patch up the generated Makefile by looking
203 * for lines that have colons in them (this is why the rules file escapes
204 * all colons). One way to tell if you need this is to see whether or not
205 * your Makefiles have no tabs in them and lots of @@ strings.
207 #if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(sco) || (defined(AMOEBA) && defined(CROSS_COMPILE))
208 #define FIXUP_CPP_WHITESPACE
211 #define REMOVE_CPP_LEADSPACE
212 #define INLINE_SYNTAX
213 #define MAGIC_MAKE_VARS
216 #define FIXUP_CPP_WHITESPACE
220 * Step 4: USE_CC_E, DEFAULT_CC, DEFAULT_CPP
221 * If you want to use cc -E instead of cpp, define USE_CC_E.
222 * If use cc -E but want a different compiler, define DEFAULT_CC.
223 * If the cpp you need is not in /lib/cpp, define DEFAULT_CPP.
230 #define DEFAULT_CC "cl"
233 #define DEFAULT_CPP "/usr/lib/cpp"
235 #if defined(clipper) || defined(__clipper__)
236 #define DEFAULT_CPP "/usr/lib/cpp"
238 #if defined(_IBMR2) && !defined(DEFAULT_CPP)
239 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
241 #if defined(sun) && (defined(SVR4) || defined(__svr4__) || defined(__SVR4) || defined(__sol__))
242 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
245 #define DEFAULT_CPP "/usr/bin/cpp"
248 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
251 #define DEFAULT_CPP "/usr/lib/cpp"
254 #define DEFAULT_CPP "/lib/pcpp"
256 #if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
257 #define DEFAULT_CPP "/usr/libexec/cpp"
259 #if defined(__sgi) && defined(__ANSI_CPP__)
266 #define DEFAULT_CPP "/usr/lib/cpp"
269 /* expects cpp in PATH */
270 #define DEFAULT_CPP "cpp"
275 * The following table contains the flags that should be passed
276 * whenever a Makefile is being generated. If your preprocessor
277 * doesn't predefine any unique symbols, choose one and add it to the
278 * end of this table. Then, do the following:
280 * a. Use this symbol in Imake.tmpl when setting MacroFile.
281 * b. Put this symbol in the definition of BootstrapCFlags in your
282 * <platform>.cf file.
283 * c. When doing a make World, always add "BOOTSTRAPCFLAGS=-Dsymbol"
284 * to the end of the command line.
286 * Note that you may define more than one symbol (useful for platforms
287 * that support multiple operating systems).
290 #define ARGUMENTS 50 /* number of arguments in various arrays */
291 char *cpp_argv[ARGUMENTS] = {
292 "cc", /* replaced by the actual program to exec */
293 "-I.", /* add current directory to include path */
295 "-Uunix", /* remove unix symbol so that filename unix.c okay */
297 #if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(MACH)
306 "-DM4330", /* Tektronix */
309 "-DM4310", /* Tektronix */
311 #if defined(macII) || defined(_AUX_SOURCE)
312 "-DmacII", /* Apple A/UX */
314 #if defined(USL) || defined(__USLC__)
319 #if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) && NEWSOS < 42
324 "-D_IBMR2", /* IBM RS-6000 (we ensured that aix is defined above */
326 #define aix /* allow BOOTSTRAPCFLAGS="-D_IBMR2" */
330 "-Daix", /* AIX instead of AOS */
332 #define ibm /* allow BOOTSTRAPCFLAGS="-Daix" */
336 "-Dibm", /* IBM PS/2 and RT under both AOS and AIX */
339 "-Dluna", /* OMRON luna 68K and 88K */
343 #ifdef luna88k /* need not on UniOS-Mach Vers. 1.13 */
344 "-traditional", /* for some older version */
345 #endif /* instead of "-DXCOMM=\\#" */
353 #ifdef _CRAY /* Cray */
357 "-DMips", /* Define and use Mips for Mips Co. OS/mach. */
358 # if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
359 "-DBSD43", /* Mips RISCOS supports two environments */
361 "-DSYSV", /* System V environment is the default */
365 "-DMOTOROLA", /* Motorola Delta Systems */
372 #endif /* MOTOROLA */
373 #if defined(M_UNIX) || defined(sco)
387 "-DISC40", /* ISC 4.0 */
390 "-DISC202", /* ISC 2.0.2 */
393 "-DISC30", /* ISC 3.0 */
395 "-DISC22", /* ISC 2.2.1 */
417 #ifdef SYSV386 /* System V/386 folks, obsolete */
425 "-DISC40", /* ISC 4.0 */
428 "-DISC202", /* ISC 2.0.2 */
431 "-DISC30", /* ISC 3.0 */
433 "-DISC22", /* ISC 2.2.1 */
479 #if defined(SVR4) || defined(__svr4__) || defined(__SVR4) || defined(__sol__)
509 # ifdef CROSS_COMPILE
517 # ifdef CROSS_mc68000
532 #if defined(__sgi) && defined(__ANSI_CPP__)
548 * Step 6: DEFAULT_OS_MAJOR_REV, DEFAULT_OS_MINOR_REV, DEFAULT_OS_TEENY_REV,
549 * and DEFAULT_OS_NAME.
550 * If your systems provides a way to generate the default major,
551 * minor, teeny, or system names at runtime add commands below.
552 * The syntax of the _REV strings is 'f fmt' where 'f' is an argument
553 * you would give to uname, and "fmt" is a scanf() format string.
554 * Supported uname arguments are "snrvm", and if you specify multiple
555 * arguments they will be separated by spaces. No more than 5 arguments
556 * may be given. Unlike uname() order of arguments matters.
558 * DEFAULT_OS_MAJOR_REV_FROB, DEFAULT_OS_MINOR_REV_FROB,
559 * DEFAULT_OS_TEENY_REV_FROB, and DEFAULT_OS_NAME_FROB can be used to
560 * modify the results of the use of the various strings.
563 /* uname -v returns "x" (e.g. "4"), and uname -r returns "y" (e.g. "1") */
564 # define DEFAULT_OS_MAJOR_REV "v %[0-9]"
565 # define DEFAULT_OS_MINOR_REV "r %[0-9]"
566 /* No information available to generate default OSTeenyVersion value. */
567 # define DEFAULT_OS_NAME "srvm %[^\n]"
568 #elif defined(sun) || defined(sgi) || defined(ultrix) || defined(__uxp__) || defined(sony)
569 /* uname -r returns "x.y[.z]", e.g. "5.4" or "4.1.3" */
570 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
571 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
572 # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]"
573 # define DEFAULT_OS_NAME "srvm %[^\n]"
575 /* uname -r returns "W.x.yz", e.g. "B.10.01" */
576 # define DEFAULT_OS_MAJOR_REV "r %*[^.].%[0-9]"
577 # define DEFAULT_OS_MINOR_REV "r %*[^.].%*d.%1s"
578 # define DEFAULT_OS_TEENY_REV "r %*[^.].%*d.%*c%[0-9]"
579 # define DEFAULT_OS_NAME "srvm %[^\n]"
580 #elif defined(USL) || defined(__USLC__)
581 /* uname -v returns "x.yz" or "x.y.z", e.g. "2.02" or "2.1.2". */
582 # define DEFAULT_OS_MAJOR_REV "v %[0-9]"
583 # define DEFAULT_OS_MINOR_REV "v %*d.%1s"
584 # define DEFAULT_OS_TEENY_REV "v %*d.%*c%[.0-9]"
585 # define DEFAULT_OS_NAME "srvm %[^\n]"
586 #elif defined(__osf__)
587 /* uname -r returns "Wx.y", e.g. "V3.2" or "T4.0" */
588 # define DEFAULT_OS_MAJOR_REV "r %*[^0-9]%[0-9]"
589 # define DEFAULT_OS_MINOR_REV "r %*[^.].%[0-9]"
590 # define DEFAULT_OS_NAME "srvm %[^\n]"
591 #elif defined(__uxp__)
592 /* NOTE: "x.y[.z]" above handles UXP/DF. This is a sample alternative. */
593 /* uname -v returns "VxLy Yzzzzz ....", e.g. "V20L10 Y95021 Increment 5 ..." */
594 # define DEFAULT_OS_MAJOR_REV "v V%[0-9]"
595 # define DEFAULT_OS_MINOR_REV "v V%*dL%[0-9]"
596 # define DEFAULT_OS_NAME "srvm %[^\n]"
598 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
599 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
600 # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]"
601 # define DEFAULT_OS_NAME "srm %[^\n]"
603 /* ISC all Versions ? */
604 /* uname -r returns "x.y", e.g. "3.2" ,uname -v returns "x" e.g. "2" */
605 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
606 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
607 # define DEFAULT_OS_TEENY_REV "v %[0-9]"
608 /* # define DEFAULT_OS_NAME "srm %[^\n]" */ /* Not useful on ISC */
609 #elif defined(__FreeBSD__) || defined(__OpenBSD__)
611 /* uname -r returns "x.y[.z]-mumble", e.g. "2.1.5-RELEASE" or "2.2-0801SNAP" */
612 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
613 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
614 # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]"
615 # define DEFAULT_OS_NAME "srm %[^\n]"
616 # if defined(__FreeBSD__)
617 /* Use an alternate way to find the teeny version for -STABLE, -SNAP versions */
618 # define DEFAULT_OS_TEENY_REV_FROB(buf, size) \
625 __mib[0] = CTL_KERN; \
626 __mib[1] = KERN_OSRELDATE; \
627 __len = sizeof(__osrel); \
628 sysctl(__mib, 2, &__osrel, &__len, NULL, 0); \
629 if (__osrel < 210000) { \
630 if (__osrel < 199607) \
632 else if (__osrel < 199612) \
634 else if (__osrel == 199612) \
637 buf[0] = '8'; /* guess */ \
639 buf[0] = ((__osrel / 1000) % 10) + '0'; \
645 /* OpenBSD - Add DEFAULT_MACHINE_ARCHITECTURE */
646 # define DEFAULT_MACHINE_ARCHITECTURE "m %[^\n]"
648 #elif defined(__NetBSD__)
650 * uname -r returns "x.y([ABCD...]|_mumble)", e.g.:
651 * 1.2 1.2_BETA 1.2A 1.2B
653 * That means that we have to do something special to turn the
654 * TEENY revision into a form that we can use (i.e., a string of
657 * We also frob the name DEFAULT_OS_NAME so that it looks like the
658 * 'standard' NetBSD name for the version, e.g. "NetBSD/i386 1.2B" for
659 * NetBSD 1.2B on an i386.
661 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
662 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
663 # define DEFAULT_OS_TEENY_REV "r %*d.%*d%[A-Z]"
664 # define DEFAULT_OS_TEENY_REV_FROB(buf, size) \
666 if (*(buf) >= 'A' && *(buf) <= 'Z') /* sanity check */ \
667 snprintf((buf), (size), "%d", *(buf) - 'A' + 1); \
671 # define DEFAULT_OS_NAME "smr %[^\n]"
672 # define DEFAULT_OS_NAME_FROB(buf, size) \
675 if ((__sp = strchr((buf), ' ')) != NULL) \
680 #else /* else MAKEDEPEND */
683 * If your compiler and/or preprocessor define any specific symbols, add
684 * them to the the following table. The definition of struct symtab is
685 * in util/makedepend/def.h.
687 struct symtab predefs[] = {
691 #if defined(clipper) || defined(__clipper__)
693 {"__clipper__", "1"},
731 {"__hp9000s800", "1"},
734 {"__hp9000s700", "1"},
826 {"SYSTYPE_SYSV", "1"},
829 {"_SYSTYPE_SYSV", "1"},
867 {"nec_ews_svr2", "1"},
870 {"nec_ews_svr4", "1"},
873 {"_nec_ews_svr4", "1"},
897 {"__FreeBSD__", "1"},
900 {"__OpenBSD__", "1"},
911 /* add any additional symbols before this line */
915 #endif /* MAKEDEPEND */