darwin.cf   [plain text]


XCOMM platform:  $XFree86: xc/config/cf/darwin.cf,v 1.34 2002/12/04 04:40:15 torrey Exp $

/* Darwin / Mac OS X configuration by John Carmack <johnc@idsoftware.com> */

/* imake determines the default values by parsing uname */
#ifndef OSName
#define OSName                  DefaultOSName
#endif
#ifndef OSVendor
#define OSVendor                Apple Computer, Inc.
#endif
#ifndef OSMajorVersion
#define OSMajorVersion          DefaultOSMajorVersion
#endif
#ifndef OSMinorVersion
#define OSMinorVersion          DefaultOSMinorVersion
#endif
#ifndef OSTeenyVersion
#define OSTeenyVersion          DefaultOSTeenyVersion
#endif

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

/*
 * Define the operating system's capabilities
 */
#define HasSnprintf             YES
#define HasPutenv               YES
#define HasBSD44Sockets         YES
#define Malloc0ReturnsNull      NO
#define HasShadowPasswd         NO
#define HasUsableFileMmap       YES
#define HasZlib                 YES
#ifndef HasShm
# define HasShm                 YES
#endif
#define HasNdbm                 YES
#if OSMajorVersion >= 6
# define HasNCurses             YES
#else
# define HasNCurses             NO
#endif
#ifndef HasGroff
# define HasGroff               YES
#endif
#ifndef HasGcc3
# define HasGcc3                NO
#endif

/* Thread support */
#define HasPosixThreads         YES
#define SystemMTDefines         -D_REENTRANT
#if OSMajorVersion >= 6
# define HasThreadSafeAPI       YES
# define MTSafeAPIDefines       -DXUSE_MTSAFE_API -DXNO_MTSAFE_UNISTDAPI
#else
# define HasThreadSafeAPI       NO
# define MTSafeAPIDefines       -DXOS_USE_MTSAFE_NETDBAPI
#endif

/* Libtool on Darwin always uses minor numbers */
#define LibtoolMinorVersions	YES

/* The most common file system, HFS+, is not case sensitive. */
#ifndef CaseSensitiveFileSystem
# define CaseSensitiveFileSystem NO
#endif

/*
 * This enables some settings for developers.
 */
#ifndef XFree86Devel
# define XFree86Devel           NO
#endif

/*
 * This enables Quartz compatibility.
 * Turn off to build on raw Darwin systems.
 */
#ifndef DarwinQuartzSupport
# define DarwinQuartzSupport    YES
#endif

#if DarwinQuartzSupport

# ifndef GlxUseAqua
#  define GlxUseAqua            YES
# endif

/*
 * Before Mac OS X 10.1 a number of features were missing or broken.
 */
# if (OSMajorVersion == 1 && OSMinorVersion >= 4) || OSMajorVersion >= 5
#  ifndef HasNSCarbonWindow
#   define HasNSCarbonWindow    YES
#  endif
#  ifndef HasCGMachPort
#   define HasCGMachPort        YES
#  endif
# else
/* NSWindow(NSCarbonExtensions) is broken. */
#  ifndef HasNSCarbonWindow
#   define HasNSCarbonWindow    NO
#  endif
/* CGWindowServerCFMachPort() does not exist. */
#  ifndef HasCGMachPort
#   define HasCGMachPort        NO
#  endif
# endif

#endif  /* DarwinQuartzSupport */

/* we don't need -lm */
#define MathLibrary             /**/

#define TermcapLibrary          -lcurses
#define SetTtyGroup             YES             /* for xterm */

/* we don't have a dbm library */
#define DBMLibrary              /**/

#define MkdirHierCmd            mkdir -p

/* our cpp isn't in /lib/cpp and early versions don't like -undef */
#define CppCmd                  /usr/bin/cpp
#if HasGcc3
# define RawCppCmd              CppCmd -undef
#else
# define RawCppCmd              CppCmd
#endif

/* we have a gcc compatible compiler, but its not called gcc */
#ifndef CcCmd
#define CcCmd                   /usr/bin/cc
#endif
#ifndef CplusplusCmd
#define CplusplusCmd            /usr/bin/c++
#endif

/* default flags to pass to cc */
#ifndef DefaultCCOptions
#if XFree86Devel
# define DefaultCCOptions       -Wall -Wpointer-arith -Wstrict-prototypes \
                                -Wmissing-prototypes -Wmissing-declarations \
                                -Wredundant-decls -Wnested-externs \
                                -no-cpp-precomp
#else
# define DefaultCCOptions       -Wall -Wpointer-arith -no-cpp-precomp
#endif
#endif

/* flags to pass to cc when building libraries */
#ifndef LibraryCCOptions
# define LibraryCCOptions       DefaultCCOptions -fno-common
#endif

#define OptimizedCDebugFlags	-g -Os
#define ByteOrder		UNKNOWN_BYTE_ORDER

/*
 * __DARWIN__ will be used for platform specific #ifdefs that can't
 * be handled by existing X defines.
 *
 * Darwin's alloca() seg faults (rather than returning NULL) on failed
 * allocations, so we can't use it.
 *
 * Darwin's setlocale() doesn't work properly, so use X11's instead.
 */
#define StandardDefines         -D__DARWIN__ -DNO_ALLOCA -DX_LOCALE -DCSRG_BASED

/*
 * Set this to NO to just build the client libs, which should work without
 * having to write any platform specific code.
 */
#ifndef BuildServer
# define BuildServer            YES

/* our custom X server */
# define XDarwinServer          NO
# define XAppleServer           YES
#endif

/* Thanks to the IOKit, the X server does not have to be SetUID. */
#ifndef InstallXserverSetUID
# define InstallXserverSetUID   NO
#endif

/* no direct graphics extension */
#define BuildXF86DGA            NO

/* no server support for extra tablets and weird input devices */
#define BuildXInputExt          NO
#define BuildXInputLib          YES

/* no Display Power Management extension */
#define BuildDPMSExt            NO

/* no XFree86-Misc extension */
#define BuildXF86MiscExt        NO

/* no XFree86-VidMode extension */
#define BuildXF86VidModeExt	NO

#define BuildLibPathVar         DYLD_LIBRARY_PATH

/* include rules to build shared libraries */
#include <darwinLib.rules>

/*
 * Darwin specific Imake Config files
 */
#ifndef LocalConfigFiles
#define LocalConfigFiles \
	darwinLib.rules \
	darwinLib.tmpl
#endif

/* include all the XFree86 rules */
#include <xfree86.cf>

/* ..and fix some stuff up */
#if XAppleServer

# undef GlxCoreLibDefines
# define GlxCoreLibDefines -DGLX_USE_APPLEGL

# undef GlxExtraDefines
# define GlxExtraDefines -DGLX_DIRECT_RENDERING DRIDefines GlxCoreLibDefines GlxArchDefines

# undef ServerExtraDefines
# define ServerExtraDefines XFree86ServerDefines -UX_BYTE_ORDER -DROOTLESS -DDDXTIME

/* Also, Imakefiles use XPLUGIN_INCLUDE for include flags */
XPLUGIN_LIB = $(XPLUGIN_LIBDIR) -lXplugin

#define InstallFlags -c -o root -g wheel

#endif /* XAppleServer */