2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $TOG: imakemdep.h /main/102 1998/02/06 11:02:26 kaleb $ */
26 Copyright (c) 1993, 1994, 1998 The Open Group
30 The above copyright notice and this permission notice shall be included in
31 all copies or substantial portions of the Software.
33 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
37 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 Except as contained in this notice, the name of The Open Group shall not be
41 used in advertising or otherwise to promote the sale, use or other dealings
42 in this Software without prior written authorization from The Open Group.
48 * This file contains machine-dependent constants for the imake utility.
49 * When porting imake, read each of the steps below and add in any necessary
50 * definitions. In general you should *not* edit ccimake.c or imake.c!
55 * Step 1: imake_ccflags
56 * Define any special flags that will be needed to get imake.c to compile.
57 * These will be passed to the compile along with the contents of the
58 * make variable BOOTSTRAPCFLAGS.
62 #define imake_ccflags "-DSYSV"
64 #define imake_ccflags "-Wc,-Nd4000,-Ns3000 -DSYSV"
68 #if defined(macII) || defined(_AUX_SOURCE)
69 #define imake_ccflags "-DmacII -DSYSV"
73 #define imake_ccflags "-DSYSV"
76 #if defined(USL) || defined(__USLC__) || defined(Oki) || defined(NCR)
77 #define imake_ccflags "-Xa -DSVR4"
80 /* SCO may define __USLC__ so put this after the USL check */
81 #if defined(M_UNIX) || defined(_SCO_DS)
85 #define imake_ccflags "-Dsco"
89 #if defined(SYSTYPE_SYSV) || defined(_SYSTYPE_SYSV)
90 #define imake_ccflags "-DSVR4"
92 #include <sys/param.h>
94 #define imake_ccflags "-Dbsd43 -DNOSTDHDRS"
97 #define imake_ccflags "-Dbsd43"
104 #define imake_ccflags "-DSYSV -DUSG"
107 #if defined(_IBMR2) || defined(aix)
108 #define imake_ccflags "-Daix -DSYSV"
112 # if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
113 # define imake_ccflags "-DBSD43"
115 # define imake_ccflags "-DSYSV"
120 #define imake_ccflags "-Dluna -Duniosb"
125 # define imake_ccflags "-Xa -DSVR4"
127 # define imake_ccflags "-DSYSV"
133 # define imake_ccflags "-Xa -DSVR4"
139 # define imake_ccflags "-DSYSV"
144 #define imake_ccflags "-fn -tm c1"
148 #define imake_ccflags "-DX_NOT_POSIX"
153 #define imake_ccflags "-nologo -batch -D__STDC__"
155 #define imake_ccflags "-nologo -D__STDC__"
160 #define imake_ccflags "-DSVR4 -DANSICPP"
164 #define imake_ccflags "-DSYSV -DUSG -DNOSTDHDRS"
168 #define imake_ccflags "-DX_NOT_STDC_ENV -DX_NOT_POSIX"
172 #define imake_ccflags "-DSYSV -DUSG"
175 #if defined(SX) || defined(PC_UX)
176 #define imake_ccflags "-DSYSV"
180 #define imake_ccflags "-DUSG"
183 #if defined(nec_ews_svr4) || defined(_nec_ews_svr4) || defined(_nec_up) || defined(_nec_ft)
184 #define imake_ccflags "-DSVR4"
188 #define imake_ccflags "-DNOSTDHDRS"
191 /* this is for OS/2 under EMX. This won't work with DOS */
193 #define imake_ccflags "-DBSD43"
196 #else /* not CCIMAKE */
200 * If your OS doesn't have a dup2() system call to duplicate one file
201 * descriptor onto another, define such a mechanism here (if you don't
202 * already fall under the existing category(ies).
204 #if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_) && !defined(sco)
205 #define dup2(fd1,fd2) ((fd1 == fd2) ? fd1 : (close(fd2), \
206 fcntl(fd1, F_DUPFD, fd2)))
211 * Step 3: FIXUP_CPP_WHITESPACE
212 * If your cpp collapses tabs macro expansions into a single space and
213 * replaces escaped newlines with a space, define this symbol. This will
214 * cause imake to attempt to patch up the generated Makefile by looking
215 * for lines that have colons in them (this is why the rules file escapes
216 * all colons). One way to tell if you need this is to see whether or not
217 * your Makefiles have no tabs in them and lots of @@ strings.
219 #if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(sco) || (defined(AMOEBA) && defined(CROSS_COMPILE))
220 #define FIXUP_CPP_WHITESPACE
223 #define REMOVE_CPP_LEADSPACE
224 #define INLINE_SYNTAX
225 #define MAGIC_MAKE_VARS
229 * Step 4: USE_CC_E, DEFAULT_CC, DEFAULT_CPP
230 * If you want to use cc -E instead of cpp, define USE_CC_E.
231 * If use cc -E but want a different compiler, define DEFAULT_CC.
232 * If the cpp you need is not in /lib/cpp, define DEFAULT_CPP.
239 #define DEFAULT_CC "cl"
242 #define DEFAULT_CPP "/usr/lib/cpp"
244 #if defined(_IBMR2) && !defined(DEFAULT_CPP)
245 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
247 #if defined(sun) && (defined(SVR4) || defined(__svr4__) || defined(__SVR4) || defined(__sol__))
248 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
251 #define DEFAULT_CPP "/usr/bin/cpp"
254 #define DEFAULT_CPP "/usr/ccs/lib/cpp"
257 #define DEFAULT_CPP "/usr/lib/cpp"
260 #define DEFAULT_CPP "/lib/pcpp"
262 #if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
263 #define DEFAULT_CPP "/usr/libexec/cpp"
265 #if defined(__sgi) && defined(__ANSI_CPP__)
272 #define DEFAULT_CPP "/usr/lib/cpp"
275 /* expects cpp in PATH */
276 #define DEFAULT_CPP "cpp"
281 * The following table contains the flags that should be passed
282 * whenever a Makefile is being generated. If your preprocessor
283 * doesn't predefine any unique symbols, choose one and add it to the
284 * end of this table. Then, do the following:
286 * a. Use this symbol in Imake.tmpl when setting MacroFile.
287 * b. Put this symbol in the definition of BootstrapCFlags in your
288 * <platform>.cf file.
289 * c. When doing a make World, always add "BOOTSTRAPCFLAGS=-Dsymbol"
290 * to the end of the command line.
292 * Note that you may define more than one symbol (useful for platforms
293 * that support multiple operating systems).
296 #define ARGUMENTS 50 /* number of arguments in various arrays */
297 char *cpp_argv[ARGUMENTS] = {
298 "cc", /* replaced by the actual program to exec */
299 "-I.", /* add current directory to include path */
301 "-Uunix", /* remove unix symbol so that filename unix.c okay */
303 #if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(MACH) || defined(USL) || defined(sco) || defined(ISC) || defined(__bsdi__) || defined(linux) || defined(__hpux__) || defined(__vxworks)
333 "-DM4330", /* Tektronix */
336 "-DM4310", /* Tektronix */
338 #if defined(macII) || defined(_AUX_SOURCE)
339 "-DmacII", /* Apple A/UX */
341 #if defined(USL) || defined(__USLC__)
346 #if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) && NEWSOS < 42
351 "-D_IBMR2", /* IBM RS-6000 (we ensured that aix is defined above */
353 #define aix /* allow BOOTSTRAPCFLAGS="-D_IBMR2" */
357 "-Daix", /* AIX instead of AOS */
359 #define ibm /* allow BOOTSTRAPCFLAGS="-Daix" */
363 "-Dibm", /* IBM PS/2 and RT under both AOS and AIX */
366 "-Dluna", /* OMRON luna 68K and 88K */
370 #ifdef luna88k /* need not on UniOS-Mach Vers. 1.13 */
371 "-traditional", /* for some older version */
372 #endif /* instead of "-DXCOMM=\\#" */
380 #ifdef _CRAY /* Cray */
384 "-DMips", /* Define and use Mips for Mips Co. OS/mach. */
385 # if defined(SYSTYPE_BSD) || defined(BSD) || defined(BSD43)
386 "-DBSD43", /* Mips RISCOS supports two environments */
388 "-DSYSV", /* System V environment is the default */
392 "-DMOTOROLA", /* Motorola Delta Systems */
399 #endif /* MOTOROLA */
400 #if defined(M_UNIX) || defined(sco)
416 "-DISC40", /* ISC 4.0 */
419 "-DISC202", /* ISC 2.0.2 */
422 "-DISC30", /* ISC 3.0 */
424 "-DISC22", /* ISC 2.2.1 */
446 #ifdef SYSV386 /* System V/386 folks, obsolete */
456 "-DISC40", /* ISC 4.0 */
459 "-DISC202", /* ISC 2.0.2 */
462 "-DISC30", /* ISC 3.0 */
464 "-DISC22", /* ISC 2.2.1 */
505 #if defined(SVR4) || defined(__svr4__) || defined(__SVR4) || defined(__sol__)
535 # ifdef CROSS_COMPILE
543 # ifdef CROSS_mc68000
558 #if defined(__sgi) && defined(__ANSI_CPP__)
574 * Step 6: DEFAULT_OS_MAJOR_REV, DEFAULT_OS_MINOR_REV, DEFAULT_OS_TEENY_REV,
575 * and DEFAULT_OS_NAME.
576 * If your systems provides a way to generate the default major,
577 * minor, teeny, or system names at runtime add commands below.
578 * The syntax of the _REV strings is 'f fmt' where 'f' is an argument
579 * you would give to uname, and "fmt" is a scanf() format string.
580 * Supported uname arguments are "snrvm", and if you specify multiple
581 * arguments they will be separated by spaces. No more than 5 arguments
582 * may be given. Unlike uname() order of arguments matters.
585 /* uname -v returns "x" (e.g. "4"), and uname -r returns "y" (e.g. "1") */
586 # define DEFAULT_OS_MAJOR_REV "v %[0-9]"
587 # define DEFAULT_OS_MINOR_REV "r %[0-9]"
588 /* No information available to generate default OSTeenyVersion value. */
589 # define DEFAULT_OS_NAME "srvm %[^\n]"
590 #elif defined(sun) || defined(sgi) || defined(ultrix) || defined(__uxp__) || defined(linux) || defined(sony)
591 /* uname -r returns "x.y[.z]", e.g. "5.4" or "4.1.3" */
592 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
593 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
594 # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]"
595 # define DEFAULT_OS_NAME "srvm %[^\n]"
597 /* uname -r returns "W.x.yz", e.g. "B.10.01" */
598 # define DEFAULT_OS_MAJOR_REV "r %*[^.].%[0-9]"
599 # define DEFAULT_OS_MINOR_REV "r %*[^.].%*d.%1s"
600 # define DEFAULT_OS_TEENY_REV "r %*[^.].%*d.%*c%[0-9]"
601 # define DEFAULT_OS_NAME "srvm %[^\n]"
602 #elif defined(USL) || defined(__USLC__)
603 /* uname -v returns "x.yz" or "x.y.z", e.g. "2.02" or "2.1.2". */
604 # define DEFAULT_OS_MAJOR_REV "v %[0-9]"
605 # define DEFAULT_OS_MINOR_REV "v %*d.%1s"
606 # define DEFAULT_OS_TEENY_REV "v %*d.%*c%[.0-9]"
607 # define DEFAULT_OS_NAME "srvm %[^\n]"
608 #elif defined(__osf__)
609 /* uname -r returns "Wx.y", e.g. "V3.2" or "T4.0" */
610 # define DEFAULT_OS_MAJOR_REV "r %*[^0-9]%[0-9]"
611 # define DEFAULT_OS_MINOR_REV "r %*[^.].%[0-9]"
612 # define DEFAULT_OS_NAME "srvm %[^\n]"
613 #elif defined(__uxp__)
614 /* NOTE: "x.y[.z]" above handles UXP/DF. This is a sample alternative. */
615 /* uname -v returns "VxLy Yzzzzz ....", e.g. "V20L10 Y95021 Increment 5 ..." */
616 # define DEFAULT_OS_MAJOR_REV "v V%[0-9]"
617 # define DEFAULT_OS_MINOR_REV "v V%*dL%[0-9]"
618 # define DEFAULT_OS_NAME "srvm %[^\n]"
619 #elif defined(__FreeBSD__)
620 /* NetBSD, OpenBSD, 386BSD, and BSD/OS too? */
621 /* uname -r returns "x.y[.z]-mumble", e.g. "2.1.5-RELEASE" or "2.2-0801SNAP" */
622 # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
623 # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
624 # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]"
625 # define DEFAULT_OS_NAME "srm %[^\n]"
628 #else /* else MAKEDEPEND */
631 * If your compiler and/or preprocessor define any specific symbols, add
632 * them to the the following table. The definition of struct symtab is
633 * in util/makedepend/def.h.
635 struct symtab predefs[] = {
673 {"__hp9000s800", "1"},
676 {"__hp9000s700", "1"},
768 {"SYSTYPE_SYSV", "1"},
771 {"_SYSTYPE_SYSV", "1"},
806 {"nec_ews_svr2", "1"},
809 {"nec_ews_svr4", "1"},
812 {"_nec_ews_svr4", "1"},
836 {"__FreeBSD__", "1"},
839 {"__OpenBSD__", "1"},
853 # if defined (amd64) || defined (x86_64)
857 # if defined (__amd64__) || defined (__x86_64__)
903 #if defined(__ppc64__)
907 {"__powerpc__", "1"},
909 # ifdef __powerpc64__
910 {"__powerpc64__", "1"},
912 #if defined(__BIG_ENDIAN__)
913 {"__BIG_ENDIAN__", "1"},
915 #if defined(__LITTLE_ENDIAN__)
916 {"__LITTLE_ENDIAN__", "1"},
918 #if defined(__vxworks)
921 /* add any additional symbols before this line */
925 #endif /* MAKEDEPEND */