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