/*
 * Define a few common macros.  Caution: cpp will expand a, b, or c
 * before concatenating them ONLY IF they are parameters of a lexically
 * enclosing macro definition.
 */
#define XCOMM #
#define	YES 1
#define NO 0
#define NullParameter /**/

#if __STDC__
#define Concat(a,b)a##b
#else
#define Concat(a,b)a/**/b
#endif

#if __STDC__
#define Concat3(a,b,c)a##b##c
#else
#define Concat3(a,b,c)a/**/b/**/c
#endif

/*
 * Define the OS platform (UltrixArchitecture, etc).
 * Define the CPU architecture (MIPSEL, SUN4, etc.).
 * Define the name of the platform-specific .cf file.
 */
#ifdef ultrix
#undef ultrix
#define UltrixArchitecture
#ifdef vax
#undef VAX
#undef vax
#define VaxArchitecture
#define ArchitectureName VAX
#define architectureName vax
#define SiteDefCpu <site.def.VAX>
#endif
#ifdef mips
#undef mips
#undef MIPSEL
#undef mipsel
#define MipsArchitecture
#define ArchitectureName MIPSEL
#define architectureName mipsel
#define SiteDefCpu <site.def.MIPSEL>
#endif
#define MacroIncludeFile <InterViews/iv-ultrix.cf>
#define MacroFile iv-ultrix.cf
#endif /* ultrix */

#if defined(vax) && !defined(UltrixArchitecture)
#undef VAX
#undef vax
#define VaxArchitecture
#define ArchitectureName VAX
#define architectureName vax
#define SiteDefCpu <site.def.VAX>
#define MacroIncludeFile <InterViews/iv-bsd.cf>
#define MacroFile iv-bsd.cf
#endif /* BSD vax */

#ifdef sun
#undef sun
#define SunArchitecture
#ifdef mc68020
#undef SUN3
#undef sun3
#define ArchitectureName SUN3
#define architectureName sun3
#define SiteDefCpu <site.def.SUN3>
#endif
#ifdef sparc
#undef SUN4
#undef sun4
#define ArchitectureName SUN4
#define architectureName sun4
#define SiteDefCpu <site.def.SUN4>
#endif
#ifdef i386
#undef SUNi386
#undef sunI386
#define ArchitectureName SUNi386
#define architectureName sunI386
#define SiteDefCpu <site.def.SUNi386>
#endif
#ifndef ArchitectureName
#undef SUN
#undef sun
#define ArchitectureName SUN
#define architectureName sun
#define SiteDefCpu <site.def.SUN>
#endif
#define MacroIncludeFile <InterViews/iv-sun.cf>
#define MacroFile iv-sun.cf
#endif /* sun */

#ifdef hpux
#undef hpux
#define HPArchitecture
#ifdef hp9000s300
#undef HP300
#undef hp300
#define ArchitectureName HP300
#define architectureName hp300
#define SiteDefCpu <site.def.HP300>
#else
#ifdef hp9000s200
#undef HP200
#undef hp200
#define ArchitectureName HP200
#define architectureName hp200
#define SiteDefCpu <site.def.HP200>
#endif
#endif
#ifdef hp9000s500
#undef HP500
#undef hp500
#define ArchitectureName HP500
#define architectureName hp500
#define SiteDefCpu <site.def.HP500>
#endif
#ifdef hp9000s800
#undef HP800
#undef hp800
#define ArchitectureName HP800
#define architectureName hp800
#define SiteDefCpu <site.def.HP800>
#endif
#ifndef ArchitectureName
#undef HP
#undef hp
#define ArchitectureName HP
#define architectureName hp
#define SiteDefCpu <site.def.HP>
#endif
#define MacroIncludeFile <InterViews/iv-hp.cf>
#define MacroFile iv-hp.cf
#endif /* hpux */

#ifdef att
#undef ATT
#undef att
#define ATTArchitecture
#define ArchitectureName ATT
#define architectureName att
#define SiteDefCpu <site.def.ATT>
#define MacroIncludeFile <InterViews/iv-att.cf>
#define MacroFile iv-att.cf
#endif /* att */

#ifdef apollo
#undef APOLLO
#undef apollo
#define ApolloArchitecture
#define ArchitectureName APOLLO
#define architectureName apollo
#define SiteDefCpu <site.def.APOLLO>
#define MacroIncludeFile <InterViews/iv-apollo.cf>
#define MacroFile iv-apollo.cf
#endif /* apollo */

#ifdef sony
#undef sony
#undef sony_news
#define SonyArchitecture
#ifdef mc68020
#undef mc68020
#undef mc68030
#undef SONY68
#undef sony68
#define Mc68020Architecture
#define ArchitectureName SONY68
#define architectureName sony68
#define SiteDefCpu <site.def.SONY68>
#endif
#ifdef mips
#undef mips
#undef SONYmips
#undef sonyMIPS
#define MipsArchitecture
#define ArchitectureName SONYmips
#define architectureName sonyMIPS
#define SiteDefCpu <site.def.SONYmips>
#endif
#ifndef ArchitectureName
#undef SONY
#undef sony
#define ArchitectureName SONY
#define architectureName sony
#define SiteDefCpu <site.def.SONY>
#endif
#if !defined(bsd43) || defined(SYSTYPE_SYSV)
#define SonySysvArchitecture
#else
#define SonyBsdArchitecture
#endif
#define MacroIncludeFile <InterViews/iv-sony.cf>
#define MacroFile iv-sony.cf
#endif /* sony */

#ifdef M4310
#undef M4310
#undef PEGASUS
#undef pegasus
#define PegasusArchitecture
#define ArchitectureName PEGASUS
#define architectureName pegasus
#define SiteDefCpu <site.def.PEGASUS>
#define MacroIncludeFile <InterViews/iv-pegasus.cf>
#define MacroFile iv-pegasus.cf
#endif /* M4310 */

#ifdef M4330
#undef M4330
#undef m4330
#define M4330Architecture
#define ArchitectureName M4330
#define architectureName m4330
#define SiteDefCpu <site.def.M4330>
#define MacroIncludeFile <InterViews/iv-m4330.cf>
#define MacroFile iv-m4330.cf
#endif /* M4330 */

#ifdef macII
/* A/UX cpp has no unique symbol:  build imake with BOOTSTRAPCFLAGS=-DmacII */
#undef MACII
#undef macII
#define MacIIArchitecture
#define ArchitectureName MACII
#define architectureName macII
#define SiteDefCpu <site.def.MACII>
#define MacroIncludeFile <InterViews/iv-macII.cf>
#define MacroFile iv-macII.cf
#endif /* macII */

#ifdef CRAY
#undef CRAY
#undef cray
#define CrayArchitecture
#define ArchitectureName CRAY
#define architectureName cray
#define SiteDefCpu <site.def.CRAY>
#define MacroIncludeFile <InterViews/iv-cray.cf>
#define MacroFile iv-cray.cf
#endif /* CRAY */

#ifdef sgi
#undef SGI
#undef sgi
#undef mips
#define SGIArchitecture
#define MipsArchitecture
#define ArchitectureName SGI
#define architectureName sgi
#define SiteDefCpu <site.def.SGI>
#define MacroIncludeFile <InterViews/iv-sgi.cf>
#define MacroFile iv-sgi.cf
#endif /* sgi */

#ifdef stellar
#undef stellar
#undef STELLAR
#define StellarArchitecture
#define ArchitectureName STELLAR
#define architectureName stellar
#define SiteDefCpu <site.def.STELLAR>
#define MacroIncludeFile <InterViews/iv-stellar.cf>
#define MacroFile iv-stellar.cf
#endif /* stellar */

#if defined(ibm) || defined(_IBMR2) || defined(ibm032) || defined(aix)
#undef ibm
#define IBMArchitecture
#ifdef i386
#undef i386
#undef IBMi386
#undef ibmI386
#define PS2Architecture
#define ArchitectureName IBMi386
#define architectureName ibmI386
#define SiteDefCpu <site.def.IBMi386>
#endif
#ifdef ibm032
#undef ibm032
#undef IBMrt
#undef ibmRT
#define RtArchitecture
#define ArchitectureName IBMrt
#define architectureName ibmRT
#define SiteDefCpu <site.def.IBMrt>
#endif
#ifdef aix
#undef aix
#undef IBMaix
#undef ibmAIX
#define AIXArchitecture
#define ArchitectureName IBMaix
#define architectureName ibmAIX
#define SiteDefCpu <site.def.IBMaix>
#endif
#ifdef _IBMR2
#undef _IBMR2
#undef IBMr2
#undef ibmR2
#define RsArchitecture
#define ArchitectureName IBMr2
#define architectureName ibmR2
#define SiteDefCpu <site.def.IBMr2>
#endif
#ifndef ArchitectureName
#undef IBM
#undef ibm
#define ArchitectureName IBM
#define architectureName ibm
#define SiteDefCpu <site.def.IBM>
#endif
#define MacroIncludeFile <InterViews/iv-ibm.cf>
#define MacroFile iv-ibm.cf
#endif /* ibm */

#ifdef linux
#undef linux
#define LinuxArchitecture
#define ArchitectureName LINUX
#define architectureName linux
#define SiteDefCpu <site.def.LINUX>
#define MacroIncludeFile <InterViews/iv-linux.cf>
#define MacroFile iv-linux.cf
#endif

#ifdef luna
#undef luna
#ifdef mc68000
#undef mc68000
#undef LUNA68
#undef luna68
#define Mc68000Architecture
#define ArchitectureName LUNA68
#define architectureName luna68
#define SiteDefCpu <site.def.LUNA68>
#else
#undef mc88000
#undef LUNA88
#undef luna88
#define Mc88000Architecture
#define ArchitectureName LUNA88
#define architectureName luna88
#define SiteDefCpu <site.def.LUNA88>
#endif
#define MacroIncludeFile <InterViews/iv-luna.cf>
#define MacroFile iv-luna.cf
#endif /* luna */

#ifdef Mips
#undef Mips
#if defined(SYSTYPE_BSD43) || defined(BSD) || defined(BSD43)
#define MipsBsdArchitecture
#else
#define MipsSysvArchitecture
#endif
#undef MIPSEB
#undef mipseb
#define ArchitectureName MIPSEB
#define architectureName mipseb
#define SiteDefCpu <site.def.MIPSEB>
#define MacroIncludeFile <InterViews/iv-Mips.cf>
#define MacroFile iv-Mips.cf
#endif /* Mips */

#ifdef MOTOROLA
#undef MOTOROLA	
#undef motorola	
#ifdef SYSV
#define MotoR3Architecture
#endif
#ifdef SVR4
#define MotoR4Architecture
#endif
#define ArchitectureName MOTOROLA
#define architectureName motorola
#define SiteDefCpu <site.def.MOTOROLA>
#define MacroIncludeFile <InterViews/iv-moto.cf>
#define MacroFile iv-moto.cf
#endif /* MOTOROLA */

#ifdef SYSV386
#ifdef SVR4
#define i386SVR4Architecture
#else
#define i386SVR3Architecture
#endif
#undef X386
#undef x386
#define ArchitectureName X386
#define architectureName x386
#define SiteDefCpu <site.def.X386>
#define MacroIncludeFile <InterViews/iv-x386.cf>
#define MacroFile iv-x386.cf
#endif /* SYSV386 */

#ifdef DGUX
#undef DGUX
#undef dgux
#define DguxArchitecture
#define ArchitectureName DGUX
#define architectureName dgux
#define SiteDefCpu <site.def.DGUX>
#define MacroIncludeFile <InterViews/iv-DGUX.cf>
#define MacroFile iv-DGUX.cf
#endif /* DGUX */

#ifdef __convex__
#undef CONVEX
#undef convex
#define ConvexArchitecture
#define ArchitectureName CONVEX
#define architectureName convex
#define SiteDefCpu <site.def.CONVEX>
#define MacroIncludeFile <InterViews/iv-convex.cf>
#define MacroFile iv-convex.cf
#endif /* __convex__ */

#ifdef stratus
#undef stratus
#define StratusArchitecture
#define ArchitectureName stratus
#define architectureName stratus
#define MacroIncludeFile <InterViews/iv-stratus.cf>
#define MacroFile InterViews/iv-stratus.cf
#endif

#if defined(__alpha) && !defined(__linux__)
#undef ALPHA
#undef alpha
#define AlphaArchitecture
#define ArchitectureName ALPHA
#define architectureName alpha
#define SiteDefCpu <site.def.ALPHA>
#define MacroIncludeFile <InterViews/iv-alpha.cf>
#define MacroFile InterViews/iv-alpha.cf
#endif /* __alpha */

#ifndef ArchitectureName
XCOMM WARNING: Imakefile not configured; guessing at definitions!!!
XCOMM This might mean that BOOTSTRAPCFLAGS was not set when building imake.
#undef UNKNOWN
#undef unknown
#define ArchitectureName UNKNOWN
#define architectureName unknown
#define SiteDefCpu <site.def.UNKNOWN>
#define MacroIncludeFile <InterViews/iv-generic.cf>
#define MacroFile iv-generic.cf
#endif /* UNKNOWN */

XCOMM Read IMAKE_TEMPLATE to understand how this Makefile was generated.
XCOMM Edit <arch.def> to add support for a new platform.
XCOMM Edit MacroIncludeFile to change platform-specific parameters.
XCOMM Edit <local.def> to change site-specific parameters.
XCOMM Edit INCLUDE_IMAKEFILE to change actions that make should perform.

XCOMM architecture:  ArchitectureName
