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