darwin.cf 9.3 KB

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