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