/*
 * 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
#endif
#ifdef mips
#undef mips
#undef MIPSEL
#undef mipsel
#define MipsArchitecture
#define ArchitectureName MIPSEL
#define architectureName mipsel
#endif
#define MacroIncludeFile <InterViews/iv-ultrix.cf>
#define MacroFile InterViews/iv-ultrix.cf
#endif /* ultrix */

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

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

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

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

#ifdef apollo
#undef APOLLO
#undef apollo
#define ApolloArchitecture
#define ArchitectureName APOLLO
#define architectureName apollo
#define MacroIncludeFile <InterViews/iv-apollo.cf>
#define MacroFile InterViews/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
#endif
#ifdef mips
#undef mips
#undef SONYmips
#undef sonyMIPS
#define MipsArchitecture
#define ArchitectureName SONYmips
#define architectureName sonyMIPS
#endif
#ifndef ArchitectureName
#undef SONY
#undef sony
#define ArchitectureName SONY
#define architectureName sony
#endif
#if !defined(bsd43) || defined(SYSTYPE_SYSV)
#define SonySysvArchitecture
#else
#define SonyBsdArchitecture
#endif
#define MacroIncludeFile <InterViews/iv-sony.cf>
#define MacroFile InterViews/iv-sony.cf
#endif /* sony */

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

#ifdef M4330
#undef M4330
#undef m4330
#define M4330Architecture
#define ArchitectureName M4330
#define architectureName m4330
#define MacroIncludeFile <InterViews/iv-m4330.cf>
#define MacroFile InterViews/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 MacroIncludeFile <InterViews/iv-macII.cf>
#define MacroFile InterViews/iv-macII.cf
#endif /* macII */

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

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

#ifdef stellar
#undef stellar
#undef STELLAR
#define StellarArchitecture
#define ArchitectureName STELLAR
#define architectureName stellar
#define MacroIncludeFile <InterViews/iv-stellar.cf>
#define MacroFile InterViews/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
#endif
#ifdef ibm032
#undef ibm032
#undef IBMrt
#undef ibmRT
#define RtArchitecture
#define ArchitectureName IBMrt
#define architectureName ibmRT
#endif
#ifdef aix
#undef aix
#undef IBMaix
#undef ibmAIX
#define AIXArchitecture
#define ArchitectureName IBMaix
#define architectureName ibmAIX
#endif
#ifdef _IBMR2
#undef _IBMR2
#undef IBMr2
#undef ibmR2
#define RsArchitecture
#define ArchitectureName IBMr2
#define architectureName ibmR2
#endif
#ifndef ArchitectureName
#undef IBM
#undef ibm
#define ArchitectureName IBM
#define architectureName ibm
#endif
#define MacroIncludeFile <InterViews/iv-ibm.cf>
#define MacroFile InterViews/iv-ibm.cf
#endif /* ibm */

#ifdef luna
#undef luna
#ifdef mc68000
#undef mc68000
#undef LUNA68
#undef luna68
#define Mc68000Architecture
#define ArchitectureName LUNA68
#define architectureName luna68
#else
#undef mc88000
#undef LUNA88
#undef luna88
#define Mc88000Architecture
#define ArchitectureName LUNA88
#define architectureName luna88
#endif
#define MacroIncludeFile <InterViews/iv-luna.cf>
#define MacroFile InterViews/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 MacroIncludeFile <InterViews/iv-Mips.cf>
#define MacroFile InterViews/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 MacroIncludeFile <InterViews/iv-moto.cf>
#define MacroFile InterViews/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 MacroIncludeFile <InterViews/iv-x386.cf>
#define MacroFile InterViews/iv-x386.cf
#endif /* SYSV386 */

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

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

#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 MacroIncludeFile <InterViews/iv-generic.cf>
#define MacroFile InterViews/iv-generic.cf
#endif /* UNKNOWN */

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

XCOMM architecture:  ArchitectureName
