darwin.cf revision 1c80d5b0
1XCOMM $XdotOrg: xc/config/cf/darwin.cf,v 1.7 2005/03/17 01:12:07 torrey Exp $ 2XCOMM platform: $XFree86: xc/config/cf/darwin.cf,v 1.50 2004/01/20 23:54:50 torrey Exp $ 3 4/* Darwin / Mac OS X configuration by John Carmack <johnc@idsoftware.com> */ 5 6/* imake determines the default values by parsing uname */ 7#ifndef OSName 8#define OSName DefaultOSName 9#endif 10#ifndef OSVendor 11#define OSVendor Apple Computer, Inc. 12#endif 13#ifndef OSMajorVersion 14#define OSMajorVersion DefaultOSMajorVersion 15#endif 16#ifndef OSMinorVersion 17#define OSMinorVersion DefaultOSMinorVersion 18#endif 19#ifndef OSTeenyVersion 20#define OSTeenyVersion DefaultOSTeenyVersion 21#endif 22 23XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion) 24 25/* 26 * Define the operating system's capabilities 27 */ 28#define HasSnprintf YES 29#define HasPutenv YES 30#define HasBSD44Sockets YES 31#define Malloc0ReturnsNull NO 32#define HasShadowPasswd NO 33#define HasUsableFileMmap YES 34#define HasZlib YES 35#ifndef HasShm 36# define HasShm YES 37#endif 38#define HasNdbm YES 39#if OSMajorVersion >= 6 40# define HasNCurses YES 41# define HasArc4Random YES 42# define HasGetIfAddrs YES 43# define HasStrlcat YES 44#else 45# define HasBasename NO 46# define HasNCurses NO 47#endif 48#ifndef HasGroff 49# define HasGroff YES 50#endif 51#ifndef HasGcc3 52# define HasGcc3 NO 53#endif 54#ifndef HasFreetype2 55# define HasFreetype2 NO 56#endif 57#ifndef HasExpat 58# define HasExpat NO 59#endif 60#ifndef HasLibpng 61# define HasLibpng NO 62#endif 63 64/* Older versions don't really support IPv6, but #define AF_INET6. */ 65#if OSMajorVersion < 6 66# define BuildIPv6 NO 67#endif 68 69/* Thread support */ 70#define HasPosixThreads YES 71#define SystemMTDefines -D_REENTRANT 72#if OSMajorVersion >= 6 73# define HasThreadSafeAPI YES 74# define MTSafeAPIDefines -DXUSE_MTSAFE_API -DXNO_MTSAFE_UNISTDAPI 75#else 76# define HasThreadSafeAPI NO 77# define MTSafeAPIDefines -DXOS_USE_MTSAFE_NETDBAPI 78#endif 79 80/* Libtool on Darwin always uses minor numbers */ 81#define LibtoolMinorVersions YES 82 83/* The most common file system, HFS+, is not case sensitive. */ 84#ifndef CaseSensitiveFileSystem 85# define CaseSensitiveFileSystem NO 86#endif 87 88/* 89 * This enables some settings for developers. 90 */ 91#ifndef XFree86Devel 92# define XFree86Devel NO 93#endif 94 95/* 96 * This enables Quartz compatibility. 97 * Turn off to build on raw Darwin systems. 98 */ 99#ifndef DarwinQuartzSupport 100# define DarwinQuartzSupport YES 101#endif 102 103#if DarwinQuartzSupport 104 105# if OSMajorVersion >= 7 106 PROJ_BUILD = xcodebuild 107# else 108 PROJ_BUILD = pbxbuild 109# endif 110 111# ifndef HasXplugin 112# if OSMajorVersion >= 7 113# define HasXplugin YES 114# else 115# define HasXplugin NO 116# endif 117# endif 118 119# if HasXplugin 120# ifndef XpLibDir 121# define XpLibDir /usr/lib 122# endif 123# ifndef XpIncDir 124# define XpIncDir $(SERVERSRC)/hw/darwin/quartz/xpr 125# endif 126 XPLIBDIR = XpLibDir 127 XPINCDIR = XpIncDir 128# define XpluginLibrary Concat(-L,$(XPLIBDIR)) -lXplugin 129# else 130# define XpluginLibrary /**/ 131# endif 132 133# ifndef BuildAppleDRI 134# if HasXplugin 135# define BuildAppleDRI YES 136# else 137# define BuildAppleDRI NO 138# endif 139# endif 140 141# if BuildAppleDRI 142# define GlxExtraDefines -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL GlxArchDefines 143# endif 144 145# define BuildRootless YES 146# define BuildAppleWMLibrary YES 147 148#endif /* DarwinQuartzSupport */ 149 150/* we don't need -lm */ 151#define MathLibrary /**/ 152 153#define TermcapLibrary -lcurses 154#define SetTtyGroup YES /* for xterm */ 155 156/* we don't have a dbm library */ 157#define DBMLibrary /**/ 158 159#define MkdirHierCmd mkdir -p 160 161/* Use flex -l for compatibility with various versions of flex. */ 162#ifndef LexCmd 163# define LexCmd flex -l 164#endif 165#define HasFlex YES 166 167/* 168 * Our cpp isn't in /lib/cpp and early versions don't like -undef. 169 * The gcc 3.3 cpp that Apple ships inserts spurious #pragmas, 170 * so we use the 3.1-based version in this case. 171 */ 172#if (GccMajorVersion == 3) && (GccMinorVersion == 3) 173# define CppCmd /usr/bin/cpp3 174#else 175# define CppCmd /usr/bin/cpp 176#endif 177#if (GccMajorVersion == 3) && (GccMinorVersion == 3) || (GccMajorVersion > 3) 178# define StandardCppOptions -traditional -D__GNUC__ 179#endif 180#if HasGcc3 181# define RawCppCmd CppCmd -undef 182#else 183# define RawCppCmd CppCmd 184#endif 185 186/* we have a gcc compatible compiler, but its not called gcc */ 187#define CcCmd /usr/bin/cc 188#define CplusplusCmd /usr/bin/c++ 189 190/* default flags to pass to cc */ 191#ifndef DefaultCCOptions 192#if XFree86Devel 193# define DefaultCCOptions -Wall -Wpointer-arith -Wstrict-prototypes \ 194 -Wmissing-prototypes -Wmissing-declarations \ 195 -Wredundant-decls -Wnested-externs \ 196 -no-cpp-precomp 197#else 198# define DefaultCCOptions -Wall -Wpointer-arith -no-cpp-precomp 199#endif 200#endif 201 202/* flags to pass to cc when building libraries */ 203#ifndef LibraryCCOptions 204# define LibraryCCOptions DefaultCCOptions -fno-common 205#endif 206 207/* The cr implementation does not build with NEED_SCREEN_REGIONS, 208 so play it safe. */ 209#ifndef ServerCCOptions 210# define ServerCCOptions DefaultCCOptions -UNEED_SCREEN_REGIONS 211#endif 212 213#ifdef PpcDarwinArchitecture 214# define DarwinMachineDefines -D__powerpc__ 215# if HasGcc3 216# define OptimizedCDebugFlags -Os 217# else 218# define OptimizedCDebugFlags -O2 219# endif 220# define ByteOrder X_BIG_ENDIAN 221#endif /* PpcDarwinArchitecture */ 222 223#ifdef i386DarwinArchitecture 224# define DarwinMachineDefines -D__i386__ 225# if HasGcc3 226# define OptimizedCDebugFlags -Os 227# else 228# define OptimizedCDebugFlags -O2 -fno-strength-reduce 229# endif 230# define ByteOrder X_LITTLE_ENDIAN 231#endif /* i386DarwinArchitecture */ 232 233 234#ifdef x86_64DarwinArchitecture 235# define DarwinMachineDefines -D__x86_64__ 236# if HasGcc3 237# define OptimizedCDebugFlags -Os 238# else 239# define OptimizedCDebugFlags -O2 -fno-strength-reduce 240# endif 241# define ByteOrder X_LITTLE_ENDIAN 242#endif /* x86_64DarwinArchitecture */ 243 244#if OSMajorVersion < 7 245# define DarwinLocaleDefines -DX_LOCALE 246#else 247# define DarwinLocaleDefines /**/ 248# define XawI18nDefines -DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H 249#endif 250 251/* 252 * __DARWIN__ will be used for platform specific #ifdefs that can't 253 * be handled by existing X defines. 254 * 255 * Darwin's alloca() seg faults (rather than returning NULL) on failed 256 * allocations, so we can't use it. 257 */ 258#define StandardDefines DarwinMachineDefines -D__DARWIN__ \ 259 -DNO_ALLOCA -DCSRG_BASED DarwinLocaleDefines 260 261/* 262 * Set this to NO to just build the client libs, which should work without 263 * having to write any platform specific code. 264 */ 265#ifndef BuildServer 266# define BuildServer YES 267 268/* our custom X server */ 269# define XDarwinServer YES 270#endif 271 272/* Thanks to the IOKit, the X server does not have to be SetUID. */ 273#ifndef InstallXserverSetUID 274# define InstallXserverSetUID NO 275#endif 276 277/* Allow Xtrans to work with non-SetUID server. */ 278#ifndef XtransFailSoft 279# define XtransFailSoft YES 280#endif 281 282/* disable XKB by default as it can cause problems */ 283#define DfltDisableXKB YES 284 285/* no direct graphics extension */ 286#define BuildXF86DGA NO 287 288/* Support for tablets and other non-standard input devices */ 289#ifndef BuildXInputExt 290# define BuildXInputExt YES 291#endif 292#define BuildXInputLib YES 293 294/* no Display Power Management extension */ 295#define BuildDPMS NO 296 297/* no XFree86-Misc extension */ 298#define BuildXF86MiscExt NO 299 300/* no XFree86-VidMode extension */ 301#define BuildXF86VidModeExt NO 302 303#ifndef BuildXterm 304# define BuildXterm BuildClients /* Not enabled by default */ 305#endif 306 307#define BuildLibPathVar DYLD_LIBRARY_PATH 308 309/* include rules to build shared libraries */ 310#include <darwinLib.rules> 311 312/* 313 * BundleProgramTarget - Generate rules for compiling, linking and 314 * installing a bundle executable. 315 */ 316#ifndef BundleProgramTarget 317#define BundleProgramTarget(program,loader,subdirs,objs,deplib,syslib,dstdir) @@\ 318 @@\ 319AllTarget(program) @@\ 320 @@\ 321program: loader subdirs objs deplib @@\ 322 RemoveTargetProgram($@) @@\ 323 LinkRule($@,-bundle $(LDOPTIONS),objs,deplib $(LDLIBS) syslib -bundle_loader loader) @@\ 324 @@\ 325InstallProgram(program,dstdir/program.bundle/Contents/MacOS) @@\ 326 @@\ 327clean:: @@\ 328 RemoveFile(program) 329#endif /* BundleProgramTarget */ 330 331/* 332 * Darwin specific Imake Config files 333 */ 334#ifndef LocalConfigFiles 335#define LocalConfigFiles \ 336 darwinLib.rules \ 337 darwinLib.tmpl 338#endif 339 340/* include all the X.Org rules */ 341#include <xorg.cf> 342