1 /* $TOG: imakemdep.h /main/102 1998/02/06 11:02:26 kaleb $ */
4 Copyright (c) 1993, 1994, 1998 The Open Group
8 The above copyright notice and this permission notice shall be included in
9 all copies or substantial portions of the Software.
11 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
15 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 Except as contained in this notice, the name of The Open Group shall not be
19 used in advertising or otherwise to promote the sale, use or other dealings
20 in this Software without prior written authorization from The Open Group.
26 * This file contains machine-dependent constants for the imake utility.
27 * When porting imake, read each of the steps below and add in any necessary
28 * definitions. In general you should *not* edit ccimake.c or imake.c!
33 * Step 1: imake_ccflags
34 * Define any special flags that will be needed to get imake.c to compile.
35 * These will be passed to the compile along with the contents of the
36 * make variable BOOTSTRAPCFLAGS.
40 #define imake_ccflags "-DSYSV"
42 #define imake_ccflags "-Wc,-Nd4000,-Ns3000 -DSYSV"
46 #if defined(macII) || defined(_AUX_SOURCE)
47 #define imake_ccflags "-DmacII -DSYSV"
51 #define imake_ccflags "-DSYSV"
54 #if defined(USL) || defined(__USLC__) || defined(Oki) || defined(NCR)
55 #define imake_ccflags "-Xa -DSVR4"
58 /* SCO may define __USLC__ so put this after the USL check */
59 #if defined(M_UNIX) || defined(_SCO_DS)
63 #define imake_ccflags "-Dsco"
67 #if defined(SYSTYPE_SYSV) || defined(_SYSTYPE_SYSV)
68 #define imake_ccflags "-DSVR4"
70 #include <sys/param.h>
72 #define imake_ccflags "-Dbsd43 -DNOSTDHDRS"
75 #define imake_ccflags "-Dbsd43"
82 #define imake_ccflags "-DSYSV -DUSG"
85 #if defined(_IBMR2) || defined(aix)
86 #define imake_ccflags "-Daix -DSYSV"
90 # if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
91 # define imake_ccflags "-DBSD43"
93 # define imake_ccflags "-DSYSV"
98 #define imake_ccflags "-Dluna -Duniosb"
103 # define imake_ccflags "-Xa -DSVR4"
105 # define imake_ccflags "-DSYSV"
111 # define imake_ccflags "-Xa -DSVR4"
117 # define imake_ccflags "-DSYSV"
122 #define imake_ccflags "-fn -tm c1"
126 #define imake_ccflags "-DX_NOT_POSIX"
131 #define imake_ccflags "-nologo -batch -D__STDC__"
133 #define imake_ccflags "-nologo -D__STDC__"
138 #define imake_ccflags "-DSVR4 -DANSICPP"
142 #define imake_ccflags "-DSYSV -DUSG -DNOSTDHDRS"
146 #define imake_ccflags "-DX_NOT_STDC_ENV -DX_NOT_POSIX"
150 #define imake_ccflags "-DSYSV -DUSG"
153 #if defined(SX) || defined(PC_UX)
154 #define imake_ccflags "-DSYSV"
158 #define imake_ccflags "-DUSG"
161 #if defined(nec_ews_svr4) || defined(_nec_ews_svr4) || defined(_nec_up) || defined(_nec_ft)
162 #define imake_ccflags "-DSVR4"
166 #define imake_ccflags "-DNOSTDHDRS"
169 /* this is for OS/2 under EMX. This won't work with DOS */
171 #define imake_ccflags "-DBSD43"
174 #else /* not CCIMAKE */
178 * If your OS doesn't have a dup2() system call to duplicate one file
179 * descriptor onto another, define such a mechanism here (if you don't
180 * already fall under the existing category(ies).
182 #if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_) && !defined(sco)
183 #define dup2(fd1,fd2) ((fd1 == fd2) ? fd1 : (close(fd2), \
184 fcntl(fd1, F_DUPFD, fd2)))
189 * Step 3: FIXUP_CPP_WHITESPACE
190 * If your cpp collapses tabs macro expansions into a single space and
191 * replaces escaped newlines with a space, define this symbol. This will
192 * cause imake to attempt to patch up the generated Makefile by looking
193 * for lines that have colons in them (this is why the rules file escapes
194 * all colons). One way to tell if you need this is to see whether or not
195 * your Makefiles have no tabs in them and lots of @@ strings.
197 #if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(sco) || (defined(AMOEBA) && defined(CROSS_COMPILE))
198 #define FIXUP_CPP_WHITESPACE
201 #define REMOVE_CPP_LEADSPACE
202 #define INLINE_SYNTAX
203 #define MAGIC_MAKE_VARS
207 * Step 4: USE_CC_E, DEFAULT_CC, DEFAULT_CPP
208 * If you want to use cc -E instead of cpp, define USE_CC_E.
209 * If use cc -E but want a different compiler, define DEFAULT_CC.
210 * If the cpp you need is not in /lib/cpp, define DEFAULT_CPP.
217 #define DEFAULT_CC "cl"
220 #define DEFAULT_CPP "/usr/lib/cpp"
222 #if defined(_IBMR2) && !defined(DEFAULT_CPP)
223 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
225 #if defined(sun) && (defined(SVR4) || defined(__svr4__) || defined(__SVR4) || defined(__sol__))
226 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
229 #define DEFAULT_CPP "/usr/bin/cpp"
232 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
235 #define DEFAULT_CPP "/usr/lib/cpp"
238 #define DEFAULT_CPP "/lib/pcpp"
240 #if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
241 #define DEFAULT_CPP "/usr/libexec/cpp"
243 #if defined(__sgi) && defined(__ANSI_CPP__)
250 #define DEFAULT_CPP "/usr/lib/cpp"
253 /* expects cpp in PATH */
254 #define DEFAULT_CPP "cpp"
259 * The following table contains the flags that should be passed
260 * whenever a Makefile is being generated. If your preprocessor
261 * doesn't predefine any unique symbols, choose one and add it to the
262 * end of this table. Then, do the following:
264 * a. Use this symbol in Imake.tmpl when setting MacroFile.
265 * b. Put this symbol in the definition of BootstrapCFlags in your
266 * <platform>.cf file.
267 * c. When doing a make World, always add "BOOTSTRAPCFLAGS=-Dsymbol"
268 * to the end of the command line.
270 * Note that you may define more than one symbol (useful for platforms
271 * that support multiple operating systems).
274 #define ARGUMENTS 50 /* number of arguments in various arrays */
275 char *cpp_argv[ARGUMENTS] = {
276 "cc", /* replaced by the actual program to exec */
277 "-I.", /* add current directory to include path */
279 "-Uunix", /* remove unix symbol so that filename unix.c okay */
281 #if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(MACH)
290 "-DM4330", /* Tektronix */
293 "-DM4310", /* Tektronix */
295 #if defined(macII) || defined(_AUX_SOURCE)
296 "-DmacII", /* Apple A/UX */
298 #if defined(USL) || defined(__USLC__)
303 #if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) && NEWSOS < 42
308 "-D_IBMR2", /* IBM RS-6000 (we ensured that aix is defined above */
310 #define aix /* allow BOOTSTRAPCFLAGS="-D_IBMR2" */
314 "-Daix", /* AIX instead of AOS */
316 #define ibm /* allow BOOTSTRAPCFLAGS="-Daix" */
320 "-Dibm", /* IBM PS/2 and RT under both AOS and AIX */
323 "-Dluna", /* OMRON luna 68K and 88K */
327 #ifdef luna88k /* need not on UniOS-Mach Vers. 1.13 */
328 "-traditional", /* for some older version */
329 #endif /* instead of "-DXCOMM=\\#" */
337 #ifdef _CRAY /* Cray */
341 "-DMips", /* Define and use Mips for Mips Co. OS/mach. */
342 # if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
343 "-DBSD43", /* Mips RISCOS supports two environments */
345 "-DSYSV", /* System V environment is the default */
349 "-DMOTOROLA", /* Motorola Delta Systems */
356 #endif /* MOTOROLA */
357 #if defined(M_UNIX) || defined(sco)
373 "-DISC40", /* ISC 4.0 */
376 "-DISC202", /* ISC 2.0.2 */
379 "-DISC30", /* ISC 3.0 */
381 "-DISC22", /* ISC 2.2.1 */
403 #ifdef SYSV386 /* System V/386 folks, obsolete */
413 "-DISC40", /* ISC 4.0 */
416 "-DISC202", /* ISC 2.0.2 */
419 "-DISC30", /* ISC 3.0 */
421 "-DISC22", /* ISC 2.2.1 */
462 #if defined(SVR4) || defined(__svr4__) || defined(__SVR4) || defined(__sol__)
492 # ifdef CROSS_COMPILE
500 # ifdef CROSS_mc68000
515 #if defined(__sgi) && defined(__ANSI_CPP__)
531 * Step 6: DEFAULT_OS_MAJOR_REV, DEFAULT_OS_MINOR_REV, DEFAULT_OS_TEENY_REV,
532 * and DEFAULT_OS_NAME.
533 * If your systems provides a way to generate the default major,
534 * minor, teeny, or system names at runtime add commands below.
535 * The syntax of the _REV strings is 'f fmt' where 'f' is an argument
536 * you would give to uname, and "fmt" is a scanf() format string.
537 * Supported uname arguments are "snrvm", and if you specify multiple
538 * arguments they will be separated by spaces. No more than 5 arguments
539 * may be given. Unlike uname() order of arguments matters.
542 /* uname -v returns "x" (e.g. "4"), and uname -r returns "y" (e.g. "1") */
543 # define DEFAULT_OS_MAJOR_REV "v %[0-9]"
544 # define DEFAULT_OS_MINOR_REV "r %[0-9]"
545 /* No information available to generate default OSTeenyVersion value. */
546 # define DEFAULT_OS_NAME "srvm %[^\n]"
547 #elif defined(sun) || defined(sgi) || defined(ultrix) || defined(__uxp__) || defined(linux) || defined(sony)
548 /* uname -r returns "x.y[.z]", e.g. "5.4" or "4.1.3" */
549 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
550 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
551 # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]"
552 # define DEFAULT_OS_NAME "srvm %[^\n]"
554 /* uname -r returns "W.x.yz", e.g. "B.10.01" */
555 # define DEFAULT_OS_MAJOR_REV "r %*[^.].%[0-9]"
556 # define DEFAULT_OS_MINOR_REV "r %*[^.].%*d.%1s"
557 # define DEFAULT_OS_TEENY_REV "r %*[^.].%*d.%*c%[0-9]"
558 # define DEFAULT_OS_NAME "srvm %[^\n]"
559 #elif defined(USL) || defined(__USLC__)
560 /* uname -v returns "x.yz" or "x.y.z", e.g. "2.02" or "2.1.2". */
561 # define DEFAULT_OS_MAJOR_REV "v %[0-9]"
562 # define DEFAULT_OS_MINOR_REV "v %*d.%1s"
563 # define DEFAULT_OS_TEENY_REV "v %*d.%*c%[.0-9]"
564 # define DEFAULT_OS_NAME "srvm %[^\n]"
565 #elif defined(__osf__)
566 /* uname -r returns "Wx.y", e.g. "V3.2" or "T4.0" */
567 # define DEFAULT_OS_MAJOR_REV "r %*[^0-9]%[0-9]"
568 # define DEFAULT_OS_MINOR_REV "r %*[^.].%[0-9]"
569 # define DEFAULT_OS_NAME "srvm %[^\n]"
570 #elif defined(__uxp__)
571 /* NOTE: "x.y[.z]" above handles UXP/DF. This is a sample alternative. */
572 /* uname -v returns "VxLy Yzzzzz ....", e.g. "V20L10 Y95021 Increment 5 ..." */
573 # define DEFAULT_OS_MAJOR_REV "v V%[0-9]"
574 # define DEFAULT_OS_MINOR_REV "v V%*dL%[0-9]"
575 # define DEFAULT_OS_NAME "srvm %[^\n]"
576 #elif defined(__FreeBSD__)
577 /* NetBSD, OpenBSD, 386BSD, and BSD/OS too? */
578 /* uname -r returns "x.y[.z]-mumble", e.g. "2.1.5-RELEASE" or "2.2-0801SNAP" */
579 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
580 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
581 # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]"
582 # define DEFAULT_OS_NAME "srm %[^\n]"
585 #else /* else MAKEDEPEND */
588 * If your compiler and/or preprocessor define any specific symbols, add
589 * them to the the following table. The definition of struct symtab is
590 * in util/makedepend/def.h.
592 struct symtab predefs[] = {
630 {"__hp9000s800", "1"},
633 {"__hp9000s700", "1"},
725 {"SYSTYPE_SYSV", "1"},
728 {"_SYSTYPE_SYSV", "1"},
763 {"nec_ews_svr2", "1"},
766 {"nec_ews_svr4", "1"},
769 {"_nec_ews_svr4", "1"},
793 {"__FreeBSD__", "1"},
796 {"__OpenBSD__", "1"},
804 /* add any additional symbols before this line */
808 #endif /* MAKEDEPEND */