Minor corrections and cleanup to sun.cf
[oweals/cde.git] / cde / config / cf / sun.cf
1 XCOMM platform:  $TOG: sun.cf /main/176 1997/12/09 17:27:51 kaleb $
2
3 #ifndef OSName
4 # define OSName         DefaultOSName
5 #endif
6 #ifndef OSMajorVersion
7 # define OSMajorVersion DefaultOSMajorVersion
8 #endif
9 #ifndef OSMinorVersion
10 # define OSMinorVersion DefaultOSMinorVersion
11 #endif
12 #ifndef OSTeenyVersion
13 # define OSTeenyVersion DefaultOSTeenyVersion
14 #endif
15 XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
16
17 /*
18  * Compiler setup.  This sun.cf file knows what options to use with 
19  * certain compilers, including Sun C and gcc.  It also understands
20  * how to set some of the options for various C++ compilers, including
21  * Sun C++ and g++.
22  *
23  * === C Compiler Setup ==========================================
24  *
25  * For SunPro C, define HasSunC to YES in host.def.
26  * For Gnu gcc, define HasGcc2 to YES in host.def
27  * For other compilers, define HasSunC to NO in host.def, then
28  *    provide appropriate values for the various compiler related
29  *    configuration varibles used here.
30  * 
31  * If you don't tell us which C compiler you have, we assume you have 
32  * the Gcc C compiler under Solaris 2.x.
33  *
34  * === C++ Compiler Setup ==========================================
35  *
36  * For SunPro C++, define HasSunCplusplus to YES in host.def
37  * For Gnu g++ 4.x, define HasGcc2ForCplusplus to YES in host.def
38  * For other compilers, define HasCplusplus to YES in host.def, and
39  *    check to see if you need to provide values for CplusplusOptions
40  *    and/or DefaultCplusplusOptions.
41  *
42  * In any case, you may also need to set CplusplusDependIncludes.
43  *
44  * If you say you have the SunPro C++ compiler, we assume you have 
45  * version 5.0.x of the compiler.  If you have an earlier version
46  * instead, define CplusplusCompilerMajorVersion in host.def.
47  *
48  */
49
50 #ifndef HasSunC
51 # if (HasGcc || HasGcc2 || OSMajorVersion < 5)
52 #  define HasSunC NO
53 # else
54 #  define HasSunC YES
55 # endif
56 #endif
57
58 #if HasSunC 
59 # ifndef CCompilerMajorVersion
60 #  define CCompilerMajorVersion DefaultSunProCCompilerMajorVersion
61 # endif
62 # ifndef CCompilerMinorVersion
63 #  define CCompilerMinorVersion DefaultSunProCCompilerMinorVersion
64 # endif
65 XCOMM SunPro C CCompilerMajorVersion./**/CCompilerMinorVersion
66 #endif
67
68 #if HasSunCplusplus
69 # ifndef HasCplusplus
70 #  define HasCplusplus YES
71 # endif
72 # ifndef CplusplusCompilerMajorVersion
73 #  ifdef DefaultSunProCplusplusCompilerMajorVersion
74 #   define CplusplusCompilerMajorVersion DefaultSunProCplusplusCompilerMajorVersion
75 #  else
76 #   define CplusplusCompilerMajorVersion 3
77 #  endif
78 # endif
79 # ifndef CplusplusCompilerMinorVersion
80 #  ifdef DefaultSunProCplusplusCompilerMinorVersion
81 #   define CplusplusCompilerMinorVersion DefaultSunProCplusplusCompilerMinorVersion
82 #  else
83 #   define CplusplusCompilerMinorVersion 0
84 #  endif
85 # endif
86 XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
87 #endif
88
89 #if HasGcc2
90 # ifndef CCompilerMajorVersion
91 #  define CCompilerMajorVersion DefaultGnuCCompilerMajorVersion
92 # endif
93 # ifndef CCompilerMinorVersion
94 #  define CCompilerMinorVersion DefaultGnuCCompilerMinorVersion
95 # endif
96 XCOMM Gnu C CCompilerMajorVersion./**/CCompilerMinorVersion
97 #endif
98
99 #if HasGcc2ForCplusplus
100 # ifndef HasCplusplus
101 #  define HasCplusplus YES
102 # endif
103 # ifndef CplusplusCompilerMajorVersion
104 #  ifdef DefaultGnuCplusplusCompilerMajorVersion
105 #   define CplusplusCompilerMajorVersion DefaultGnuCplusplusCompilerMajorVersion
106 #  else
107 #   define CplusplusCompilerMajorVersion 4
108 #  endif
109 # endif
110 # ifndef CplusplusCompilerMinorVersion
111 #  ifdef DefaultGnuCplusplusCompilerMinorVersion
112 #   define CplusplusCompilerMinorVersion DefaultGnuCplusplusCompilerMinorVersion
113 #  else
114 #   define CplusplusCompilerMinorVersion 6
115 #  endif
116 # endif
117 XCOMM Gnu C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
118 #endif
119
120
121 #if OSMajorVersion > 4
122 #define MkdirHierCmd            mkdir -p
123 #endif
124
125 #ifndef OptimizedCDebugFlags
126 # define OptimizedCDebugFlags   -O2
127 #endif
128
129 #if OSMajorVersion < 4 || (OSMajorVersion == 4 && OSMinorVersion < 1)
130 /* We do not guarantee this will work */
131 # define BootstrapCFlags        -DNOSTDHDRS
132 # define StandardDefines        -DNOSTDHDRS
133 # define XawI18nDefines         -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
134 #endif
135
136 #if OSMajorVersion == 4 
137 # if OSMinorVersion == 1
138 #  define HasPoll               YES
139 # endif
140 # if OSMinorVersion > 1 || (OSMinorVersion == 1 && OSTeenyVersion > 1)
141 /* You ALSO need this if you have Sun ld patch 100170-06 or later to 4.1.1 */
142 #  define SunPost411FCSLd       YES
143 # endif
144 #endif
145
146 #ifdef i386Architecture
147 # if OSMajorVersion > 4
148 #  define ServerExtraDefines    AllocateLocalDefines XFree86ServerDefines
149 #  define ServerOSDefines       XFree86ServerOSDefines
150 # else
151 #  define ServerExtraDefines AllocateLocalDefines
152 #  define ServerOSDefines       -DDDXOSINIT
153 # endif
154 #else
155 # define ServerExtraDefines AllocateLocalDefines
156 # define ServerOSDefines        -DDDXOSINIT
157 # define HasPlugin              YES
158 #endif
159
160 #define XkbServerDefines  -DXKB_ALWAYS_USES_SOFT_REPEAT
161
162 #if OSMajorVersion > 4
163 #define ConnectionFlags         -DTCPCONN -DUNIXCONN -DLOCALCONN
164 #if HasSunC
165 /* 
166  * Assume /opt/solarisstudio/bin/ contains symlinks to the appropriate tools
167  */
168 #ifndef  CcCmd
169 # define CcCmd                  /opt/solarisstudio/bin/cc
170 #endif
171 #ifndef  CplusplusCmd
172 # define CplusplusCmd           /opt/solarisstudio/bin/CC
173 #endif
174 #ifndef  CplusplusFilt
175 #  define CplusplusFilt         /opt/solarisstudio/bin/c++filt
176 #endif
177 #ifndef CplusplusLibC
178 #define CplusplusLibC           -L/opt/solarisstudio/lib -lCrun
179 #endif
180 #ifndef OptimizedCplusplusDebugFlags
181 # define OptimizedCplusplusDebugFlags   -O2 -erroff=attrskipunsup
182 #endif
183 #ifndef  CplusplusDependIncludes
184 #if CplusplusCompilerMajorVersion > 4
185 # define CplusplusDependIncludes        -I/opt/solarisstudio/prod/include/CC -I/opt/solarisstudio/prod/include/CC/Cstd -I/opt/solarisstudio/prod/include/CC/std
186 #elif CplusplusCompilerMajorVersion > 3
187 # define CplusplusDependIncludes       -I/opt/SUNWspro/SC4.0/include/CC
188 #elif CplusplusCompilerMajorVersion > 2
189 # define CplusplusDependIncludes        -I/opt/SUNWspro/SC3.0/include/CC
190 #else
191 # define CplusplusDependIncludes        -I/opt/SUNWspro/SC2.0.1/include/CC
192 #endif
193 #endif
194 #endif
195 # if HasSunC && (CCompilerMajorVersion < 3)
196 #  define BootstrapCFlags       -DSVR4
197 # else
198 #  define BootstrapCFlags       /* none needed */
199 # endif
200 # ifndef XawI18nDefines
201 #  if OSMinorVersion < 4
202 #   define XawI18nDefines    -DHAS_WCTYPE_H -DHAS_ISW_FUNCS
203 #  else
204 #   define XawI18nDefines    -DHAS_WCHAR_H -DHAS_ISW_FUNCS
205 #  endif
206 # endif
207 # if OSMinorVersion > 10
208 #  define InstallCmd        /usr/bin/ginstall
209 # elif OSMinorVersion > 3
210 #  define InstallCmd        /usr/ucb/install
211 # endif
212 # if defined(i386Architecture)
213 #  define StandardDefines               -Dsun -Di386 -DSVR4 -D__i386
214 #  define ToolkitStringsABIOptions      -intelabi
215 # elif defined(SparcArchitecture)
216 #  define StandardDefines               -Dsun -Dsparc -DSVR4 -D__sparc
217 #  define ToolkitStringsABIOptions      -sparcabi
218 # else
219 #  define StandardDefines               -Dsun -DSVR4
220 #  define ToolkitStringsABIOptions      -sparcabi
221 # endif
222 # define ExtraLibraries    -lsocket -lnsl
223 # if OSMinorVersion > 1
224 #  define ThreadedX       YES
225 #  define MTSafeAPIDefines      -DXUSE_MTSAFE_API -DXUSE_NETDB_R_API
226 #  if HasSunC && CCompilerMajorVersion > 2
227 #   define ThreadsCompileFlags -mt
228 #  else
229 #   define SystemMTDefines -D_REENTRANT
230 #   define ThreadsLibraries -lthread
231 #  endif
232 #  if HasSunCplusplus && CplusplusCompilerMajorVersion > 3
233 #   define ThreadsCplusplusCompileFlags -mt
234 #  else
235 #   define CplusplusSystemMTDefines -D_REENTRANT
236 #   define ThreadsCplusplusLibraries -lthread
237 #  endif
238 # endif                 /* OSMinorVersion > 1 */
239 # ifndef UseExportLists
240 #  define UseExportLists   NO
241 # endif
242 # define HasVFork          NO
243 # define InstKmemFlags    -g sys -m 2711
244 # define ShLibIncludeFile <sunLib.tmpl>
245 /*
246  * Set flags for position independent code before including sv4Lib.rules
247  * if the compiler in use doesn't use standard SVR4 flags
248  */
249 # if HasSunC
250 #  define PositionIndependentCFlags -Kpic
251 #  define LargePositionIndependentCFlags -KPIC
252 # endif
253 # if HasSunCplusplus
254 #  define PositionIndependentCplusplusFlags -pic
255 #  define LargePositionIndependentCplusplusFlags -PIC
256 # endif
257 #else /* not OSMajorVersion > 4 */
258 #define InstKmemFlags     -g kmem -m 2711
259 #include <sunLib.rules>
260 #endif /* OSMajorVersion > 4 (else) */
261
262 #define BuildLibPathVar   LD_LIBRARY_PATH
263 #define HasNdbm           YES
264 #define HasShm            YES
265 #define HasSecureRPC      YES
266 #define SetTtyGroup       YES
267 #define HasPutenv         YES
268 #ifndef i386Architecture
269 # ifndef Xsun24Server
270 #  define Xsun24Server    NO            /* color, mono, multiple depths */
271 # endif
272 # ifndef XsunServer
273 #  define XsunServer      YES           /* color and mono, 8 bit only */
274 # endif
275 # ifndef XsunMonoServer
276 #  define XsunMonoServer          NO            /* monochrome only */
277 # endif
278 #endif /* not i386Architecture */
279
280 #if HasGcc || HasGcc2
281 # if OSMajorVersion > 4 && defined(i386Architecture)
282 #  ifndef DefaultCCOptions
283 #    define DefaultCCOptions -DNO_ASM
284 #  endif
285 # endif
286 # if HasGcc2
287 #  define SharedLibraryLoadFlags -shared
288 #  define ExtraLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
289 #  if defined(i386Architecture) || defined(SparcArchitecture)
290 #   define CcCmd                gcc
291 #  endif
292 # else
293 #  define SharedLibraryCcCmd cc
294 #  define ExtraLoadFlags -B/usr/bin/
295 #  define AllocateLocalDefines /**/
296
297 .c.o:
298         ClearmakeOSName $(CC) -c $(CFLAGS) $*.c
299
300 # endif /* HasGcc2 (else) */
301
302 #else /* not HasGcc, not HasGcc2 */
303
304 # define AllocateLocalDefines -DINCLUDE_ALLOCA_H
305
306 /* Set up compiler-dependent options for Sun C */
307
308 # if HasSunC
309 #  ifdef Sun3Architecture
310 #   ifndef DefaultCCOptions
311 #    define DefaultCCOptions -f68881 -pipe
312 #   endif
313 #  else /* not defined(Sun3Architecture) */
314 #   if OSMajorVersion < 5
315 #    ifndef DefaultCCOptions
316 #     define DefaultCCOptions -pipe
317 #    endif
318 #   else /* OSMajorVersion >= 5*/
319 #    ifndef DefaultCCOptions
320 #     define DefaultCCOptions -Xa
321 #    endif
322 #   endif       
323 #  endif        
324 # endif
325
326 # define PexCCOptions DefaultCCOptions
327
328 #endif /* HasGcc || HasGcc2 (else) */
329
330 #if HasGcc2
331 CXXDEPENDINCLUDE :sh = CcCmd -v -x c++ /dev/null -fsyntax-only \
332                        2>&1 | sed -n 's/^ \(\/.*[cg]++.*\)/-I\1/p'
333 #define CplusplusDependIncludes $(CXXDEPENDINCLUDE)
334 #endif
335
336 #if HasGcc2ForCplusplus
337 #define CplusplusCmd    g++
338 #ifndef CplusplusLibC
339 #define CplusplusLibC   -L/usr/gnu/lib -lstdc++
340 #endif
341 #endif /* HasGcc2ForCplusplus */
342
343
344 #if OSMajorVersion < 5
345 # define SharedAllocateLocalDefines -DINCLUDE_ALLOCA_H
346 # define LibraryCCOptions /* don't want special floating point */
347 #endif /* OSMajorVersion < 5 */
348
349 #if OSMajorVersion > 4
350 # include <svr4.cf>
351 #endif
352
353 #ifndef ManKeywordsTarget
354 # define ManKeywordsTarget(manpath)                                     @@\
355 man_keywords::                                                          @@\
356         catman -M $(DESTDIR)manpath -w
357 #endif
358
359 #if !defined(UsePamLibrary)
360 # if (OSMajorVersion > 5) || ((OSMajorVersion == 5) && (OSMinorVersion >= 4))
361 #  define UsePamLibrary         NO
362 # endif
363 #endif
364
365 #if (OSMajorVersion > 5) || ((OSMajorVersion == 5) && (OSMinorVersion >= 10))
366 #define SharedLibXau YES
367 #define SharedXauRev 6
368 #define SharedLibXdmcp YES
369 #define SharedXdmcpRev 6
370 #endif
371
372 #define HasMakefileSafeInclude  YES
373 #define IncludeMakefile(file)   HASH_SIGN dependencies are in .depend
374 #define DependFileName          .depend
375 #if HasSunC
376 #define DependDefines           -D__BUILTIN_VA_ARG_INCR
377 #endif
378
379 #define LdPreLib                -L/usr/X11/lib -L$(BUILDLIBDIR)
380 #define PamUnixDefines          -DPAM_NIS
381 #define TtLargePICTable         YES
382 #define DtSvcDefines            -DMULTIBYTE -DNO_REGCOMP
383 #define DtSearchDefines         -DI18N_MSG DtSvcDefines
384 #define DtWidgetDefines         DtSearchDefines
385 #define DtPrintDefines          DtSearchDefines
386
387 #ifndef CompressAllFonts
388 #define CompressAllFonts        YES
389 #endif
390
391 /* For DtHelp TIFF processing routines. */
392 #if defined(AMD64Architecture) || defined(i386Architecture)
393 #define LSBBitOrder             YES
394 #endif
395
396 #define baseDtMailDefines       \
397         -DSunOS=OSMajorVersion\#\#OSMinorVersion -DMMAP_NORESERVE -DSPRO_V2
398 #ifndef i386Architecture
399 # define DtMailDefines          baseDtMailDefines
400 #else
401 # define DtMailDefines          -DBIG_ENDIAN baseDtMailDefines
402 #endif
403
404 #define ArchitectureDefines     -DSUN_ARCHITECTURE
405
406 #define TtClientExtraLibs       ExtraLibraries -ldl -lintl
407
408 #ifndef TopMotifInclude
409 # define TopMotifInclude        /usr/X11/include
410 #endif
411
412 #define ShlibExportListOpt(filename)    -M filename
413
414 #define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB)
415 #define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
416
417 #define CdeProjectDefines \
418         -DMULTIBYTE -DNLS16 -DMESSAGE_CAT -D__EXTENSIONS__ \
419         -DOSMAJORVERSION=OSMajorVersion -DOSMINORVERSION=OSMinorVersion