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