Subject: cleanup xsrc/xfree/xc/config/cf/NetBSD.c
To: None <tech-x11@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: tech-x11
Date: 01/23/2005 00:17:25
In article <050118023904.M0103966@mirage.ceres.dti.ne.jp>
I wrote:

> Anyway, I'm still working on NetBSD.cf cleanup for native build,
> which takes long time to test on various (old and slow) hosts. ;-)

Build tests on some slow machines are still ongoing, but now
I'd like to commit modified NetBSD.cf in my local tree. (attached)

The main intention of this change is to split MACHINE_CPU
specific definitions and MACHINE specific definitions.
Current NetBSD.cf has awful #ifdef/#elif/#endif for
*Architecture defines, so it's very hard to maintain and
to add new definitions for a new port.

In this version, MACHINE_CPU (i.e. CPU architecture) dependent
part and MACHINE (i.e. port) dependent part are split.
MACHINE_CPU dependent part contains mostly toolchain specific
defines, and MACHINE (port) specific part contains mostly
Xserver specific defines.

The value of BuildServer is set to NO by default, so
a new port which doesn't have Xserver doesn't have to
add any definitions if its MACHINE_CPU is supported.


There are still some problems we should re-think:

- #include <xfree86.cf>

Current NetBSD includes xfree86.cf only archs which
have XF86Server. But if we don't include xfree86.cf,
XFree86Version is not defined and version.def will be
empty (see xfree/xc/Imakefile).
This might cause problem some packages like pkgsrc/fonts/Xft2
which assume version.def contains XF86_VERSION_* strings on XF86_4.

The attached version always includes xfree86.cf even if
the port doesn't have XF86Server. Many optional libraries
are enabled in xfree86.cf so they are built on non XF86server build,
but it seems there is no side effect (except build time).

Currently BuildXFree86ConfigTools, BuildXInputExt,
BuildXF86DGA, BuildDPMS, and BuildDPMSExt is set to NO
on port which don't have XF86Server, but I could be wrong.


- HasSharedLibraries

I wondered if this should be MACHINE_CPU specific or not,
but for now the attached version assumes all ELF should have
shared lib support and check some speficic defined(*Architecture)
to see if the port doesn't have ELF shared lib support yet.


- gcc -fno-strict-aliasing

Original NetBSD.cf specifies "-O2 GccAliasingArgs" for
DefaultGcc2i386Opt which disable "strict-aliasing" optimization
for i386Architecture, but I guess the problem caused by this
optimization is not CPU dependent. Should we specify this
gcc option by default on all MACHINE_CPUs which use -O2?


- Need test for some Xserver

hpc{arm,mips} and x68k servers are enabled but not tested at all.
Some servers (pmax, vax) doesn't have proper definitions and
they are disabled for now.


- checks for HasNetBSDApertureDriver, HasMTRRBuiltin HasMMXSuport etc.

These should be in MACHINE specific part or not?


- Need tests on the old release, especially a.out system?

I preserve existing definitions which depend on version,
but I'm not sure if it really works.


- We should define "HasXServer" rather than "BuildServer"?

"HasXServer == no" also disables xinit (so we have to move
it from distrib/sets/lists/xbase/mi to md.*), though.
(see xc/programs/Imakefile)


Currently I've tested with this NetBSD.cf on:
- alpha (client and server, but server is not tested,
         but XdecNetBSD is not built?)
- cobalt (client only)
- dreamcast (client and server, working)
- hp300 (client only)
- i386 (client and server, working)
- macppc (client and server, server is not tested)
- shark (client only since XF86_4 lacks support for its VGA chip)
- sparc (client and server, working)
- sparc64 (client and server, server is not tested,
           and ucs2any seems to have problem?)
sun3 and sgimips are on going (at least make Makefiles has no problem).
Xdreamcast and Xsun print some warnings on startup server,
but it could be fixed later.

Any comments or suggestions are appreciated.
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp


---cut here---
XCOMM platform:  $Xorg: NetBSD.cf,v 1.3 2000/08/17 19:41:46 cpqbld Exp $



XCOMM platform:  $XFree86: xc/config/cf/NetBSD.cf,v 3.123 2003/11/20 16:18:18 dawes Exp $


#ifndef OSName
#define OSName			DefaultOSName OSBinaryType
#endif
#ifndef OSMajorVersion
#define OSMajorVersion		DefaultOSMajorVersion
#endif
#ifndef OSMinorVersion
#define OSMinorVersion		DefaultOSMinorVersion
#endif
#ifndef OSTeenyVersion
#define OSTeenyVersion		DefaultOSTeenyVersion
#endif


#ifndef OSVendor
#define	OSVendor		The NetBSD Foundation, Inc.
#endif
XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)

/*
 * Enable support for "xdmauth" authentification.
 */
#ifndef HasXdmAuth
#define HasXdmAuth YES
#endif

/*
 * C library features
 */
#if ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion > 2) || \
     (OSMajorVersion == 1 && OSMinorVersion == 2 && OSTeenyVersion > 1))
# define HasPoll			YES
#endif
#define HasNdbm         	YES
#define HasPutenv       	YES
#if (OSMajorVersion == 1 && OSMinorVersion > 4 || OSMajorVersion > 1)
# define HasStrlcat		YES
#endif
#define HasSnprintf		YES
#define HasBSD44Sockets 	YES
#define Malloc0ReturnsNull	NO
#define SetTtyGroup     	YES
#define DBMLibrary		/**/
#define HasDlopen		YES
#define HasSetProcTitle		YES
#ifndef HasLibCrypt
# define HasLibCrypt		YES
#endif
#ifndef HasShm
/*
 * Shm memory was removed in 0.9B because it was encumbered.
 * A free version was added in 0.9C
 */
# if (OSMajorVersion == 0 && OSMinorVersion == 9 && OSTeenyVersion == 2)
#  define HasShm          	NO
# else
#  define HasShm          	YES
# endif
#endif
#define HasWChar32		YES
/*
 * There's a bug in NetBSD 1.0, 1.1 and 1.2 dlsym()
 */
#if ((OSMajorVersion == 1 && OSMinorVersion < 2) || \
     (OSMajorVersion == 1 && OSMinorVersion == 2 && OSTeenyVersion < 2))
# define HasDlsymBug		YES
#endif
/* Mkstemp is there since 1.2 (at least) */
#if ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion >= 2)) 
# define HasMkstemp		YES
#endif
/* But the standalone mktemp doesn't exist before NetBSD 1.5*/
#if ((OSMajorVersion == 0) || \
     (OSMajorVersion == 1 && OSMinorVersion <= 4))
# define HasMktemp		NO
#else
# define HasMktemp		YES
#endif

#ifndef HasIssetugid
# if ((OSMajorVersion > 1) || \
      (OSMajorVersion == 1 && OSMinorVersion >= 5))
#  define HasIssetugid          YES
# endif
#endif

#if ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion >= 5))
# define HasGetIfAddrs		YES
#endif

#define HasUsableFileMmap	YES

#define HasVarRun		YES
#define HasVarDb		YES

#define HasShadowPasswd		NO

#define InstallXloadSetGID	NO

#if ((OSMajorVersion < 1) || \
     (OSMajorVersion == 1 && OSMinorVersion < 5))
# define BuildIPv6		NO
#endif

#define IPv6SocketsAlsoIPv4	NO

/*
 * NetBSD 1.6M and newer supports POSIX Threads.
 */

#ifndef NetBSDThreads
# define NetBSDThreads		YES
#endif

#if NetBSDThreads && \
    ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion > 6) || \
     (OSMajorVersion == 1 && OSMinorVersion == 6 && OSTeenyVersion >= 13))

# define HasPosixThreads	YES
# define ThreadedX		YES
# define HasThreadSafeAPI	YES
# define ThreadsLibraries	-lpthread
# define SystemMTDefines	-D_REENTRANT
# define MTSafeAPIDefines	-DXUSE_MTSAFE_API -DXNO_MTSAFE_PWDAPI
# if ((OSMajorVersion == 2 && OSMinorVersion == 99 && OSTeenyVersion < 11) || \
      (OSMajorVersion == 2 && OSMinorVersion < 99) || \
      (OSMajorVersion < 2))
#  define LibraryMTDefines	-DUSE_NBSD_THREADLIB
# endif
#else 
# define ThreadedX		NO
#endif

/*
 * Use rnd(4) under NetBSD from 1.4 to 1.6A and arc4random(3) under 1.6B
 * and above.
 */
#if ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion == 6 && OSTeenyVersion >= 2))
# define HasArc4Random		YES
#elif ((OSMajorVersion > 1) || \
       (OSMajorVersion == 1 && OSMinorVersion > 3))
# define HasDevRandom		YES
# define RandomDeviceFile	/dev/urandom
#endif

/*
 * Compiler Features
 */
#define GccUsesGas		YES
#define UseGas			YES
#define GnuCpp			YES

#define NeedConstPrototypes	YES
#define NeedFunctionPrototypes	YES
#define NeedNestedPrototypes	YES
#define NeedVarargsPrototypes	YES
#define NeedWidePrototypes	NO

#define MkdirHierCmd		mkdir -p

#undef CcCmd
#define CcCmd 			gcc
#ifndef DefaultCCOptions
# if defined(UseInstalled)
#  define DefaultCCOptions 	/**/
# else
#  define DefaultCCOptions 	-ansi -Dasm=__asm
# endif
#endif

#define CppCmd			cpp
#define StandardCppOptions	-traditional
#define StandardCppDefines	/**/
#define PreProcessCmd   	CcCmd -E
#define PostIncDir		/usr/include

#define GccGasOption 		-DGCCUSESGAS
#define AsmDefines 		-DUSE_GAS

/* UseElfFormat defaults to YES if __ELF__ set */
#ifndef UseElfFormat
# ifdef __ELF__
#  undef __ELF__			/* other imake files shouldn't care */
#  define UseElfFormat YES
# else
#  define UseElfFormat NO
# endif
#endif

#ifndef OSBinaryType
#if UseElfFormat
#define OSBinaryType	[ELF]
#else
#define OSBinaryType	/**/
#endif
#endif

/*
 * Dynamic loading supported starting in 1.0 on a.out platforms,
 * and on all ELF platforms.
 *
 * XXX May not be correct on NetBSD/pmax (ELF, but might not have
 * working shared libs).
 *
 * Disabled for NetBSD/vax until I figure out the scheme. --CS 
 */
#if UseElfFormat
# if (OSMajorVersion > 0 && defined(i386Architecture)) || \
      defined(PpcArchitecture)
#  ifndef  DoLoadableServer
#   define DoLoadableServer	YES
#  endif
# endif
# if \
     !defined(ns32kArchitecture) && \
     !defined(m68000Architecture) && \
     !(OSMajorVersion < 2 && defined(sh3Architecture)) && \
     !defined(sh5Architecture) && \
     !(GccMajorVersion == 3 && defined(VaxArchitecture)) && \
     1
#  ifndef  HasSharedLibraries
#   define HasSharedLibraries	YES
#  endif
# endif

# define DlLibrary		-rdynamic /* no -ldl yet */
#else /* UseElfFormat */
# define DlLibrary		/**/
# if (OSMajorVersion > 0) && \
     (!defined(AlphaArchitecture) && !defined(MipsArchitecture))
   /* XXX: which port lacked a.out shlib support? */
#  ifndef  HasSharedLibraries
#   define HasSharedLibraries	YES
#  endif
   /* XXX: which port had a.out dynamic loding support? Only i386? */
#  ifndef  DoLoadableServer
#   define DoLoadableServer	YES
#  endif
# endif
#endif /* UseElfFormat */

#ifndef HasSharedLibraries
# define HasSharedLibraries	NO
#endif
#ifndef DoLoadableServer
# define DoLoadableServer	NO
#endif

/* All ELF NetBSD systems support Weak symbols */
#define HasWeakSymbols		UseElfFormat 


/*
 * MACHINE_CPU specific toolchain options
 */
/* arm specific options */
#ifdef armArchitecture
# undef  DefaultCCOptions
# define DefaultCCOptions	-ansi -Dasm=__asm -fsigned-char \
					-fomit-frame-pointer
#endif /* armArchitecture */

/* i386 specific options */
#ifdef i386Architecture
# ifndef DefaultGcc2i386Opt
#  if ((OSMajorVersion > 1) || \
       (OSMajorVersion == 1 && OSMinorVersion > 2))
    /* The GCC strength-reduce bug is fixed for NetBSD 1.3 and later */
#   define DefaultGcc2i386Opt	-O2 GccAliasingArgs
#  endif
# endif
# define OptimizedCDebugFlags 	DefaultGcc2i386Opt
#endif /* i386Architecture */

/* m68k specific options */
#ifdef m68kArchitecture
# if (OSMajorVersion == 1 && OSMinorVersion <= 3)
#  define OptimizedCDebugFlags	-O
# endif
#endif /* m68kArchitecture */

/* mips specific options */
#ifdef MipsArchitecture
# define PositionIndependentCFlags	/* -fPIC */
#endif /* MipsArchitecture */

/* powerpc specific option */
#ifdef PpcArchitecture
# undef  DefaultCCOptions
# define DefaultCCOptions	-ansi -Dasm=__asm -fsigned-char
#endif /* PpcArchitecture */

/* sh3 specific options */
#ifdef sh3Architecture
# define OptimizedCDebugFlags	-O
#endif /* sh3Archtecture */

/* sh5 specific options */
#ifdef sh5Architecture
# define OptimizedCDebugFlags	-O
#endif /* sh5Archtecture */

/* x86_64 */
#if defined(x86_64Architecture)
# define OptimizedCDebugFlags	-O2	/* XXX not needed anymore? */
#endif

/* set default */
#ifndef OptimizedCDebugFlags
# define OptimizedCDebugFlags 	-O2
#endif
/* End of MACHINE_CPU specific options */


#ifndef NetBSDMachineDefines
#define NetBSDMachineDefines /**/
#endif

#define StandardDefines	-DCSRG_BASED NetBSDMachineDefines

/* Citrus mb locale were added in 1.5P */
#if ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion > 5) || \
     (OSMajorVersion == 1 && OSMinorVersion == 5 && OSTeenyVersion >= 15))
#define XawI18nDefines	-DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H
#else
#define XawI18nDefines	-DUSE_XWCHAR_STRING -DUSE_XMBTOWC
#endif

#ifndef ExtraLibraries
#define ExtraLibraries		/**/
#endif
#ifndef UseGnuMalloc
/*
 * There is no way to map 1.4J correctly to OS*Version, so 'J' is mapped
 * to OSTeenyVersion == 9. That should be safe, since there will never
 * be a release for 1.4.9.
 */
# if ((OSMajorVersion > 1) || \
      (OSMajorVersion == 1 && OSMinorVersion > 4) || \
      (OSMajorVersion == 1 && OSMinorVersion == 4 && OSTeenyVersion > 9))
#  define UseGnuMalloc		NO
# else
#  define UseGnuMalloc		YES
#endif
#endif
#ifndef GnuMallocLibrary
#define GnuMallocLibrary	-lgnumalloc
#endif

#if ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion > 2) || \
     (OSMajorVersion == 1 && OSMinorVersion == 2 && OSTeenyVersion > 1))
#ifndef HasZlib
#define HasZlib			  YES
#endif
#endif 

#define	AdmDir			/var/log

#define HasFlex			YES

/* NetBSD doesn't have gperf in the base install */
#define DontRebuildGperfOutput	YES

/* 
 * NetBSD doesn't have perl in default system
 * you may override this in host.def if you installed perl from the packages
 */
#ifndef HasPerl
#define HasPerl			NO
#endif

/*
 * NetBSD doesn't have gperf in default system
 * you may override this in host.def if you installed perl from the packages
 */
#ifndef HasGperf
#define HasGperf		NO
#endif

/*
 * Make & install Features
 */
#define HasBsdMake		YES
#define CompressAllFonts	YES
#define GzipFontCompression	YES
#define DefaultUserPath		/bin:/usr/bin:/usr/pkg/bin:/usr/local/bin:$(BINDIR)
#define DefaultSystemPath	/sbin:/usr/sbin:/bin:/usr/bin:$(BINDIR)

#ifdef  InstallCmd
# undef  InstallCmd
# define InstallCmd 		/usr/bin/install
#endif
#define StripInstalledPrograms	YES

#ifndef ExtraFilesToClean
# define ExtraFilesToClean 	*.core
#endif

/*
 * Documentation formatting
 */
#define NeqnCmd			neqn -Tlatin1
#define NroffCmd		nroff -Tlatin1
#define	EqnCmd 			eqn -Tps
#define HasGroff		YES

/*
 * To use the NetBSD Aperture driver
 */
#if defined(i386Architecture)
# ifndef HasNetBSDApertureDriver
#  define HasNetBSDApertureDriver	YES
# endif

/*
 * Builtin MTRR support (NetBSD 1.5Y and up)
 */
# if ((OSMajorVersion > 1) || \
      (OSMajorVersion == 1 && OSMinorVersion >= 6) || \
      (OSMajorVersion == 1 && OSMinorVersion == 5 && \
       OSTeenyVersion >= 25))
#  define HasMTRRBuiltin        YES
# else
 /*
  * MTRR support  provided by the Aperture driver
  */
#  if HasNetBSDApertureDriver
#   ifndef HasMTRRSupport
#    define HasMTRRSupport	YES
#   endif
#  endif
# endif /* MTRRBuiltin */
#endif /* i386Architecture */

#if defined(AMD64Architecture)
# define HasMTRRBuiltin       YES
#endif

/*
 * agpgart support (NetBSD 1.5Y and up)
 */
#if ((OSMajorVersion > 1) || \
     (OSMajorVersion == 1 && OSMinorVersion >= 6) || \
     (OSMajorVersion == 1 && OSMinorVersion == 5 && OSTeenyVersion >= 25))
# ifndef HasAgpGart
#  define HasAgpGart   YES
# endif
#endif

/*
 * MMX, SSE and 3DNow will be autodetected. NetBSD 1.6 and up have the
 * necessary kernel and toolchain support.
 */
#if defined(i386Architecture) &&  \
	((OSMajorVersion > 1) || \
	 (OSMajorVersion == 1 && OSMinorVersion > 5))
# define HasX86Support          YES
# define HasMMXSupport          YES
# define Has3DNowSupport        YES
# define HasSSESupport          YES
#else
# define HasX86Support          NO
# define HasMMXSupport          NO
# define Has3DNowSupport        NO
# define HasSSESupport          NO
#endif

#ifndef HasCookieMaker
# if (OSMajorVersion == 1 && OSMinorVersion >= 5 || OSMajorVersion >= 2)
   /* NetBSD 1.5 and later have /dev/urandom */
#  define HasCookieMaker	YES
#  define MkCookieCmd \
	'dd if=/dev/urandom bs=16 count=1 2>/dev/null | hexdump -e \\"%08x\\"'
# else
#  define HasCookieMaker	NO
# endif
#endif

/*
 * ForceSubdirs - force make to build subdirectories
 * 
 * For BSD 4.4 make 
 */
#define ForceSubdirs(dirs)						@@\
dirs:	.EXEC								@@\
	@cd $@ ; echo "making all in $(CURRENT_DIR)/$@..."; \		@@\
	$(MAKE) $(MFLAGS) PassCDebugFlags all				@@\
									@@\
.EXEC:

/*
 * Man pages need to be formatted when installed, so override the default
 * imake rules.
 */
#define ManSuffix	1
#define FileManSuffix	5
#define ManSourcePath	$(MANPATH)/cat

#define InstallManPageLongBase(file,destdir,dest)			@@\
									@@\
all:: file.0								@@\
									@@\
file.0:: file.$(MANNEWSUFFIX)						@@\
	@if [ -f file.$(MANNEWSUFFIX) ]; \				@@\
	then \								@@\
	cat file.$(MANNEWSUFFIX) | $(NEQN) | $(TBL) | $(NROFF) $(MANMACROS) | $(COL) >/tmp/$$$$.man; \	@@\
	cp /tmp/$$$$.man file.0; \					@@\
	$(RM) /tmp/$$$$.man; \						@@\
	fi 								@@\
									@@\
install.man::                                                           @@\
	MakeDir($(DESTDIR)destdir)					@@\
	-@if [ -f file.0 ]; \						@@\
	then \								@@\
	$(INSTALL) -c $(INSTMANFLAGS) file.0 $(DESTDIR)destdir/dest.0; \@@\
	fi								@@\
									@@\
clean::									@@\
	RemoveFile(file.0)

#define InstallManPageLong(file,destdir,dest)				@@\
BuildInstallHtmlManPage(file,dest,$(MANSUFFIX))				@@\
									@@\
CppManTarget(file, $(EXTRAMANDEFS))					@@\
									@@\
InstallManPageLongBase(file,destdir,dest)

#define InstallGenManPageLong(file,destdir,dest,suffix)			@@\
BuildInstallHtmlManPage(file,dest,suffix)				@@\
									@@\
CppManTarget(file, $(EXTRAMANDEFS))					@@\
									@@\
InstallManPageLongBase(file,destdir,dest)

#define InstallMultipleMan(list,dest)                                   @@\
install.man:: 								@@\
	MakeDir($(DESTDIR)dest)						@@\
	case '${MFLAGS}' in *[i]*) set +e;; esac; \			@@\
	for i in list; do \                                             @@\
	  (MNAME=`echo $$i | cut -f1 -d.`; \				@@\
	  set -x; \							@@\
	  cat $$i | $(NEQN) | $(TBL) | $(NROFF) $(MANMACROS) \		@@\
		| $(COL) > $${MNAME}.0; \				@@\
	  $(INSTALL) -c $(INSTMANFLAGS) $${MNAME}.0 \			@@\
			$(DESTDIR)dest/$${MNAME}.0; \			@@\
	  $(RM) $${MNAME}.0); \						@@\
	done

#define InstallMultipleManSuffix(list,dest,suff)                        @@\
install.man:: 								@@\
	MakeDir($(DESTDIR)dest)						@@\
	case '${MFLAGS}' in *[i]*) set +e;; esac; \			@@\
	for i in list; do \                                             @@\
	  (set -x; \							@@\
	  cat $$i.suff | $(NEQN) | $(TBL) | $(NROFF) $(MANMACROS) \	@@\
		| $(COL) > $$i.0; \					@@\
	  $(INSTALL) -c $(INSTMANFLAGS) $$i.0	 \			@@\
		$(DESTDIR)dest/$$i.0; \					@@\
	  $(RM) $$i.0 ); \						@@\
	done

#define InstallManPageAliasesBase(file,destdir,aliases)			@@\
install.man:: 								@@\
	@case '${MFLAGS}' in *[i]*) set +e;; esac; \                    @@\
	for i in aliases; do \                                          @@\
		(set -x; \						@@\
		$(RM) $(DESTDIR)destdir/$$i.0;\  			@@\
		(cd $(DESTDIR)/destdir; $(LN) file.0 $$i.0);\ 		@@\
		); \							@@\
	done

#define InstallManPageAliases(file,destdir,aliases)			@@\
InstallHtmlManPageAliases(file,aliases,$(MANSUFFIX))			@@\
									@@\
InstallManPageAliasesBase(file,destdir,aliases)

#define InstallGenManPageAliases(file,destdir,suffix,aliases)		@@\
InstallHtmlManPageAliases(file,aliases,suffix)				@@\
									@@\
InstallManPageAliasesBase(file,destdir,aliases)

/*
 * Unresolved references are fatal on NetBSD 1.5 for libGL, which is
 * built with -Bsymbolic.
 */
#if UseElfFormat && \
    (OSMajorVersion == 1 && OSMinorVersion == 5)
# define SharedGLReqs		$(LDPRELIBS) $(XLIB) -lc
#endif

#if HasSharedLibraries
#include <bsdLib.rules>
#endif /* HasSharedLibraries */

/*
 * Always build the XInput library, regardless of server support
 * on this plattform
 */
#if !defined(BuildXInputLib) && !defined(BuildServersOnly)
# define BuildXInputLib          YES
#endif

/*
 * XFree86 uses its own (more portable) database routines to speed up 
 * the RGB database lookups
 * However, if you want to use ndbm anyway, you can set that to NO in 
 * site.def
 */
#ifndef UseRgbTxt
#define UseRgbTxt	YES
#endif

/*
 * MACHINE specific Xserver dependent definitions
 */

/* acorn32 */
#if defined(acorn32Architecture)
# define BuildServer		YES
# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
# ifndef XFree86ConsoleDefines
# define XFree86ConsoleDefines	-DPCCONS_SUPPORT
# endif
#endif /* acorn32Architecture */

/* alpha */
#if defined(AlphaArchitecture)
# define BuildServer		YES
# define ServerOSDefines 	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines -D_XSERVER64
# ifndef XFree86ConsoleDefines
# define XFree86ConsoleDefines	-DWSCONS_SUPPORT -DPCCONS_SUPPORT -DPCVT_SUPPORT
# endif
# define ServerExtraSysLibs	-lalpha
#endif

/* amd64 */
#if defined(AMD64Architecture)
# define BuildServer		YES
# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
# define ServerExtraDefines	GccGasOption XFree86ServerDefines -D_XSERVER64
# define NetBSDMachineDefines	-D__AMD64__
# ifndef XFree86ConsoleDefines
# define XFree86ConsoleDefines	-DWSCONS_SUPPORT -DPCVT_SUPPORT
# endif
# define ServerExtraSysLibs	-lx86_64
#endif

/* amiga */
#if defined(amigaArchitecture)
# define BuildServer		YES
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines -D__amiga__
# define XserverNeedsSetUID	YES
#endif

/* atari */
#if defined(atariArchitecture)
# define BuildServer		YES
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines GccGasOption XFree86ServerDefines -D__atari__ -D__mc68000__ -Dmc68020
#endif

/* cats */
#if defined(catsArchitecture)
# define BuildServer		YES
# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME 
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
# ifndef XFree86ConsoleDefines
# define XFree86ConsoleDefines	-DPCCONS_SUPPORT -DPCVT_SUPPORT -DWSCONS_SUPPORT
# endif
#endif

/* dreamcast */
#if defined(dreamcastArchitecture)
# define BuildServer		YES
# define XdreamcastServer	YES
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
# define XserverNeedsSetUID	YES
# define XVirtualFramebufferServer	NO

# define XF86Server		NO
# define BuildXFree86ConfigTools	NO
# define BuildXInputExt		NO
# define BuildXF86DGA		NO
# define BuildDPMS		NO
# define BuildDPMSExt		NO
#endif

/* hpcarm, hpcmips */
#if defined(hpcarmArchitecture) || \
    defined(hpcmipsArchitecture)
# define BuildServer		YES
# define XhpcServer		YES
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
# define XserverNeedsSetUID	YES
# define XVirtualFramebufferServer	NO

# define XF86Server		NO
# define BuildXFree86ConfigTools	NO
# define BuildXInputExt		NO
# define BuildXF86DGA		NO
# define BuildDPMS		NO
# define BuildDPMSExt		NO
#endif

/* i386 (as MACHINE) */
#ifdef i386Architecture
# define BuildServer		YES
# if (OSMajorVersion < 1)
#  define ServerOSDefines	XFree86ServerOSDefines -DXNO_SYSCONF
# else
#  define ServerOSDefines	XFree86ServerOSDefines
# endif
# if ((OSMajorVersion > 1) || \
      (OSMajorVersion == 1 && OSMinorVersion >= 1))
#  define ServerExtraSysLibs	-li386
# endif
# define ServerExtraDefines GccGasOption XFree86ServerDefines
# ifndef XFree86ConsoleDefines
#  if ((OSMajorVersion > 1) || \
       (OSMajorVersion == 1 && OSMinorVersion == 3 && OSTeenyVersion >= 6) || \
       (OSMajorVersion == 1 && OSMinorVersion >= 4))
#   define XFree86ConsoleDefines -DPCCONS_SUPPORT -DPCVT_SUPPORT \
	-DWSCONS_SUPPORT
#  else
#   define XFree86ConsoleDefines -DPCCONS_SUPPORT -DPCVT_SUPPORT
#  endif
# endif
#endif /* i386Architecture */
 
/* mac68k */
#if defined(mac68kArchitecture)
# define BuildServer		YES
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines -D__mac68k__
#endif

/* macppc */
#if defined(macppcArchitecture)
# define BuildServer		YES
# define XmacppcServer		YES
# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
# define XkbServerDefines	-DXKB_ALWAYS_USES_SOFT_REPEAT
# ifndef  XFree86ConsoleDefines
#  define XFree86ConsoleDefines	-DWSCONS_SUPPORT
# endif
#endif /* macppcArchitecture */

/* pmax */
#if defined(pmaxArchitecture)
# define BuildServer		NO	/* XXX notyet */
# define ServerOSDefines	-DDDXOSINIT
#endif

/* sgimips */
#if defined(SGIMipsArchitecture)
# define BuildServer		YES
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
# define XFree86ConsoleDefines	-DWSCONS_SUPPORT
# undef  XF86CardDrivers
# define XF86CardDrivers	newport
#endif /* SGIMipsArchitectur */

/* shark */
#if defined(sharkArchitecture)
# define BuildServer		NO	/* no IGS driver in XF86_4 */
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
# ifndef XFree86ConsoleDefines
#  if ((OSMajorVersion < 1) || \
       (OSMajorVersion == 1 && OSMinorVersion < 5))
#   define XFree86ConsoleDefines -DPCCONS_SUPPORT -DPCVT_SUPPORT
#  else
#   define XFree86ConsoleDefines -DPCCONS_SUPPORT -DPCVT_SUPPORT \
	-DWSCONS_SUPPORT 
#  endif
# endif
#endif

/* sparc */
#if defined(SparcArchitecture) && !defined(Sparc64Architecture)
# define BuildServer	YES
# ifndef Xsun24Server
# define Xsun24Server	YES
# endif
# ifndef XsunServer
# define XsunServer	YES
# endif
# ifndef XsunMonoServer
# define XsunMonoServer	YES
# endif
# ifndef BuildScreenSaverLibrary
# define BuildScreenSaverLibrary	YES
# endif
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
# define BuildXF86DGA		NO
# define BuildXInputExt		NO
#endif /* SparcArchitecture */

/* sparc64 */
#if defined(Sparc64Architecture)
# define BuildServer	YES
# ifndef Xsun24Server
# define Xsun24Server	YES
# endif
# ifndef XsunServer
# define XsunServer	YES
# endif
# ifndef XsunMonoServer
# define XsunMonoServer	YES
# endif
# ifndef BuildScreenSaverLibrary
# define BuildScreenSaverLibrary	YES
# endif
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines -D_XSERVER64
# if 0 /* XXX: we should just remove this line?  */
# define XkbServerDefines	-DXKB_ALWAYS_USES_SOFT_REPEAT
# endif
# ifndef XF86Server
#  define XF86Server		YES
# endif
# if XF86Server
#  define XF86OSCardDrivers	/* wsfb sunffb */
#  define AsOutputArchSize	64
#  define AsVISOption		-Av9a
#  define XFree86ConsoleDefines	-DWSCONS_SUPPORT
# endif
# define BuildXF86DGA		YES
# define BuildXInputExt		YES
#endif /* Sparc64Archtecture */

/* sun3 */
#if defined(Sun3Architecture)
# define BuildServer	YES
# ifndef Xsun24Server
# define Xsun24Server	NO
# endif
# ifndef XsunServer
# define XsunServer	YES
# endif
# ifndef XsunMonoServer
# define XsunMonoServer	YES
# endif
# ifndef BuildScreenSaverLibrary
# define BuildScreenSaverLibrary	YES
# endif
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines -D__sun3__
#endif /* Sun3Architecture */

/* vax */
#ifdef VaxArchitecture
# define BuildServer		NO	/* XXX notyet */
# define XVirtualFramebufferServer	NO
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines

# define XF86Server		NO
# define BuildXFree86ConfigTools	NO
# define BuildXInputExt		NO
# define BuildXF86DGA		NO
# define BuildDPMS		NO
# define BuildDPMSExt		NO
#endif /* VaxArchitecture */

/* x68k */
#if defined(x68kArchitecture)
# define BuildServer		YES
# define X68kServer		YES
# define ServerOSDefines	XFree86ServerOSDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines -D__x68k__
# define XserverNeedsSetUID	YES
# define XVirtualFramebufferServer	NO

# define XF86Server		NO
# define BuildXFree86ConfigTools	NO
# define BuildXInputExt		NO
# define BuildXF86DGA		NO
# define BuildDPMS		NO
# define BuildDPMSExt		NO
#endif

/* set default */
#ifndef BuildServer
# define BuildServer		NO
# define BuildXF86DGA		NO
#endif
#ifndef ServerExtraDefines
# define ServerExtraDefines	GccGasOption XFree86ServerDefines
#endif
#ifndef ServerOSDefines
# define ServerOSDefines	XFree86ServerOSDefines
#endif
/* End of MACHINE specific options */

#include <xfree86.cf>

/* 
 * General settings for all platforms 
 */ 
#ifndef SharedLibXdmGreet
#define SharedLibXdmGreet NO
#endif

#ifndef BuildHtmlManPages
#define BuildHtmlManPages NO	/* We don't want HTML manpages */
#endif

#ifndef UseSeparateConfDir
#define UseSeparateConfDir NO	/* We don't want appdefs in "/etc/X11". */
#endif
---cut here---