darwin.cf revision 944bff83
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#ifdef x86_64DarwinArchitecture 234# define DarwinMachineDefines -D__x86_64__ 235# if HasGcc3 236# define OptimizedCDebugFlags -Os 237# else 238# define OptimizedCDebugFlags -O2 -fno-strength-reduce 239# endif 240# define ByteOrder X_LITTLE_ENDIAN 241#endif /* x86_64DarwinArchitecture */ 242 243#ifdef aarch64DarwinArchitecture 244# define DarwinMachineDefines -D__aarch64__ 245# if HasGcc3 246# define OptimizedCDebugFlags -Os 247# else 248# define OptimizedCDebugFlags -O2 -fno-strength-reduce 249# endif 250# define ByteOrder X_LITTLE_ENDIAN 251#endif /* aarch64DarwinArchitecture */ 252 253#if OSMajorVersion < 7 254# define DarwinLocaleDefines -DX_LOCALE 255#else 256# define DarwinLocaleDefines /**/ 257# define XawI18nDefines -DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H 258#endif 259 260/* 261 * __DARWIN__ will be used for platform specific #ifdefs that can't 262 * be handled by existing X defines. 263 * 264 * Darwin's alloca() seg faults (rather than returning NULL) on failed 265 * allocations, so we can't use it. 266 */ 267#define StandardDefines DarwinMachineDefines -D__DARWIN__ \ 268 -DNO_ALLOCA -DCSRG_BASED DarwinLocaleDefines 269 270/* 271 * Set this to NO to just build the client libs, which should work without 272 * having to write any platform specific code. 273 */ 274#ifndef BuildServer 275# define BuildServer YES 276 277/* our custom X server */ 278# define XDarwinServer YES 279#endif 280 281/* Thanks to the IOKit, the X server does not have to be SetUID. */ 282#ifndef InstallXserverSetUID 283# define InstallXserverSetUID NO 284#endif 285 286/* Allow Xtrans to work with non-SetUID server. */ 287#ifndef XtransFailSoft 288# define XtransFailSoft YES 289#endif 290 291/* disable XKB by default as it can cause problems */ 292#define DfltDisableXKB YES 293 294/* no direct graphics extension */ 295#define BuildXF86DGA NO 296 297/* Support for tablets and other non-standard input devices */ 298#ifndef BuildXInputExt 299# define BuildXInputExt YES 300#endif 301#define BuildXInputLib YES 302 303/* no Display Power Management extension */ 304#define BuildDPMS NO 305 306/* no XFree86-Misc extension */ 307#define BuildXF86MiscExt NO 308 309/* no XFree86-VidMode extension */ 310#define BuildXF86VidModeExt NO 311 312#ifndef BuildXterm 313# define BuildXterm BuildClients /* Not enabled by default */ 314#endif 315 316#define BuildLibPathVar DYLD_LIBRARY_PATH 317 318/* include rules to build shared libraries */ 319#include <darwinLib.rules> 320 321/* 322 * BundleProgramTarget - Generate rules for compiling, linking and 323 * installing a bundle executable. 324 */ 325#ifndef BundleProgramTarget 326#define BundleProgramTarget(program,loader,subdirs,objs,deplib,syslib,dstdir) @@\ 327 @@\ 328AllTarget(program) @@\ 329 @@\ 330program: loader subdirs objs deplib @@\ 331 RemoveTargetProgram($@) @@\ 332 LinkRule($@,-bundle $(LDOPTIONS),objs,deplib $(LDLIBS) syslib -bundle_loader loader) @@\ 333 @@\ 334InstallProgram(program,dstdir/program.bundle/Contents/MacOS) @@\ 335 @@\ 336clean:: @@\ 337 RemoveFile(program) 338#endif /* BundleProgramTarget */ 339 340/* 341 * Darwin specific Imake Config files 342 */ 343#ifndef LocalConfigFiles 344#define LocalConfigFiles \ 345 darwinLib.rules \ 346 darwinLib.tmpl 347#endif 348 349/* include all the X.Org rules */ 350#include <xorg.cf> 351