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