XCOMM platform:  $XConsortium: NetBSD.cf /main/16 1996/10/31 14:47:14 kaleb $



XCOMM platform:  $XFree86: xc/config/cf/NetBSD.cf,v 3.49.2.9 1997/07/26 06:30:39 dawes Exp $


  
XCOMM
XCOMM This file currently contains support for:
XCOMM
XCOMM 		NetBSD/i386	client/server
XCOMM 		NetBSD/sparc	client/server
XCOMM 		NetBSD/sun3	client/server
XCOMM 		NetBSD/hp300	client
XCOMM 		NetBSD/mac68k	client/server
XCOMM 		NetBSD/pmax	client
XCOMM		NetBSD/amiga	client/server
XCOMM		NetBSD/alpha	client/server
XCOMM		NetBSD/arm32	client
XCOMM

#ifndef OSName
#define OSName		NetBSD 1.3
#endif
#ifndef OSVendor
#define	OSVendor	The NetBSD Foundation, Inc.
#endif
#ifndef OSMajorVersion
#define OSMajorVersion		1
#endif
#ifndef OSMinorVersion
#define OSMinorVersion		3
#endif
/* XXX this does not deal with patches, but, patches should not affect it */
/* 1 = A, 2 = B, 3 = C, 4 = D, 5 = E, ... */
#ifndef OSTeenyVersion
#define OSTeenyVersion	  0
#endif

XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)

/*
 * 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
#define HasSnprintf		YES
#define HasBSD44Sockets 	YES
#define Malloc0ReturnsNull	NO
#define SetTtyGroup     	YES
#define DBMLibrary		/**/
#ifndef HasLibCrypt
# define HasLibCrypt		YES
#endif
#ifndef HasShm
# if OSMajorVersion == 0 && OSMinorVersion == 9 && OSTeenyVersion == 2
/*
 * Shm memory was removed in 0.9B because it was encumbered.
 * A free version was added in 0.9C
 */
#  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
  
#if OSMajorVersion >= 1
# define LexCmd			lex -l
#endif

#if (!(OSMajorVersion == 0 || \
       (OSMajorVersion == 1 && OSMinorVersion < 2))) 
#define HasMkstemp		YES
#endif
/*
 * Compiler Features
 */
#undef HasGcc
#define HasGcc			YES
#define HasGcc2			YES
#ifndef HasGcc2ForCplusplus
#define HasGcc2ForCplusplus	YES
#endif
#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

#define CppCmd          	/usr/libexec/cpp
#define StandardCppDefines	-traditional
#define PreProcessCmd   	CppCmd
#define PreIncDir		/usr/include

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

#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

/*
 * Make sure the binaries know where to look for the shared libaries.
 * NOTE: This is done in bsdLib.rules for ELF libraries!
 */
#if (OSMajorVersion == 1 && OSMinorVersion >= 2) || OSMajorVersion > 1
# ifndef UseElfFormat
#  define ExtraLoadFlags	-R$(USRLIBDIR)
# 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).
 */
#if ((OSMajorVersion > 0) && \
     !defined(AlphaArchitecture) && !defined(MipsArchitecture)) || \
    UseElfFormat
# ifndef BuildDynamicLoading
#  define BuildDynamicLoading	YES
# endif
# ifndef ForceNormalLib
#  define ForceNormalLib	YES
# endif
#endif

#if UseElfFormat
# define DlLibrary		-rdynamic /* no -ldl yet */
#else
# define DlLibrary		/**/
#endif

#ifdef i386Architecture
# define OptimizedCDebugFlags 	DefaultGcc2i386Opt
# if OSMajorVersion < 1
#  define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME -DXNO_SYSCONF
# else
#  define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
# endif
# if BuildDynamicLoading
#  define ServerExtraSysLibs	-li386 DlLibrary
# else
#  define ServerExtraSysLibs	/**/
# endif
# define ServerExtraDefines GccGasOption XFree86ServerDefines
# ifndef XFree86ConsoleDefines
#  define XFree86ConsoleDefines -DPCCONS_SUPPORT -DPCVT_SUPPORT
# endif
#else
# define OptimizedCDebugFlags 	-O2
#endif

#if defined(SparcArchitecture)
# define ServerOSDefines	-DDDXOSINIT
# define ServerExtraDefines	GccGasOption
# define PexDynamicModule	NO
# define XieDynamicModule	NO
#endif

#if defined(Sun3Architecture)
# define ServerOSDefines	-DDDXOSINIT
# define ServerExtraDefines	GccGasOption -D__sun3__
# define PexDynamicModule	NO
# define XieDynamicModule	NO
#endif

#if defined(hp300Architecture)
# define BuildServer		NO		/* XXX */
# define ServerOSDefines	-DDDXOSINIT
# define ServerExtraDefines	GccGasOption
# define PexDynamicModule	NO
# define XieDynamicModule	NO
#endif

#if defined(mac68kArchitecture)
# define ServerOSDefines	-DDDXOSINIT
# define ServerExtraDefines	GccGasOption -D__mac68k__
# define PexDynamicModule	NO
# define XieDynamicModule	NO
#endif

#if defined(AlphaArchitecture)
# define ServerOSDefines	-DDDXOSINIT
# define ServerExtraDefines	GccGasOption -D_XSERVER64
# define PexDynamicModule	NO
# define XieDynamicModule	NO
# undef OptimizedCDebugFlags			/* XXX ??? */
# define OptimizedCDebugFlags			/* XXX ??? */
#endif

#if defined(amigaArchitecture)
# define ServerOSDefines	-DDDXOSINIT
# define ServerExtraDefines	GccGasOption -D__amiga__
# define PexDynamicModule	NO
# define XieDynamicModule	NO
#endif

#if defined(arm32Architecture)
# define BuildServer		NO		/* XXX */
# define ServerOSDefines	-DDDXOSINIT
# define ServerExtraDefines	GccGasOption
# define PexDynamicModule	NO
# define XieDynamicModule	NO
#endif


#ifndef OptimizedCDebugFlags
# define OptimizedCDebugFlags 	-O2
#endif

#define StandardDefines	-DCSRG_BASED
#define XawI18nDefines	-DUSE_XWCHAR_STRING -DUSE_XMBTOWC

#ifndef ExtraLibraries
#define ExtraLibraries		/**/
#endif
#ifndef UseGnuMalloc
# define UseGnuMalloc		YES
#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

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

#define InstPgmFlags		-s -m 0555 -o bin -g bin
#define InstBinFlags		-m 0555 -o bin -g bin
#define InstUidFlags		-m 4511 -o root -g bin
#define InstLibFlags		-m 0444 -o bin -g bin
#define InstIncFlags		-m 0444 -o bin -g bin
#define InstManFlags		-m 0444 -o bin -g bin
#define InstDatFlags		-m 0444 -o bin -g bin
#define InstKmemFlags		-m 2555 -o bin -g kmem

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

#ifndef ExtraFilesToClean
# define ExtraFilesToClean 	*.core
#endif

/*
 * Documentation formatting
 */
#define NeqnCmd			neqn -Tlatin1
#define NroffCmd		nroff -Tlatin1
#define	EqnCmd 			eqn -Tps
#define TroffCmd        	groff -Tps

/*
 * To use the NetBSD Aperture driver
 */
#if defined(i386Architecture)
#ifndef HasNetBSDApertureDriver
#define HasNetBSDApertureDriver	YES
#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:

XCOMM Man pages need to be formatted when installed, so override the default
XCOMM imake rules.

#define ManSuffix	1
#define FileManSuffix	5
#define ManSourcePath	$(MANPATH)/cat

#define InstallManPageLong(file,destdir,dest)                           @@\
all:: file.0								@@\
									@@\
file.0:: file.man							@@\
	@if [ -f file.man ]; \						@@\
	then \								@@\
	cat file.man | $(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::									@@\
	$(RM) file.o

#define InstallGenManPageLong(file,destdir,dest,suffix)			@@\
	InstallManPageLong(file,destdir,dest)

#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) >/tmp/$$$$.suff; \	@@\
	  $(INSTALL) -c $(INSTMANFLAGS) /tmp/$$$$.suff $(DESTDIR)dest/$$i.0; \	@@\
	  $(RM) /tmp/$$$$.suff); \						@@\
	done

#define InstallMultipleMan(list,dest)                                   @@\
	InstallMultipleManSuffix(list,dest,man)

#define InstallManPageAliases(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 InstallGenManPageAliases(file,destdir,suffix,aliases)		@@\
	InstallManPageAliases(file,destdir,aliases)

/*
 * Definition for compiling on MIPS machines
 */
#ifdef MipsArchitecture
#if 0 /* As distributed */
#define PositionIndependentCFlags
#define SharedLibraryLoadFlags -x -shared --whole-archive -soname `echo $@ | sed 's/\.[0-9]*$$//'`
#define SharedXtReqs	$(XLIBONLY) $(SMLIB) $(ICELIB)
#define SharedXmuReqs	$(LDPRELIB) $(XTOOLONLYLIB) $(XONLYLIB) $(EXTENSIONLIB)
#endif /* As distributed */

#ifdef XdecServer
#undef XdecServer
#endif
#define XdecServer NO

#ifdef BuildServer
#undef BuildServer
#endif
#define BuildServer NO

#ifdef UseElfFormat
#undef UseElfFormat
#endif
#define UseElfFormat YES

#endif

/*
 * Shared libraries 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).
 */
#if ((OSMajorVersion > 0) && \
     !defined(AlphaArchitecture) && !defined(MipsArchitecture)) || \
    UseElfFormat
# ifndef HasSharedLibraries
# define HasSharedLibraries	YES
# endif
#endif

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

#ifndef HasSharedLibraries
#define HasSharedLibraries	NO
#endif 

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

#ifdef i386Architecture
#include <xfree86.cf>
#endif

/*
 * NetBSD always uses the XFree86 contrib distribution.
 */
#undef	XF86Contrib
#define	XF86Contrib	YES

/*
 * Definitions for the SUN server on NetBSD/sparc or NetBSD/sun3
 */
#if defined(SparcArchitecture) || defined(Sun3Architecture)
#ifndef Xsun24Server
#if defined(SparcArchitecture)
#define Xsun24Server	YES
#else
#define Xsun24Server	NO
#endif
#endif
#ifndef XsunServer
#define XsunServer	YES
#endif
#ifndef XsunMonoServer
#define XsunMonoServer	YES
#endif
#endif
  
/*
 * Definitions for the NetBSD/mac68k server.
 */
#ifdef mac68kArchitecture
# ifndef Xmac68kServer
#  define Xmac68kServer		YES
# endif
#endif

/*
 * Definitions for the NetBSD/amiga server.
 */
#ifdef amigaArchitecture
# ifndef XamigaCCmono
#  define XamigaCCmono		NO
# endif
# ifndef XamigaCCcolor
#  define XamigaCCcolor		YES
# endif
# ifndef XamigaGfxCardSupport
#  define XamigaGfxCardSupport	YES
# endif
# ifndef XamigaRetinaZ3Support
#  define XamigaRetinaZ3Support	YES
# endif
# ifndef XamigaCl5426Server
#  define XamigaCl5426Server	YES
# endif
# ifndef XamigaCV64Support
#  define XamigaCV64Support	YES
# endif
/*
 * You need XamigaGfxCardSupport if you enable XamigaCl5426Server,
 * XamigaRetinaZ3Support or XamigaCV64Support and you can't use XamigaCCmono
 * if you enable XamigaCCcolor.
 * Don't change the next 10 lines !!!!!!!!!
 */
# if (XamigaCl5426Server || XamigaCV64Support || XamigaRetinaZ3Support) \
	&& !XamigaGfxCardSupport
#  undef XamigaGfxCardSupport
#  define XamigaGfxCardSupport	YES
# endif
# if XamigaCCcolor
#  undef XamigaCCmono
#  define XamigaCCmono		NO
# endif
#endif

/*
 * Definitions for the NetBSD/alpha X server.
 */
#if defined(AlphaArchitecture)
# define XalphaNetBSDServer	YES
#endif

#ifndef BuildScreenSaverLibrary
#define BuildScreenSaverLibrary	YES
#endif
#ifndef DfltDisableXKB
#define DfltDisableXKB		YES
#endif
#ifndef XkbServerDefines
#define XkbServerDefines	-DXKB_ALWAYS_USES_SOFT_REPEAT
#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	NO
#endif
