Fix FreeBSD 10.2 build
[oweals/cde.git] / cde / config / cf / FreeBSD.cf
1 XCOMM platform:  $TOG: FreeBSD.cf /main/21 1997/10/05 20:42:34 kaleb $
2
3 #ifndef OSName
4 #define OSName                  DefaultOSName
5 #endif
6 #ifndef OSVendor
7 #define OSVendor                FreeBSD Foundation
8 #endif
9 #ifndef OSMajorVersion
10 #define OSMajorVersion          DefaultOSMajorVersion
11 #endif
12 #ifndef OSMinorVersion
13 #define OSMinorVersion          DefaultOSMinorVersion
14 #endif
15 #ifndef OSTeenyVersion
16 #define OSTeenyVersion          DefaultOSTeenyVersion
17 #endif
18 XCOMM operating system:  OSName (OSMajorVersion/**/./**/OSMinorVersion/**/./**/OSTeenyVersion)
19
20 #define HasPutenv               YES
21 #define HasBSD44Sockets         YES
22 #define HasZlib                 YES
23
24 #if OSMajorVersion >= 10 && defined(UseGcc)
25 USE_GCC = UseGcc
26 #endif
27
28 #ifndef CppCmd
29 #if OSMajorVersion >= 10 && defined(UseGcc)
30 # define CppCmd                 /usr/local/bin/cpp$(USE_GCC)
31 #else
32 # define CppCmd                 /usr/bin/cpp
33 #endif
34 #endif
35 #define PreProcessCmd           CppCmd
36
37 #if OSMajorVersion >= 10
38 #define CppArgs                 -Wno-invalid-pp-token
39 #define DirFailPrefix           -
40 #else
41 #define CppArgs                 /**/
42 #endif
43
44 #ifndef StandardCppDefines
45 #define StandardCppDefines      -traditional CppArgs
46 #endif
47
48 #ifndef PerlCmd
49 #define PerlCmd                 /usr/local/bin/perl
50 #endif
51 #undef  InstallCmd
52 #define InstallCmd              /usr/bin/install
53 #undef  KornShell
54 #define KornShell               /usr/local/bin/ksh93
55
56 #define UseGas                  YES
57 #ifndef GccUsesGas
58 # define GccUsesGas             YES
59 #endif
60
61 #ifndef AsmDefines
62 #  define AsmDefines            -DUSE_GAS
63 #endif
64
65 #if GccUsesGas
66 # define GccGasOption           -DGCCUSESGAS
67 #else
68 # define GccGasOption           /**/
69 #endif
70
71 #ifndef HasGcc2
72 # define HasGcc2                YES
73 #endif
74
75 /* For DtHelp TIFF processing routines. */
76 #ifdef AMD64Architecture
77 #define LSBBitOrder             YES
78 #endif
79
80 #ifdef ARMArchitecture
81 #define LSBBitOrder             YES
82 #endif
83
84 #ifdef i386Architecture
85 #define LSBBitOrder             YES
86 #endif
87
88 #define MkdirHierCmd            mkdir -p
89
90 #ifndef CcCmd
91 #if OSMajorVersion >= 10
92 # if defined(UseGcc)
93 #  define CcCmd                 /usr/local/bin/gcc$(USE_GCC)
94 #  define CplusplusCmd          /usr/local/bin/g++$(USE_GCC)
95 # else
96 #  define CcCmd                 cc
97 #  define CplusplusCmd          c++
98 # endif
99 #else
100 # define CcCmd                  gcc
101 # define CplusplusCmd           g++
102 #endif
103 #endif
104
105 #ifndef DefaultCCOptions
106 #define DefaultCCOptions        -pipe
107 #endif
108
109 #ifndef CplusplusLibC
110 #define CplusplusLibC           -lstdc++
111 #endif
112
113 #if OSMajorVersion > 1
114 #define ServerOSDefines         XFree86ServerOSDefines -DDDXTIME
115 #define XawI18nDefines          -DUSE_XWCHAR_STRING
116 #define HasMakefileSafeInclude  YES
117 #define IncludeMakefile(file)   HASH_SIGN dependencies are in .depend
118 #define DependFileName          .depend
119 #if OSMajorVersion < 3
120 #if OSMinorVersion < 2
121 #ifndef ExtraLibraries
122 #define ExtraLibraries          -lgnumalloc
123 #endif
124 #else
125 #if OSTeenyVersion == 2
126 #define HasSetUserContext       YES
127 #endif
128 #endif
129 #ifndef ExtraLoadFlags
130 /* 
131  * This doesn't work the way it does on every other system. On FreeBSD it's
132  * only a "hint, not a demand", whatever that means. Note that this is not 
133  * what it says in the ld and ld.so man pages, which are rather vague on the
134  * matter.
135  *
136  * But we do know that if a) you do what the X Project team does and set your 
137  * ProjectRoot to something like "/X11", and b) you have other X libraries, 
138  * e.g. in /usr/X11R6/lib, and you have added /usr/X11R6/lib to your 
139  * ld.so.cache with ldconfig, then any programs linked with this "hint" will
140  * find that ld.so ignores the "hint" at runtime and loads the libraries in 
141  * the ld.so.cache, i.e.the wrong ones, instead! Empirically we find that
142  * the run-path is only used as a last resort to find the libraries, after
143  * the LD_LIBRARY_PATH and ld.so.cache.
144  *
145  * N. B. to FreeBSD users who are not familiar with the semantics of the run-
146  * path on other systems. The run-path is akin to a per-program ld.so.cache. 
147  * If a program is linked with a run-path, that run-path should take 
148  * precedence over _everything_ else! In my opinion ldconfig and the 
149  * ld.so.cache should be deprecated immediately now that FreeBSD has run-
150  * paths. Any program that needs libraries that are outside the "well known" 
151  * locations should be linked with a run-path.
152  *
153  * All of which begs the question: If this option doesn't work in any useful
154  * way, why did they (FreeBSD) bother to add it? It would be nice if FreeBSD
155  * would fix ld.so so that run-paths are truly useful.
156  *
157  * Using run-paths is added with the intent that vendors who ship X for 
158  * FreeBSD should use it too. Once everyone uses it then there will be no 
159  * reason for FreeBSD to assume that it knows where X libraries are installed 
160  * and they can remove it from the list of directories they add to ld.so.cache 
161  * in their /etc/rc file.
162  */
163 #define ExtraLoadFlags          -Wl,-R,$(USRLIBDIRPATH)
164 #endif
165 #endif
166 #else
167 #define ServerOSDefines         XFree86ServerOSDefines -DDDXTIME -DXNO_SYSCONF
168 #define XawI18nDefines          -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
169 #ifndef ExtraLibraries
170 #define ExtraLibraries          /* -lmalloc */
171 #endif
172 #endif
173
174 /* The GCC strength-reduce bug is fixed for FreeBSD 2.1.5 and later */
175 #ifndef DefaultGcc2i386Opt
176 #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 5)
177 #define DefaultGcc2i386Opt -O2 -fno-strict-aliasing
178 #endif
179 #endif
180
181 #ifndef OptimizedCDebugFlags
182 # if defined(i386Architecture) || defined(AMD64Architecture)
183 #  define OptimizedCDebugFlags DefaultGcc2i386Opt
184 # else
185 #  define OptimizedCDebugFlags -O2 -fno-strict-aliasing
186 # endif
187 #endif
188
189 #ifdef HasGcc2
190 CXXDEPENDINCLUDE != CcCmd -v -x c++ /dev/null -fsyntax-only \
191                     2>&1 | sed -n 's/^ \(\/.*[cg]++.*\)/-I\1/p'
192 #define CplusplusDependIncludes $(CXXDEPENDINCLUDE)
193 #endif
194
195 /* beginning with svn version 254273 iconv functions are moved to libc */
196 #if (OSMajorVersion >= 10)
197 ICONVSYSLIB != if test -f /usr/local/include/iconv.h; then echo -liconv; else echo; fi
198 #endif
199
200 #define ServerExtraDefines      GccGasOption XFree86ServerDefines
201
202 #define StandardDefines         -DCSRG_BASED
203 #define StandardIncludes        -I/usr/local/include
204 #define BuildLibPathVar         LD_LIBRARY_PATH
205
206 #define DefaultUserPath         /bin:/usr/bin:/usr/local/bin:$(BINDIR)
207 #define DefaultSystemPath       /sbin:/usr/sbin:/bin:/usr/bin:$(BINDIR)
208
209 #define TroffCmd                groff -Tps
210 #define SetTtyGroup             YES
211 #define HasNdbm                 YES
212 #define HasShm                  YES
213 #define HasWChar32              YES
214
215 #define HasLibCrypt             YES
216
217 #define AvoidNullMakeCommand    YES
218
219 #define HasPlugin               YES
220 #define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
221
222 #define CDESharedRev            2
223
224 #include <bsdLib.rules>