]> git.sesse.net Git - rdpsrv/blob - Xserver/config/cf/FreeBSD.cf
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / config / cf / FreeBSD.cf
1 XCOMM platform:  $TOG: FreeBSD.cf /main/18 1997/06/12 07:40:35 kaleb $
2 XCOMM platform:  $XFree86: xc/config/cf/FreeBSD.cf,v 3.58.2.11 1998/03/01 01:08:59 dawes Exp $
3
4 #ifndef OSName
5 #define OSName                  DefaultOSName
6 #endif
7 #ifndef OSVendor
8 #define OSVendor                /**/
9 #endif
10 #ifndef OSMajorVersion
11 #define OSMajorVersion          DefaultOSMajorVersion
12 #endif
13 #ifndef OSMinorVersion
14 #define OSMinorVersion          DefaultOSMinorVersion
15 #endif
16 #ifndef OSTeenyVersion
17 #define OSTeenyVersion          DefaultOSTeenyVersion
18 #endif
19 XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
20
21 #define HasGcc                  YES
22 #define HasGcc2                 YES
23 #define HasCplusplus            YES
24 #define HasGcc2ForCplusplus     YES
25 #define GccUsesGas              YES
26 #define UseGas                  YES
27 #define GnuCpp                  YES
28 #define HasNdbm                 YES
29 #define HasPutenv               YES
30 #define HasSnprintf             YES
31 #define HasBSD44Sockets         YES
32 #ifndef HasLibCrypt
33 # define HasLibCrypt            YES
34 #endif
35 #ifndef HasShm
36 # define HasShm                 YES
37 #endif
38 #define HasWChar32              YES
39
40 #define AvoidNullMakeCommand    YES
41 #define StripInstalledPrograms  YES
42 #define CompressAllFonts        YES
43 #define Malloc0ReturnsNull      YES
44 #define NeedConstPrototypes     YES
45 #define NeedFunctionPrototypes  YES
46 #define NeedNestedPrototypes    YES
47 #define NeedVarargsPrototypes   YES
48 #define NeedWidePrototypes      NO
49
50 #define MkdirHierCmd            mkdir -p
51
52 #define CcCmd                   cc
53 #define CppCmd                  /usr/libexec/cpp
54 #define PreProcessCmd           CppCmd
55 #define StandardCppDefines      -traditional
56 #if defined(UseInstalled) && (!defined(XF86LinkKit) || !XF86LinkKit)
57 #define DefaultCCOptions        /**/
58 #else
59 #define DefaultCCOptions        -ansi -pedantic -Dasm=__asm
60 #endif
61 #ifndef ExtraLibraries
62 #define ExtraLibraries          /**/
63 #endif
64 #ifndef UseGnuMalloc
65 /* 2.2 doesn't really have GnuMalloc */
66 #if OSMajorVersion < 2 || (OSMajorVersion == 2 && OSMinorVersion < 2)
67 #define UseGnuMalloc            YES
68 #else
69 #define UseGnuMalloc            NO
70 #endif
71 #endif
72
73 /* 2.2.2 and later has setusercontext() */
74 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 2) || \
75      (OSMajorVersion == 2 && OSMinorVersion == 2 && OSTeenyVersion >= 2)
76 #define HasSetUserContext       YES
77 #endif
78
79 /* 
80  * This doesn't work the way it does on every other system. On FreeBSD it's
81  * only a "hint, not a demand", whatever that means. Note that this is not 
82  * what it says in the ld and ld.so man pages, which are rather vague on the
83  * matter.
84  *
85  * But we do know that if a) you do what the X Project team does and set your 
86  * ProjectRoot to something like "/X11", and b) you have other X libraries, 
87  * e.g. in /usr/X11R6/lib, and you have added /usr/X11R6/lib to your 
88  * ld.so.cache with ldconfig, then any programs linked with this "hint" will
89  * find that ld.so ignores the "hint" at runtime and loads the libraries in 
90  * the ld.so.cache, i.e.the wrong ones, instead! Empirically we find that
91  * the run-path is only used as a last resort to find the libraries, after
92  * the LD_LIBRARY_PATH and ld.so.cache.
93  *
94  * N. B. to FreeBSD users who are not familiar with the semantics of the run-
95  * path on other systems. The run-path is akin to a per-program ld.so.cache. 
96  * If a program is linked with a run-path, that run-path should take 
97  * precedence over _everything_ else! In my opinion ldconfig and the 
98  * ld.so.cache should be deprecated immediately now that FreeBSD has run-
99  * paths. Any program that needs libraries that are outside the "well known" 
100  * locations should be linked with a run-path.
101  *
102  * All of which begs the question: If this option doesn't work in any useful
103  * way, why did they (FreeBSD) bother to add it? It would be nice if FreeBSD
104  * would fix ld.so so that run-paths are truly useful.
105  *
106  * Using run-paths is added with the intent that vendors who ship X for 
107  * FreeBSD should use it too. Once everyone uses it then there will be no 
108  * reason for FreeBSD to assume that it knows where X libraries are installed 
109  * and they can remove it from the list of directories they add to ld.so.cache 
110  * in their /etc/rc file.
111  */
112 #if OSMajorVersion > 2 || (OsMajorVersion == 2 && OSMinorVersion >= 2)
113 #ifndef ExtraLoadFlags
114 #define ExtraLoadFlags          -Wl,-R,$(USRLIBDIRPATH)
115 #endif
116 #endif
117
118 #ifndef GnuMallocLibrary
119 #define GnuMallocLibrary        -lgnumalloc
120 #endif
121
122 #if (OSMajorVersion > 2) || (OSMajorVersion == 2 && OSMinorVersion >= 2) \
123         || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 6)
124 /* 2.1.6 and 2.2 have libz */
125 #ifndef HasZlib
126 #define HasZlib         YES
127 #endif
128 #endif
129
130 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 2) || \
131     (OSMajorVersion == 2 && OSMinorVersion == 2 && OSTeenyVersion > 2)
132 /*
133  * FreeBSD 2.2.5 or later.
134  *
135  * Don't make any assumptions about the version of Tcl in the base OS.
136  * These settings assume that the tcl-7.6 and tk-4.2 packages have been
137  * installed.
138  *
139  * Note the static libs in some versions of the FreeBSD packages are
140  * broken.  The symptom of this is unresolved symbols when linking
141  * XF86Setup.  If you run into this problem, either build your own
142  * static libs from the standard Tcl and Tk source, or change the
143  * definitions of XF86SetupUsesStatic{Tcl,Tk}.  The latter is not
144  * recommended for binaries that are going to be redistributed.
145  */
146 #ifndef TkLibName
147 #define TkLibName               tk42
148 #endif
149 #ifndef TkIncDir
150 #define TkIncDir                /usr/local/include/tk4.2
151 #endif
152 #ifndef TclLibName
153 #define TclLibName              tcl76
154 #endif
155 #ifndef TclIncDir
156 #define TclIncDir               /usr/local/include/tcl7.6
157 #endif
158 #else
159 #if OSMajorVersion == 2 && OSMinorVersion == 2
160 /*
161  * FreeBSD 2.2 prior to 2.2.5
162  *
163  * Note: the tk-4.1 package for FreeBSD doesn't have the static lib, so
164  * you'll have to build it yourself, or change the definition of
165  * XF86SetupUsesStaticTk.
166  */
167 #ifndef TkLibName
168 #define TkLibName               tk41
169 #endif
170 #ifndef TclLibName
171 #define TclLibName              tcl
172 #endif
173 #ifndef TclLibDir
174 #define TclLibDir               /usr/lib
175 #endif
176 #ifndef TclIncDir
177 #define TclIncDir               /usr/include
178 #endif
179 /* FreeBSD 2.2 has libtcl in the base system */
180 #ifndef XF86SetupUsesStaticTcl
181 #define XF86SetupUsesStaticTcl  NO
182 #endif
183
184 #else /* ! 2.2 or later */
185
186 #if OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 6
187
188 /*
189  * 2.1.x with x >=6 has tk 4.1 and tcl 7.5 in the packages collection.
190  * Neither packages include the static libs, so you either need to build
191  * them yourself or set XF86SetupUsesStaticTcl and XF86SetupUsesStaticTk
192  * to NO.  This isn't the default because we don't want the XFree86
193  * binaries to have these packages as a dependency.
194  */
195
196 #ifndef TkLibName
197 #define TkLibName               tk41
198 #endif
199 #ifndef TclLibName
200 #define TclLibName              tcl75
201 #endif
202
203 #else /* ! 2.1.6 or later */
204
205 #ifndef TkLibName
206 #define TkLibName               tk40
207 #endif
208 #ifndef TclLibName
209 #define TclLibName              tcl74
210 #endif
211
212 #endif
213 #endif
214 #endif
215
216 #undef  InstallCmd
217 #define InstallCmd              /usr/bin/install
218
219 #if GccUsesGas
220 # define GccGasOption           -DGCCUSESGAS
221 # define AsmDefines             -DUSE_GAS
222 #else
223 # define GccGasOption /**/
224 #endif
225
226 #define ServerExtraDefines GccGasOption XFree86ServerDefines
227
228 #define StandardDefines -DCSRG_BASED
229
230 #if OSMajorVersion > 1
231 #define ServerOSDefines         XFree86ServerOSDefines -DDDXTIME
232 #define XawI18nDefines          -DUSE_XWCHAR_STRING
233 #define HasMakefileSafeInclude  YES
234 #define IncludeMakefile(file) @@# dependencies are in .depend
235 #define DependFileName          .depend
236 #ifndef BuildDynamicLoading
237 #define BuildDynamicLoading     YES
238 #endif
239 #ifndef ForceNormalLib
240 #define ForceNormalLib          YES
241 #endif
242 #define HasMkstemp              YES
243 #else
244 #define ServerOSDefines         XFree86ServerOSDefines -DDDXTIME -DXNO_SYSCONF
245 #define XawI18nDefines          -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
246 #endif
247
248 /* The GCC strength-reduce bug is fixed for FreeBSD 2.1.5 and later */
249 #ifndef DefaultGcc2i386Opt
250 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 5)
251 #define DefaultGcc2i386Opt -O2
252 #endif
253 #endif
254
255 #ifdef i386Architecture
256 # define OptimizedCDebugFlags DefaultGcc2i386Opt
257 #else
258 # define OptimizedCDebugFlags -O2
259 #endif
260
261 #ifndef PreIncDir
262 # define PreIncDir      /usr/include
263 #endif
264
265 #define TroffCmd        groff -Tps
266 #define SetTtyGroup     YES
267
268 #ifndef ExtraFilesToClean
269 # define ExtraFilesToClean *.core
270 #endif
271
272 #define DefaultUserPath         /bin:/usr/bin:/sbin:/usr/sbin:$(BINDIR):/usr/gnu/bin:/usr/local/bin
273 #define DefaultSystemPath       /bin:/usr/bin:/sbin:/usr/sbin:$(BINDIR)
274 #ifndef SystemManDirectory
275 #define SystemManDirectory      /usr/share/man
276 #endif
277
278 #define InstKmemFlags   -g kmem -m 2755
279
280 /*
281  * Compress manual pages
282  */
283 #ifndef CompressManPages
284 # define CompressManPages        YES
285 #endif
286
287 #if CompressManPages
288
289 #ifndef CompressManCmd
290 # define CompressManCmd         gzip -n
291 #endif
292    COMPRESSMANCMD = CompressManCmd
293
294 #ifndef InstallManPageLong
295 #define InstallManPageLong(file,destdir,dest)                           @@\
296 install.man:: file.man                                                  @@\
297         MakeDir($(DESTDIR)destdir)                                      @@\
298         $(RM) $(DESTDIR)destdir/dest.$(MANSUFFIX)*                      @@\
299         $(INSTALL) -c $(INSTMANFLAGS) file.man \                        @@\
300           $(DESTDIR)destdir/dest.$(MANSUFFIX)                           @@\
301         -$(COMPRESSMANCMD) $(DESTDIR)destdir/dest.$(MANSUFFIX)
302 #endif
303
304 #ifndef InstallGenManPageLong
305 #define InstallGenManPageLong(file,destdir,dest,suffix)                 @@\
306 install.man:: file.man                                                  @@\
307         MakeDir($(DESTDIR)destdir)                                      @@\
308         $(RM) $(DESTDIR)destdir/dest.suffix*                            @@\
309         $(INSTALL) -c $(INSTMANFLAGS) file.man \                        @@\
310           $(DESTDIR)destdir/dest.suffix                                 @@\
311         -$(COMPRESSMANCMD) $(DESTDIR)destdir/dest.suffix
312 #endif
313
314 #ifndef InstallMultipleMan
315 #define InstallMultipleMan(list,dest)                                   @@\
316 install.man:: list                                                      @@\
317         MakeDir($(DESTDIR)dest)                                         @@\
318         @case '${MFLAGS}' in *[i]*) set +e;; esac; \                    @@\
319         for i in list; do \                                             @@\
320                 (set -x; \                                              @@\
321                 MNAME=`echo $$i | cut -f1 -d.`; \                       @@\
322                 $(RM) $(DESTDIR)dest/$${MNAME}*; \                      @@\
323                 $(INSTALL) -c $(INSTMANFLAGS) $$i \                     @@\
324                   $(DESTDIR)dest/$${MNAME}.$(MANSUFFIX); \              @@\
325                 $(COMPRESSMANCMD) $(DESTDIR)dest/$${MNAME}.$(MANSUFFIX)); \  @@\
326         done
327 #endif
328
329 /*
330  * InstallManPageAliases - install soft links for aliases.
331  */
332 #ifndef InstallManPageAliases
333 #define InstallManPageAliases(file,destdir,aliases)                     @@\
334 install.man::                                                           @@\
335         @(SUFFIX=`echo $(DESTDIR)destdir/file.* | sed -e 's,.*/[^\.]*.,,'`; \ @@\
336         for i in aliases; do (set -x; \                                 @@\
337         $(RM) $(DESTDIR)destdir/$$i.*; \                                @@\
338         (cd $(DESTDIR)destdir; $(LN) file.$${SUFFIX} \                  @@\
339         $$i.$${SUFFIX})); \                                             @@\
340         done)
341 #endif
342
343 /*
344  * InstallGenManPageAliases - install soft links for aliases.
345  */
346 #ifndef InstallGenManPageAliases
347 #define InstallGenManPageAliases(file,destdir,suffix,aliases)              @@\
348         InstallManPageAliases(file,destdir,aliases)
349 #endif
350 #endif
351
352 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 1)
353 #define HasBsdMake      YES
354 #endif
355
356 #ifndef StaticLibrary
357 #define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic
358 #endif
359
360 #include <bsdLib.rules>
361
362 #ifdef i386Architecture
363 #include <xfree86.cf>
364 #endif