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