Imake.cf revision 11d341ca
1XCOMM $XdotOrg: util/cf/Imake.cf,v 1.12 2005/11/08 06:33:24 jkj Exp $
2XCOMM $Xorg: Imake.cf,v 1.4 2000/08/17 19:41:45 cpqbld Exp $
3/*
4 * To add support for another platform:
5 * 
6 *     1.  Identify a machine-specific cpp symbol.  If your preprocessor 
7 *         does not have any built in, you will need to add the symbol to the
8 *         cpp_argv table in config/imake/imakemdep.h and rebuild imake with
9 *         the BOOTSTRAPCFLAGS variable set (see the macII for an example).
10 *
11 *     2.  Add all machine-specific cpp symbols (either defined by you or by
12 *         the preprocessor or compiler) to the predefs table in 
13 *         config/imake/imakemdep.h.
14 *
15 *     3.  But a new #ifdef block below that defines MacroIncludeFile and
16 *         MacroFile for your new platform and then #undefs the machine-
17 *         specific preprocessor symbols (to avoid problems with file names).
18 *
19 *     4.  Create a .cf file with the name given by MacroFile.
20 */
21XCOMM $XFree86: xc/config/cf/Imake.cf,v 3.88 2003/12/16 21:30:21 herrb Exp $
22
23#if defined(__APPLE__)
24# undef __APPLE__
25# define MacroIncludeFile <darwin.cf>
26# define MacroFile darwin.cf
27# define DarwinArchitecture
28# ifdef __ppc__
29#  define PpcDarwinArchitecture
30#  undef __ppc__
31# endif
32# ifdef __i386__
33#  define i386DarwinArchitecture
34#  undef __i386__
35# endif
36#endif
37
38#if defined(clipper) || defined(__clipper__)
39# undef clipper
40# define MacroIncludeFile <ingr.cf>
41# define MacroFile ingr.cf
42# define IngrArchitecture
43#endif /* clipper */
44
45#ifdef __CYGWIN__
46#define MacroIncludeFile <cygwin.cf>
47#define MacroFile cygwin.cf
48#define cygwinArchitecture
49#define i386Architecture
50#undef i386
51#undef i486
52#undef i586
53#undef i686
54#undef __i386__
55#undef _X86_
56#undef __CYGWIN__
57#endif /* CYGWIN */
58
59#ifdef ultrix
60# define MacroIncludeFile <ultrix.cf>
61# define MacroFile ultrix.cf
62# ifdef vax
63#  undef vax
64#  define VaxArchitecture
65# endif
66# ifdef mips
67#  undef mips
68#  define MipsArchitecture
69#  define MipselArchitecture
70# endif
71# undef ultrix
72# define UltrixArchitecture
73#endif /* ultrix */
74
75#if defined(vax) && !defined(UltrixArchitecture) && !defined(__OpenBSD__)
76# define MacroIncludeFile <bsd.cf>
77# define MacroFile bsd.cf
78# undef vax
79# define BSDArchitecture
80# define VaxArchitecture
81#endif /* vax */
82
83#ifdef __bsdi__
84# define MacroIncludeFile <bsdi.cf>
85# define MacroFile bsdi.cf
86# undef __bsdi__
87# ifdef bsdi
88#  undef bsdi
89# endif
90# define BSDOSArchitecture
91# if defined(__i386__) || defined(i386)
92#  define i386BsdArchitecture
93#  define i386Architecture
94#  undef i386
95#  undef __i386__
96# endif
97# if defined(__ppc__) || defined(ppc)
98#  define PpcBsdArchitecture
99#  define PpcArchitecture
100#  undef ppc
101#  undef __ppc__
102# endif
103# if defined(__sparc__) || defined(__sparc_v9__) || defined(sparc)
104#  define SparcBsdArchitecture
105#  define SparcArchitecture
106#  undef sparc
107#  undef __sparc__
108#  undef __sparc_v9__
109# endif
110#endif /* bsdi */
111
112#ifdef __OpenBSD__
113# undef __OpenBSD__
114# undef __NetBSD__
115# define OpenBSDArchitecture
116# define KOpenBSDArchitecture
117# define MacroIncludeFile <OpenBSD.cf>
118# define MacroFile OpenBSD.cf
119# ifdef __i386__
120#  define i386BsdArchitecture
121#  define i386Architecture
122#  undef i386
123# endif
124# if defined(__sparc__) || defined(sparc)
125#  if !defined(__arch64__)
126#   define SparcArchitecture
127#  else
128#   define Sparc64Architecture
129#  endif
130#  undef sparc
131# endif
132# if defined(__mips__) || defined(mips)
133#   define MipsArchitecture
134#   ifdef arc
135#     define ArcArchitecture
136#     undef arc
137#   endif
138#   ifdef pmax
139#     define PmaxArchitecture
140#     undef pmax
141#   endif
142#   undef mips
143# endif
144# if defined(__alpha__) || defined(alpha)
145#   define AlphaArchitecture
146#   undef __alpha__
147#   undef alpha
148# endif
149# if defined(__amd64__) || defined(__x86_64__)
150#   define AMD64Architecture
151#   undef __amd64__
152#   undef __x86_64__
153#   undef amd64
154# endif
155# if defined(__mc68020__) || defined(mc68020)
156#  define Mc68020Architecture
157#  if defined(amiga)
158#   define AmigaArchitecture
159#   undef amiga
160#  endif
161#  if defined(hp300)
162#   define Hp300Architecture
163#   undef hp300
164#  endif
165#  if defined(mac68k)
166#    define Mac68kArchitecture
167#    undef mac68k
168#  endif
169#  if defined(mvme68k)
170#   define Mvme68kArchitecture
171#   undef mvme68k
172#  endif
173#  if defined(sun3) 
174#   define Sun3Architecture
175#   undef sun3
176#  endif
177#  undef mc68000
178# endif
179# ifdef __powerpc__
180#  define PpcArchitecture
181#  undef __powerpc__
182#  undef __macppc__
183#  undef macppc
184# endif
185# ifdef __vax__
186#  undef vax
187#  undef __vax__
188#  define VaxArchitecture
189# endif
190# ifdef __hppa__
191#  ifndef HPArchitecture
192#   define HPArchitecture
193#  endif
194#  undef __hppa__
195# endif /* __hppa__ */
196#endif /* OpenBSD */
197
198/* Systems based on kernel of OpenBSD */
199#if defined(__OpenBSD_kernel__)
200#define KOpenBSDArchitecture
201#endif
202
203#ifdef __NetBSD__
204# define MacroIncludeFile <NetBSD.cf>
205# define MacroFile NetBSD.cf
206# undef __NetBSD__
207# define NetBSDArchitecture
208# define KNetBSDArchitecture
209# ifdef __i386__
210#  define i386BsdArchitecture
211#  define i386Architecture
212#  undef i386
213# endif
214# if defined(__sparc64__) || defined(__sparc_v9__) || defined(__arch64__)
215#  define Sparc64Architecture
216# endif
217# if defined(__sparc__) || defined(sparc)
218#  define SparcArchitecture
219#  undef sparc
220#  if defined(__sparc_v9__) || defined(__arch64__)
221#    define Sparc64Architecture
222#  endif
223# endif
224# ifdef mips
225#   define MipsArchitecture
226#   define ArcArchitecture
227#   undef mips
228# endif
229# ifdef __alpha__
230#   define AlphaArchitecture
231#   define AlphaBsdArchitecture
232#   undef __alpha__
233# endif
234# ifdef mc68000
235#   define Mc68020Architecture
236# endif
237# ifdef __arm32__
238#   define Arm32Architecture
239#   undef __arm32__
240# endif
241# ifdef __vax__
242#   define VaxArchitecture
243#   undef __vax__
244# endif
245# ifdef __powerpc__
246#   define PpcArchitecture
247#   undef __powerpc__
248# endif
249#endif /* NetBSD */
250
251/* Systems based on kernel of NetBSD */
252#if defined(__NetBSD_kernel__)
253#define KNetBSDArchitecture
254#endif
255
256#ifdef __DragonFly__
257# define MacroIncludeFile <DragonFly.cf>
258# define MacroFile DragonFly.cf
259# undef __DragonFly__
260# undef __FreeBSD__
261# define DragonFlyArchitecture
262# define FreeBSDArchitecture
263# ifdef __i386__
264#  define i386BsdArchitecture
265#  define i386Architecture
266#  undef i386
267# endif
268# ifdef __sparc64__
269#  define Sparc64Architecture
270#  undef __sparc64__
271# endif
272# ifdef __ia64__
273#  define ia64Architecture
274#  undef __ia64__
275# endif
276# ifdef __amd64__
277#  define x86_64Architecture
278#  undef __amd64__
279#  undef __x86_64__
280# endif
281#endif /* __DragonFly__ */
282
283#ifdef __FreeBSD__
284# define MacroIncludeFile <FreeBSD.cf>
285# define MacroFile FreeBSD.cf
286# undef __FreeBSD__
287# define FreeBSDArchitecture
288# define KFreeBSDArchitecture
289# ifdef __i386__
290#  define i386BsdArchitecture
291#  define i386Architecture
292#  undef i386
293# endif
294# ifdef __alpha__
295#  define AlphaBsdArchitecture
296#  define AlphaArchitecture
297#  undef __alpha__
298# endif
299# ifdef __sparc64__
300#  define Sparc64Architecture
301#  undef __sparc64__
302# endif
303# ifdef __ia64__
304#  define ia64Architecture
305#  undef __ia64__
306# endif
307# ifdef __amd64__
308#  define AMD64Architecture
309#  undef __amd64__
310#  undef __x86_64__
311# endif
312# ifdef __powerpc__
313#  define PpcArchitecture
314#  undef __powerpc__
315# endif
316#endif /* __FreeBSD__ */
317
318/* Systems based on kernel of FreeBSD */
319#if defined(__FreeBSD_kernel__)
320#define KFreeBSDArchitecture
321#endif
322
323#ifdef AMOEBA
324 /* Should be before the 'sun' entry because we may be cross-compiling */
325# define MacroIncludeFile <Amoeba.cf>
326# define MacroFile Amoeba.cf
327# if defined(i80386) || defined(__i80386__)
328#  undef i80386
329#  define i386Architecture
330# else
331#  if defined(mc68000) || defined(__mc68000__)
332#   undef mc68000
333#   define Sun3Architecture
334#   define SunArchitecture
335#  else
336#   if defined(sparc) || defined(__sparc__)
337#    undef sparc
338#    define SparcArchitecture
339#    define SunArchitecture
340#   endif
341#  endif
342#  undef sun
343# endif
344#endif /* AMOEBA */
345
346#ifdef sun
347# define MacroIncludeFile <sun.cf>
348# define MacroFile sun.cf
349# ifdef SVR4
350#  undef SVR4
351#  define SVR4Architecture
352# endif
353# ifdef sparc
354#  undef sparc
355#  define SparcArchitecture
356# endif
357# ifdef __sparcv9
358#  undef __sparcv9
359#  define Sparc64Architecture
360# endif
361# ifdef mc68000
362#  undef mc68000
363#  define Sun3Architecture
364# endif
365# if defined(__amd64) || defined(__x86_64)
366#  undef __amd64
367#  undef __x86_64
368#  undef amd64
369#  undef i386
370#  define AMD64Architecture
371# endif
372# ifdef i386
373#  undef i386
374#  define i386Architecture
375# endif
376# undef sun
377# define SunArchitecture
378#endif /* sun */
379
380#ifdef hpux
381# define MacroIncludeFile <hp.cf>
382# define MacroFile hp.cf
383# undef hpux
384# define HPArchitecture
385#endif /* hpux */
386
387#ifdef __SCO__
388# define MacroIncludeFile <sco5.cf>
389# define MacroFile sco5.cf
390# undef __SCO__
391# undef sco
392# undef USL
393# undef SYSV
394# undef i386
395# undef SCO
396# undef SVR4
397# define i386Architecture
398# define SCOArchitecture
399# define i386SVR3Architecture
400# define SVR3Architecture
401# define i386ScoArchitecture
402# define i386Sco325Architecture
403# undef i386
404# undef i486
405# undef i586
406# undef i686
407# undef k6
408# undef __i386__
409# undef __i486__
410# undef __i586__
411# undef __i686__
412# undef __k6__
413# undef __i386
414# undef __i486
415# undef __i586
416# undef __i686
417# undef __k6
418# undef pentium
419# undef __pentium
420# undef pentiumpro
421# undef __pentiumpro
422#endif /* __SCO__ - SCO Open Server 5 */
423
424#ifdef __UNIXWARE__
425# define MacroIncludeFile <usl.cf>
426# define MacroFile usl.cf
427# undef __UNIXWARE__
428# undef USL
429# undef SVR4
430# undef i386
431# undef SVR5
432# undef SYSV5
433# define SVR4Architecture
434# define i386Architecture
435# define USLArchitecture
436# define UnixWareArchitecture
437# undef i386
438# undef i486
439# undef i586
440# undef i686
441# undef k6
442# undef __i386__
443# undef __i486__
444# undef __i586__
445# undef __i686__
446# undef __k6__
447# undef __i386
448# undef __i486
449# undef __i586
450# undef __i686
451# undef __k6
452# undef pentium
453# undef __pentium
454# undef pentiumpro
455# undef __pentiumpro
456#endif /* __UNIXWARE__ */
457
458#ifdef NCR
459# define MacroIncludeFile <ncr.cf>
460# define MacroFile ncr.cf
461# undef NCR
462# undef SVR4
463# undef i386
464# define SVR4Architecture
465# define i386Architecture
466# define NCRArchitecture
467#endif /* NCR */
468
469#ifdef apollo
470# define MacroIncludeFile <apollo.cf>
471# define MacroFile apollo.cf
472# undef apollo
473# define ApolloArchitecture
474#endif /* apollo */
475
476#ifdef sony
477# define MacroIncludeFile <sony.cf>
478# define MacroFile sony.cf
479# undef sony
480# undef sony_news
481# define SonyArchitecture
482# ifdef mc68020
483#  undef mc68020
484#  undef mc68030
485#  define Mc68020Architecture
486# endif
487# ifdef mips
488#  undef mips
489#  define MipsArchitecture
490# endif
491# ifdef __svr4
492#  define SVR4Architecture
493# else
494#  if !defined(bsd43) || defined(SYSTYPE_SYSV) || defined(_SYSTYPE_SYSV)
495#   define SonySysvArchitecture
496#  else
497#   define SonyBsdArchitecture
498#  endif
499# endif
500#endif /* sony */
501
502#ifdef M4310
503# define MacroIncludeFile <pegasus.cf>
504# define MacroFile pegasus.cf
505# undef M4310
506# define PegasusArchitecture
507#endif /* M4310 */
508
509#ifdef M4330
510# define MacroIncludeFile <m4330.cf>
511# define MacroFile m4330.cf
512# undef  M4330
513# define M4330Architecture
514#endif /* M4330 */
515
516#ifdef macII
517# define MacroIncludeFile <macII.cf>
518# define MacroFile macII.cf
519# undef  macII
520# define MacIIArchitecture
521#endif /* macII */
522
523#ifdef _CRAY
524# define MacroIncludeFile <cray.cf>
525# define MacroFile cray.cf
526# undef cray
527# undef CRAY
528# undef CRAY1
529# undef CRAY2
530# undef YMP
531# define CrayArchitecture
532#endif /* _CRAY */
533
534#ifdef sgi
535# define MacroIncludeFile <sgi.cf>
536# define MacroFile sgi.cf
537# undef sgi
538# define SGIArchitecture
539# undef mips
540# undef __mips
541# define MipsArchitecture
542# ifdef _SVR4
543#  undef _SVR4
544#  define SVR4Architecture
545# endif
546# ifdef _SYSTYPE_SVR4
547#  undef _SYSTYPE_SVR4
548#  define SVR4Architecture
549# endif
550#endif /* sgi */
551
552#ifdef stellar
553# define MacroIncludeFile <stellar.cf>
554# define MacroFile stellar.cf
555# undef stellar
556# define StellarArchitecture
557#endif /* stellar */
558
559#if defined(ibm) || defined(_IBMR2) || defined(ibm032) || defined(aix)
560# define MacroIncludeFile <ibm.cf>
561# define MacroFile ibm.cf
562# ifdef ibm
563#  undef ibm
564# endif
565# define IBMArchitecture
566# ifdef i386
567#  undef i386
568#  define PS2Architecture
569# endif
570# ifdef ibm032
571#  undef ibm032
572#  define RtArchitecture
573# endif
574# ifdef aix
575#  undef aix
576#  define AIXArchitecture
577# endif
578# ifdef _IBMR2
579#  undef _IBMR2
580#  if (DefaultOSMajorVersion < 5)
581#   define RsArchitecture
582#  else
583#   define PpcArchitecture
584#  endif
585# endif
586#endif /* ibm */
587
588#ifdef luna
589# undef luna
590# define MacroIncludeFile <luna.cf>
591# define MacroFile luna.cf
592# define LunaArchitecture
593# ifdef mc68000
594#  undef mc68000
595#  define Mc68000Architecture
596# else
597#  undef mc88000
598#  define Mc88000Architecture
599# endif
600#endif /* luna */
601
602#ifdef Mips
603#  define MacroIncludeFile <Mips.cf>
604#  define MacroFile Mips.cf
605#  undef Mips
606#  undef mips
607#  if defined(SYSTYPE_BSD43) || defined(BSD) || defined(BSD43)
608#    define MipsBsdArchitecture
609#  else /* BSD */
610#    define MipsSysvArchitecture
611#  endif /* BSD */
612#endif /* Mips */
613
614#ifdef MOTOROLA
615# define MacroIncludeFile <moto.cf>
616# define MacroFile moto.cf
617# undef MOTOROLA	
618# ifdef SYSV
619#  define MotoR3Architecture
620# endif
621# ifdef SVR4
622#  define MotoR4Architecture
623# endif
624#endif /* MOTOROLA */
625
626#if defined(SVR4) && !defined(DGUX)
627# ifdef i386
628#  define i386Architecture
629#  undef i386
630# endif
631# ifdef PC98
632#  define PANIX98Architecture
633#  undef PC98
634# endif
635# define SVR4Architecture
636# define MacroIncludeFile <svr4.cf>
637# define MacroFile svr4.cf
638# undef SVR4
639#endif /* SVR4 */
640
641#ifdef SYSV
642# ifdef i386
643# undef i386
644#  ifdef ISC
645#   define i386Architecture	
646#   define i386SVR3Architecture	
647#   define MacroIncludeFile <isc.cf>
648#   define MacroFile isc.cf
649#   define i386IscArchitecture
650#   undef ISC
651#   ifdef ISC202
652#    define IscVersion 202
653#    undef ISC202
654#   else
655#    ifdef ISC30
656#     define IscVersion 300
657#     undef ISC30
658#    else
659#     ifdef ISC40
660#      define IscVersion 400
661#      undef ISC40
662#     else
663#      define IscVersion 221
664#     endif /* ISC40 */
665#    endif /* ISC30 */
666#   endif /* ISC202 */
667#  endif /* ISC */
668#  ifndef MacroFile
669#   define i386SVR3Architecture
670#   define MacroIncludeFile <x386.cf>
671#   define MacroFile x386.cf
672#  endif /* MacroFile */
673# endif /* i386 */
674#endif /* SYSV */
675
676/* SYSV386 is here for backward compatibility only */
677#ifdef SYSV386
678# undef i386
679# ifdef SVR4
680#  define i386Architecture
681#  define SVR4Architecture
682#  define i386SVR4Architecture
683#  define MacroIncludeFile <svr4.cf>
684#  define MacroFile svr4.cf
685#  undef SVR4
686# else /* ! SVR4 */
687#  ifdef ISC
688#   define i386Architecture	
689#   define i386SVR3Architecture	
690#   define MacroIncludeFile <isc.cf>
691#   define MacroFile isc.cf
692#   define i386IscArchitecture
693#   undef ISC
694#   ifdef ISC202
695#    define IscVersion 202
696#    undef ISC202
697#   else
698#    ifdef ISC30
699#     define IscVersion 300
700#     undef ISC30
701#    else
702#     ifdef ISC40
703#      define IscVersion 400
704#      undef ISC40
705#     else
706#      define IscVersion 221
707#     endif /* ISC40 */
708#    endif /* ISC30 */
709#   endif /* ISC202 */
710#  endif /* ISC */
711#  ifndef MacroFile
712#   define i386SVR3Architecture
713#   define MacroIncludeFile <x386.cf>
714#   define MacroFile x386.cf
715#  endif /* MacroFile */
716# endif /* ! SVR4 */
717#endif /* SYSV386 */
718
719#ifdef DGUX
720# define i386Architecture
721# define SVR4Architecture
722# define MacroIncludeFile <DGUX.cf>
723# define MacroFile DGUX.cf
724# undef DGUX
725# define DguxArchitecture
726#endif /* DGUX */
727
728#ifdef __convex__
729# define MacroIncludeFile <convex.cf>
730# define MacroFile convex.cf
731# ifdef convex
732#  undef convex
733# endif
734# define ConvexArchitecture
735#endif /* _convex_ */
736
737#ifdef __osf__
738# define MacroIncludeFile <osf1.cf>
739# define MacroFile osf1.cf
740# define OSF1Architecture
741# undef __osf__
742# ifdef __mips__
743#  undef __mips__
744#  define MipsArchitecture
745#  define MipselArchitecture
746# endif
747# ifdef __alpha
748#  undef __alpha
749#  define AlphaArchitecture
750# endif
751#endif /* __osf__ */
752
753#ifdef Oki
754# define MacroIncludeFile <Oki.cf>
755# define MacroFile Oki.cf
756# undef Oki
757# define i860SVR4Architecture
758# define SVR4Architecture
759# undef SVR4
760#endif /* Oki */
761
762#if defined(WIN32) && !defined(__GNUC__)
763# define MacroIncludeFile <Win32.cf>
764# define MacroFile Win32.cf
765# define Win32Architecture
766#endif /* WIN32 */
767
768#if defined(WIN32) && defined(__GNUC__)
769#define MacroIncludeFile <mingw.cf>
770#define MacroFile mingw.cf
771#define Win32Architecture
772#define mingwArchitecture
773#define i386Architecture
774#undef i386
775#undef i486
776#undef i586
777#undef i686
778#undef __i386__
779#undef _X86_
780#undef __MINGW32__
781#endif /* CYGWIN */
782
783#if defined(linux) || defined(__GLIBC__)
784# define MacroIncludeFile <linux.cf>
785# define MacroFile linux.cf
786# undef linux
787# ifdef __linux__
788#  define LinuxArchitecture
789# endif
790# ifdef i386
791#  ifndef i386Architecture
792#   define i386Architecture
793#  endif
794#  undef i386
795XCOMM Keep cpp from replacing path elements containing i486/i586/i686
796#  ifdef i486
797#  ifndef i386Architecture
798#   define i386Architecture
799#  endif
800#   undef i486
801#  endif
802#  ifdef i586
803#  ifndef i386Architecture
804#   define i386Architecture
805#  endif
806#   undef i586
807#  endif
808#  ifdef i686
809#  ifndef i386Architecture
810#   define i386Architecture
811#  endif
812#   undef i686
813#  endif
814#  ifdef k6
815#  ifndef i386Architecture
816#   define i386Architecture
817#  endif
818#   undef k6
819#  endif
820# endif /* k6 */
821# ifdef __i386__
822#  ifndef i386Architecture
823#   define i386Architecture
824#  endif
825#  undef __i386__
826# endif /* __i386__ */
827# ifdef __i486__
828#  ifndef i386Architecture
829#   define i386Architecture
830#  endif
831#  undef __i486__
832# endif /* __i486__ */
833# ifdef __i586__
834#  ifndef i386Architecture
835#   define i386Architecture
836#  endif
837#  undef __i586__
838# endif /* __i586__ */
839# ifdef __i686__
840#  ifndef i386Architecture
841#   define i386Architecture
842#  endif
843#  undef __i686__
844# endif /* __i686__ */
845# ifdef __k6__
846#  ifndef i386Architecture
847#   define i386Architecture
848#  endif
849#  undef __k6__
850# endif /* __k6__ */
851# ifdef __i386
852#  ifndef i386Architecture
853#   define i386Architecture
854#  endif
855#  undef __i386
856# endif /* __i386 */
857# ifdef __i486
858#  ifndef i386Architecture
859#   define i386Architecture
860#  endif
861#  undef __i486
862# endif /* __i486 */
863# ifdef __i586
864#  ifndef i386Architecture
865#   define i386Architecture
866#  endif
867#  undef __i586
868# endif /* __i586 */
869# ifdef __i686
870#  ifndef i386Architecture
871#   define i386Architecture
872#  endif
873#  undef __i686
874# endif /* __i686 */
875# ifdef __k6
876#  ifndef i386Architecture
877#   define i386Architecture
878#  endif
879#  undef __k6
880# endif /* __k6 */
881/* Keep this order! s390x has also __s390__ defined */
882# if defined(__s390x__)
883#  define s390xArchitecture
884#  undef __s390x__
885#  undef __s390__
886# endif
887# ifdef __s390__
888#   define s390Architecture
889#  undef __s390__
890# endif /* s390 */
891# ifdef __alpha
892#  define AlphaArchitecture
893#  undef __alpha
894# endif /* __alpha */
895# ifdef __alpha__
896#  ifndef AlphaArchitecture
897#   define AlphaArchitecture
898#  endif
899#  undef __alpha__
900# endif /* __alpha__ */
901# ifdef __arm__
902#  define Arm32Architecture
903#  undef arm
904#  undef __arm
905#  undef __arm__
906#  if defined(__ARMEB__)
907#   define Arm32ebArchitecture
908#  endif
909#  undef __ARMEB__
910# endif
911# ifdef mc68000
912#  define Mc68020Architecture
913#  undef mc68000
914# endif /* mc68000 */
915# if defined (powerpc) && !defined(__powerpc64__) && !defined (powerpc64)
916#  define PpcArchitecture
917#  undef powerpc
918# endif
919# if defined (__powerpc__) && !defined(__powerpc64__) && !defined (powerpc64)
920#  ifndef PpcArchitecture
921#   define PpcArchitecture
922#  endif
923#  undef __powerpc__
924# endif
925# ifdef __powerpc64__
926#  ifndef Ppc64Architecture
927#   define Ppc64Architecture
928#  endif
929#  undef __powerpc64__
930# endif
931# ifdef sparc
932#  define SparcArchitecture
933#  undef sparc
934# endif
935# ifdef __sparc__
936#  ifndef SparcArchitecture
937#   define SparcArchitecture
938#  endif
939#  undef __sparc__
940# endif
941# ifdef ia64 
942#  define ia64Architecture
943#  undef ia64 
944# endif
945# ifdef __ia64__
946#  ifndef ia64Architecture
947#   define ia64Architecture
948#  endif
949#  undef __ia64__
950# endif
951# if defined(mips) || defined(__mips__)
952#  define MipsArchitecture
953#  undef mips
954#  undef __mips__
955#  if defined(MIPSEL) || defined(_MIPSEL)
956#   define MipselArchitecture
957#  endif
958#  undef MIPSEL
959#  undef _MIPSEL
960# endif
961# ifdef __hppa__
962#  ifndef HPArchitecture
963#   define HPArchitecture
964#  endif
965#  undef __hppa__
966# endif /* __hppa__ */
967# ifdef __sh__
968#  ifndef SuperHArchitecture
969#   define SuperHArchitecture
970#  endif
971#  ifdef __BIG_ENDIAN__
972#   ifndef SuperHebArchitecture
973#    define SuperHebArchitecture
974#   endif
975#  endif
976#  undef __sh__
977# endif /* __sh__ */
978# if defined(__SH3__) || defined(__sh3__)
979#  ifndef SuperH3Architecture
980#   define SuperH3Architecture
981#  endif
982#  undef __SH3__
983#  undef __sh3__
984# endif /* __SH3__ or __sh3__ */
985# ifdef __SH4__
986#  ifdef __SH4_NOFPU__
987#   ifndef SuperH4NOFPUArchitecture
988#    define SuperH4NOFPUArchitecture
989#   endif
990#   undef __SH4_NOFPU__
991#  else
992#   ifndef SuperH4Architecture
993#    define SuperH4Architecture
994#   endif
995#  endif
996#  undef __SH4__
997# endif /* __SH4__ */
998/* for compatibility with 3.3.x */
999# ifdef PpcArchitecture
1000#  define PowerPCArchitecture
1001# endif
1002# if defined(__s390x__)
1003#  define s390xArchitecture
1004#  undef __s390x__
1005# endif
1006# if defined(__amd64__) || defined (__x86_64__)
1007#  undef __amd64__
1008#  undef __x86_64__
1009#  define AMD64Architecture
1010# endif
1011# if defined(amd64__) || defined (x86_64__)
1012#  undef amd64__
1013#  undef x86_64__
1014#  ifndef AMD64Architecture
1015#   define AMD64Architecture
1016#  endif
1017# endif
1018#endif /* linux || __GLIBC__ */
1019
1020#if (defined(__Lynx__) || defined(Lynx)) && (defined(i386) || defined(__i386__) || defined(__x86__) || defined(__powerpc__) || defined(__sparc__) || defined(sparc))
1021# define MacroIncludeFile <lynx.cf>
1022# define MacroFile lynx.cf
1023# define LynxOSArchitecture
1024# undef __Lynx__
1025# undef Lynx
1026# undef lynx
1027# if defined(i386) || defined(__i386__) || defined(__x86__)
1028#  define i386Architecture
1029#  undef i386
1030#  undef __i386__
1031#  undef __x86__
1032# endif
1033# ifdef __powerpc__
1034#  define PpcArchitecture
1035#  undef __powerpc__
1036# endif
1037# if defined(sparc) || defined(__sparc__)
1038#  define SparcArchitecture
1039#  undef sparc
1040#  undef __sparc__
1041# endif
1042/* for compatibility with 3.3.x */
1043# ifdef PpcArchitecture
1044#  define PowerPCArchitecture
1045# endif
1046#endif /* LynxOS AT/PPC/microSPARC */
1047
1048#ifdef __uxp__
1049# define MacroIncludeFile <fujitsu.cf>
1050# define MacroFile fujitsu.cf
1051# define FujitsuArchitecture
1052# undef __uxp__
1053# define UXPArchitecture
1054# define SVR4Architecture
1055# ifdef sparc
1056#  undef sparc
1057#  define SparcArchitecture
1058# endif
1059#endif /* __uxp__ */
1060
1061#ifdef __sxg__
1062# define MacroIncludeFile <fujitsu.cf>
1063# define MacroFile fujitsu.cf
1064# define FujitsuArchitecture
1065# undef __sxg__
1066# define mc68000Architecture
1067#endif /* __sxg__ */
1068
1069#ifdef _SEQUENT_
1070/* undefine assignments resulting from -DSVR4 */
1071# undef MacroIncludeFile
1072# define MacroIncludeFile <sequent.cf>
1073# undef MacroFile
1074# define MacroFile sequent.cf
1075# undef _SEQUENT_
1076# define DynixPtxArchitecture
1077# define SequentArchitecture
1078#endif
1079
1080#if defined(_nec_ews_svr4) || defined(nec_ews_svr4) || defined(nec_ews_svr2) || defined(SX) || defined(_nec_up) || defined(_nec_ft) || defined(PC_UX)
1081# ifdef nec
1082#  undef nec
1083# endif
1084# define MacroIncludeFile <nec.cf>
1085# define MacroFile nec.cf
1086# define NecArchitecture
1087#endif
1088
1089#ifdef minix 
1090#define MacroIncludeFile <minix.cf>
1091#define MacroFile minix.cf
1092#undef minix
1093#define MinixArchitecture
1094#define i386Architecture
1095#endif /* minix */
1096
1097/* Systems with GNU libc and userland */
1098#if defined(__GNU__)
1099#define GNUArchitecture
1100#define MacroIncludeFile <gnu.cf>
1101#define MacroFile gnu.cf
1102#ifdef __i386__
1103#define i386Architecture
1104#endif
1105#endif
1106
1107#ifdef MACH
1108#ifdef __GNU__
1109/* Mach-based GNU system */
1110#define GNUMachArchitecture
1111#else
1112#define MacroIncludeFile <mach.cf>
1113#define MacroFile mach.cf
1114#endif
1115#undef MACH
1116#ifdef	i386
1117#define i386MachArchitecture
1118#define i386Architecture
1119#endif	/* i386 */
1120#undef i386
1121#endif /* MACH */
1122
1123/* On NetBSD, `unix' is not defined, and cpp emits a warning every time
1124 * it sees a test using the `unix' symbol */
1125#if !defined(NetBSDArchitecture) || (defined(NetBSDArchitecture) && DefaultOSMajorVersion == 1 && DefaultOSMinorVersion <= 3)
1126#ifdef unix
1127#undef unix
1128#endif
1129#endif
1130
1131#ifdef emxos2
1132#define MacroIncludeFile <os2.cf>
1133#define MacroFile os2.cf
1134#define OS2Architecture
1135#define i386Architecture
1136#endif /* emxos2 */
1137
1138#if defined(__QNX__) && !defined(__QNXNTO__)
1139#define MacroIncludeFile <QNX4.cf>
1140#define MacroFile QNX4.cf
1141#define QNX4Architecture
1142#define i386Architecture
1143#endif /* QNX4 */
1144
1145#ifdef __QNXNTO__
1146#define MacroIncludeFile <nto.cf>
1147#define MacroFile nto.cf
1148#define NTOArchitecture
1149# ifdef PPC
1150#  define PPCArchitecture
1151#  undef PPC
1152# endif
1153# ifdef MIPS
1154#  define mipsArchitecture
1155#  undef MIPS
1156# endif
1157# ifdef i386
1158#  define i386Architecture
1159#  undef i386
1160# endif /* i386 */
1161# ifdef __i386__
1162#  ifndef i386Architecture
1163#   define i386Architecture
1164#  endif
1165#  undef __i386__
1166# endif /* __i386__ */
1167#endif /* QNX/Neutrino */
1168
1169#ifdef SparcArchitecture
1170# if defined(__sparc_v9) || defined(__arch64__)
1171#  define Sparc64Architecture
1172# endif
1173#endif
1174
1175#ifndef MacroIncludeFile
1176XCOMM WARNING:  Imake.cf not configured; guessing at definitions!!!
1177XCOMM This might mean that BOOTSTRAPCFLAGS was not set when building imake.
1178#define MacroIncludeFile <generic.cf>
1179#define MacroFile generic.cf
1180#endif
1181