summaryrefslogtreecommitdiff
path: root/config/cf/darwin.cf
blob: e0e77aec45c6d65002ba0ea8be613d89a3051107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
XCOMM platform:  $XFree86: xc/config/cf/darwin.cf,v 1.59tsi 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
# define HasArc4Random          YES
# define HasGetIfAddrs          YES
# define HasStrlcat             YES
#else
# define HasBasename            NO
# define HasNCurses             NO
#endif
#ifndef HasGroff
# define HasGroff               YES
#endif
#ifndef HasGcc3
# define HasGcc3                NO
#endif
#ifndef HasGcc4
# define HasGcc4                NO
#endif
#if OSMajorVersion >= 7
#define HasPam                  YES
#ifndef PamLibraries
#define PamLibraries            -lpam
#endif

#ifndef PamMiscLibraries
#define PamMiscLibraries        -lpam_misc
#endif
#endif

/* Older versions don't really support IPv6, but #define AF_INET6. */
#if OSMajorVersion < 6
# define BuildIPv6              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

# if OSMajorVersion >= 7
   PROJ_BUILD = xcodebuild
# else
   PROJ_BUILD = pbxbuild
# endif

# ifndef HasXplugin
#  if OSMajorVersion >= 7
#   define HasXplugin           YES
#  else
#   define HasXplugin           NO
#  endif
# endif

# if HasXplugin
#  ifndef XpLibDir
#   define XpLibDir             /usr/lib
#  endif
#  ifndef XpIncDir
#   define XpIncDir             $(SERVERSRC)/hw/darwin/quartz/xpr
#  endif
   XPLIBDIR = XpLibDir
   XPINCDIR = XpIncDir
#  define XpluginLibrary        Concat(-L,$(XPLIBDIR)) -lXplugin
# else
#  define XpluginLibrary        /**/
# endif

# ifndef BuildAppleDRI
#  if HasXplugin
#   define BuildAppleDRI        YES
#  else
#   define BuildAppleDRI        NO
#  endif
# endif

# if BuildAppleDRI
#  define GlxExtraDefines -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL GlxArchDefines
# endif

#define BuildAppleWMLibrary     YES

#endif  /* DarwinQuartzSupport */

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

#define LdPostLib		/**/

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

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

#define MkdirHierCmd            mkdir -p

/* Use flex -l for compatibility with various versions of flex. */
#ifndef LexCmd
# define LexCmd                 flex -l
#endif
#define HasFlex                 YES

/*
 * Our cpp isn't in /lib/cpp and early versions don't like -undef.
 * We support gcc 3.3 and 4.0 as the default compiler
 */
#if (GccMajorVersion == 3) && (GccMinorVersion == 3)
# define CppCmd                 /usr/bin/cpp-3.3
# define StandardCppOptions     -traditional -P
# define RawCppCmd              CppCmd -undef
#else
#if (GccMajorVersion > 3)
# define CppCmd                 /usr/bin/cpp-4.0
# define StandardCppOptions     -traditional -P
# define RawCppCmd              CppCmd -undef
#else
# define CppCmd                 /usr/bin/cpp
# define StandardCppOptions     -traditional
# define RawCppCmd              CppCmd
#endif
#endif

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

/*
 * makedepend doesn't understand ObjectiveC's #import directives, frameworks,
 * and perhaps other things...
 */
#if HasGcc
# ifndef UseGccMakeDepend
#  define UseGccMakeDepend	YES
# endif
# ifndef PostIncDir
#  define PostIncDir		DefaultGccIncludeDir
# endif
#else
# ifndef UseCCMakeDepend
#  define UseCCMakeDepend	YES
# endif
#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

/* The cr implementation does not build with NEED_SCREEN_REGIONS,
   so play it safe. */
#ifndef ServerCCOptions
# define ServerCCOptions        DefaultCCOptions -UNEED_SCREEN_REGIONS
#endif

#ifdef PpcDarwinArchitecture
# define DarwinMachineDefines   -D__powerpc__
# if HasGcc3
#  define OptimizedCDebugFlags  -Os GccAliasingArgs
# else
#  define OptimizedCDebugFlags  -O2
# endif
# define ByteOrder              X_BIG_ENDIAN
#endif /* PpcDarwinArchitecture */

#ifdef i386DarwinArchitecture
# define DarwinMachineDefines   -D__i386__
# if HasGcc3
#  define OptimizedCDebugFlags  -Os GccAliasingArgs
# else
#  define OptimizedCDebugFlags  -O2 -fno-strength-reduce
# endif
# define ByteOrder              X_LITTLE_ENDIAN
#endif /* i386DarwinArchitecture */

#if OSMajorVersion < 7
# define DarwinLocaleDefines    -DX_LOCALE
#else
# define DarwinLocaleDefines    /**/
# define XawI18nDefines         -DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H
#endif

/*
 * __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.
 */
#define StandardDefines         DarwinMachineDefines -D__DARWIN__ \
                                -DNO_ALLOCA -DCSRG_BASED DarwinLocaleDefines
#define StandardCppDefines      StandardDefines

/*
 * Ensure locally built static libraries are found before dynamic libraries
 * in system library search paths.
 */
#ifndef  ExtraLoadOptions
# define ExtraLoadOptions       -Wl,-search_paths_first
#endif

/*
 * 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          YES
#endif

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

/* disable XKB by default as it can cause problems */
#define DfltDisableXKB          YES

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

/* Support for tablets and other non-standard input devices */
#ifndef BuildXInputExt
# define BuildXInputExt         YES
#endif
#define BuildXInputLib          YES

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

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

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

/* No longer works after security update 2007-004 */
#if OSMajorVersion < 9
#define BuildLibPathVar         DYLD_LIBRARY_PATH
#else
#undef  DontUseLibPathVar
#define DontUseLibPathVar	YES
#undef  BuildClients
#define BuildClients		YES
#undef  BuildLibraries
#define BuildLibraries		YES
/* So we can statically link certain utilities */
#undef  ForceNormalLib
#define ForceNormalLib		YES
#undef  StaticUtils
#define StaticUtils		YES
#endif

#ifndef DefaultUserPath
#define DefaultUserPath         /bin:/sbin:/usr/bin:/usr/sbin:$(BINDIR)
#endif
#define DefaultSystemPath       DefaultUserPath

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

#ifndef NothingOutsideProjectRoot
#define NothingOutsideProjectRoot NO
#endif

#if NothingOutsideProjectRoot
     XDARWINAPPDIR = $(BINDIR)/XDarwin.app/Contents
#else
     XDARWINAPPDIR = /Applications/XDarwin.app/Contents
#endif

/*
 * BundleProgramTarget - Generate rules for compiling, linking and
 * installing a bundle executable. 
 */
#ifndef BundleProgramTarget
#define BundleProgramTarget(program,loader,subdirs,objs,deplib,syslib)	@@\
                                                                        @@\
AllTarget(program)							@@\
									@@\
program: loader subdirs objs deplib					@@\
	RemoveTargetProgram($@)						@@\
	LinkRule($@,-bundle $(LDOPTIONS),objs,deplib $(LDLIBS) syslib -bundle_loader loader)	@@\
									@@\
InstallProgram(program,$(XDARWINAPPDIR)/Resources/program.bundle/Contents/MacOS)	@@\
									@@\
clean::									@@\
	RemoveFile(program)
#endif /* BundleProgramTarget */

/*
 * BundleSymbolicLink - Generate 'unsymlink' and 'resymlink' rules to
 * temporarily replace symbolic links with the files they reference.
 */
#ifndef BundleSymbolicLink
#define BundleSymbolicLink(symdir,subdir,target)			@@\
									@@\
unsymlink::								@@\
	MakeDir(symdir/subdir)						@@\
	@if [ -h target ]; then \					@@\
	    set -x; \							@@\
	    $(MV) target symdir/target; \				@@\
	    touch target; \						@@\
	    $(CP) symdir/target target; \				@@\
	fi								@@\
									@@\
resymlink clean::							@@\
	@if [ -h symdir/target ]; then \				@@\
	    set -x; \							@@\
	    $(MV) symdir/target target; \				@@\
	fi
#endif /* BundleSymbolicLink */

/*
 * BundleSymbolicLinkSubdirs - Subdirectory recursion for 'unsymlink' and
 * 'resymlink' targets.
 */
#ifndef BundleSymbolicLinkSubdirs
#define BundleSymbolicLinkSubdirs(dirs)					@@\
NamedTargetSubdirs(unsymlink,dirs,"unsymlinking",NullParameter,unsymlink)	@@\
NamedTargetSubdirs(resymlink,dirs,"resymlinking",NullParameter,resymlink)
#endif /* BundleSymbolicLinkSubdirs */

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

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