1 XCOMM platform: $TOG: sun.cf /main/176 1997/12/09 17:27:51 kaleb $
4 # define OSName DefaultOSName
7 # define OSMajorVersion DefaultOSMajorVersion
10 # define OSMinorVersion DefaultOSMinorVersion
12 #ifndef OSTeenyVersion
13 # define OSTeenyVersion DefaultOSTeenyVersion
15 XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
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
23 * === C Compiler Setup ==========================================
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.
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.
35 * === C++ Compiler Setup ==========================================
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.
43 * In any case, you may also need to set CplusplusDependIncludes.
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.
52 # if (HasGcc || HasGcc2 || OSMajorVersion < 5)
60 # ifndef CCompilerMajorVersion
61 # define CCompilerMajorVersion DefaultSunProCCompilerMajorVersion
63 # ifndef CCompilerMinorVersion
64 # define CCompilerMinorVersion DefaultSunProCCompilerMinorVersion
66 XCOMM SunPro C CCompilerMajorVersion./**/CCompilerMinorVersion
71 # define HasCplusplus YES
73 # ifndef CplusplusCompilerMajorVersion
74 # ifdef DefaultSunProCplusplusCompilerMajorVersion
75 # define CplusplusCompilerMajorVersion DefaultSunProCplusplusCompilerMajorVersion
77 # define CplusplusCompilerMajorVersion 3
80 # ifndef CplusplusCompilerMinorVersion
81 # ifdef DefaultSunProCplusplusCompilerMinorVersion
82 # define CplusplusCompilerMinorVersion DefaultSunProCplusplusCompilerMinorVersion
84 # define CplusplusCompilerMinorVersion 0
87 XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
91 # ifndef CCompilerMajorVersion
92 # define CCompilerMajorVersion DefaultGnuCCompilerMajorVersion
94 # ifndef CCompilerMinorVersion
95 # define CCompilerMinorVersion DefaultGnuCCompilerMinorVersion
97 XCOMM Gnu C CCompilerMajorVersion./**/CCompilerMinorVersion
100 #if HasGcc2ForCplusplus
101 # ifndef HasCplusplus
102 # define HasCplusplus YES
104 # ifndef CplusplusCompilerMajorVersion
105 # ifdef DefaultGnuCplusplusCompilerMajorVersion
106 # define CplusplusCompilerMajorVersion DefaultGnuCplusplusCompilerMajorVersion
108 # define CplusplusCompilerMajorVersion 4
111 # ifndef CplusplusCompilerMinorVersion
112 # ifdef DefaultGnuCplusplusCompilerMinorVersion
113 # define CplusplusCompilerMinorVersion DefaultGnuCplusplusCompilerMinorVersion
115 # define CplusplusCompilerMinorVersion 6
118 XCOMM Gnu C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
122 #if OSMajorVersion > 4
123 #define MkdirHierCmd mkdir -p
126 #ifndef OptimizedCDebugFlags
127 # define OptimizedCDebugFlags -O2
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
137 #if OSMajorVersion == 4
138 # if OSMinorVersion == 1
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
147 #ifdef i386Architecture
148 # if OSMajorVersion > 4
149 # define ServerExtraDefines AllocateLocalDefines XFree86ServerDefines
150 # define ServerOSDefines XFree86ServerOSDefines
152 # define ServerExtraDefines AllocateLocalDefines
153 # define ServerOSDefines -DDDXOSINIT
156 # define ServerExtraDefines AllocateLocalDefines
157 # define ServerOSDefines -DDDXOSINIT
158 # define HasPlugin YES
161 #define XkbServerDefines -DXKB_ALWAYS_USES_SOFT_REPEAT
163 #if OSMajorVersion > 4
164 #define ConnectionFlags -DTCPCONN -DUNIXCONN -DLOCALCONN
167 * Assume /opt/solarisstudio/bin/ contains symlinks to the appropriate tools
170 # define CcCmd /opt/solarisstudio/bin/cc
173 # define CplusplusCmd /opt/solarisstudio/bin/CC
175 #ifndef CplusplusFilt
176 # define CplusplusFilt /opt/solarisstudio/bin/c++filt
178 #ifndef CplusplusLibC
179 #define CplusplusLibC -L/opt/solarisstudio/lib -lCrun
181 #ifndef OptimizedCplusplusDebugFlags
182 # define OptimizedCplusplusDebugFlags -O2 -erroff=attrskipunsup
184 #ifndef CplusplusDependIncludes
185 #if CplusplusCompilerMajorVersion > 3
186 # define CplusplusDependIncludes -I/opt/solarisstudio/prod/include/CC -I/opt/solarisstudio/prod/include/CC/Cstd -I/opt/solarisstudio/prod/include/CC/std
187 #elif CplusplusCompilerMajorVersion > 2
188 # define CplusplusDependIncludes -I/opt/SUNWspro/SC3.0/include/CC
190 # define CplusplusDependIncludes -I/opt/SUNWspro/SC2.0.1/include/CC
194 # if HasSunC && (CCompilerMajorVersion < 3)
195 # define BootstrapCFlags -DSVR4
197 # define BootstrapCFlags /* none needed */
199 # ifndef XawI18nDefines
200 # if OSMinorVersion < 4
201 # define XawI18nDefines -DHAS_WCTYPE_H -DHAS_ISW_FUNCS
203 # define XawI18nDefines -DHAS_WCHAR_H -DHAS_ISW_FUNCS
206 # if OSMinorVersion > 10
207 # define InstallCmd /usr/bin/ginstall
208 # elif OSMinorVersion > 3
209 # define InstallCmd /usr/ucb/install
211 # if defined(i386Architecture)
212 # define StandardDefines -Dsun -Di386 -DSVR4 -D__i386
213 # define ToolkitStringsABIOptions -intelabi
214 # elif defined(SparcArchitecture)
215 # define StandardDefines -Dsun -Dsparc -DSVR4 -D__sparc
216 # define ToolkitStringsABIOptions -sparcabi
218 # define StandardDefines -Dsun -DSVR4
219 # define ToolkitStringsABIOptions -sparcabi
221 # define ExtraLibraries -lsocket -lnsl
222 # if OSMinorVersion > 1
223 # define ThreadedX YES
224 # define MTSafeAPIDefines -DXUSE_MTSAFE_API -DXUSE_NETDB_R_API
225 # if HasSunC && CCompilerMajorVersion > 2
226 # define ThreadsCompileFlags -mt
228 # define SystemMTDefines -D_REENTRANT
229 # define ThreadsLibraries -lthread
231 # if HasSunCplusplus && CplusplusCompilerMajorVersion > 3
232 # define ThreadsCplusplusCompileFlags -mt
234 # define CplusplusSystemMTDefines -D_REENTRANT
235 # define ThreadsCplusplusLibraries -lthread
237 # endif /* OSMinorVersion > 1 */
238 # ifndef UseExportLists
239 # define UseExportLists NO
242 # define InstKmemFlags -g sys -m 2711
243 # define ShLibIncludeFile <sunLib.tmpl>
245 * Set flags for position independent code before including sv4Lib.rules
246 * if the compiler in use doesn't use standard SVR4 flags
249 # define PositionIndependentCFlags -Kpic
250 # define LargePositionIndependentCFlags -KPIC
253 # define PositionIndependentCplusplusFlags -pic
254 # define LargePositionIndependentCplusplusFlags -PIC
256 #else /* not OSMajorVersion > 4 */
257 #define InstKmemFlags -g kmem -m 2711
258 #include <sunLib.rules>
259 #endif /* OSMajorVersion > 4 (else) */
261 #define BuildLibPathVar LD_LIBRARY_PATH
264 #define HasSecureRPC YES
265 #define SetTtyGroup YES
266 #define HasPutenv YES
267 #ifndef i386Architecture
268 # ifndef Xsun24Server
269 # define Xsun24Server NO /* color, mono, multiple depths */
272 # define XsunServer YES /* color and mono, 8 bit only */
274 # ifndef XsunMonoServer
275 # define XsunMonoServer NO /* monochrome only */
277 #endif /* not i386Architecture */
279 #if HasGcc || HasGcc2
280 # if OSMajorVersion > 4 && defined(i386Architecture)
281 # ifndef DefaultCCOptions
282 # define DefaultCCOptions -DNO_ASM
286 # define SharedLibraryLoadFlags -shared
287 # define ExtraLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
288 # if defined(i386Architecture) || defined(SparcArchitecture)
292 # define SharedLibraryCcCmd cc
293 # define ExtraLoadFlags -B/usr/bin/
294 # define AllocateLocalDefines /**/
297 ClearmakeOSName $(CC) -c $(CFLAGS) $*.c
299 # endif /* HasGcc2 (else) */
301 #else /* not HasGcc, not HasGcc2 */
303 # define AllocateLocalDefines -DINCLUDE_ALLOCA_H
305 /* Set up compiler-dependent options for Sun C */
308 # ifdef Sun3Architecture
309 # ifndef DefaultCCOptions
310 # define DefaultCCOptions -f68881 -pipe
312 # else /* not defined(Sun3Architecture) */
313 # if OSMajorVersion < 5
314 # ifndef DefaultCCOptions
315 # define DefaultCCOptions -pipe
317 # else /* OSMajorVersion >= 5*/
318 # ifndef DefaultCCOptions
319 # define DefaultCCOptions -Xa
325 # define PexCCOptions DefaultCCOptions
327 #endif /* HasGcc || HasGcc2 (else) */
330 CXXDEPENDINCLUDE :sh = CcCmd -v -x c++ /dev/null -fsyntax-only \
331 2>&1 | sed -n 's/^ \(\/.*[cg]++.*\)/-I\1/p'
332 #define CplusplusDependIncludes $(CXXDEPENDINCLUDE)
335 #if HasGcc2ForCplusplus
336 #define CplusplusCmd g++
337 #ifndef CplusplusLibC
338 #define CplusplusLibC -L/usr/gnu/lib -lstdc++
340 #endif /* HasGcc2ForCplusplus */
343 #if OSMajorVersion < 5
344 # define SharedAllocateLocalDefines -DINCLUDE_ALLOCA_H
345 # define LibraryCCOptions /* don't want special floating point */
346 #endif /* OSMajorVersion < 5 */
348 #if OSMajorVersion > 4
352 #ifndef ManKeywordsTarget
353 # define ManKeywordsTarget(manpath) @@\
355 catman -M $(DESTDIR)manpath -w
358 #if !defined(UsePamLibrary)
359 # if (OSMajorVersion > 5) || ((OSMajorVersion == 5) && (OSMinorVersion >= 4))
360 # define UsePamLibrary NO
364 #if (OSMajorVersion > 5) || ((OSMajorVersion == 5) && (OSMinorVersion >= 10))
365 #define SharedLibXau YES
366 #define SharedXauRev 6
367 #define SharedLibXdmcp YES
368 #define SharedXdmcpRev 6
371 #define DependFileName .depend
373 #define DependDefines -D__BUILTIN_VA_ARG_INCR
376 #define LdPreLib -L/usr/X11/lib -L$(BUILDLIBDIR)
377 #define PamUnixDefines -DPAM_NIS
378 #define TtLargePICTable YES
379 #define DtSvcDefines -DMULTIBYTE -DNO_REGCOMP
380 #define DtSearchDefines -DI18N_MSG DtSvcDefines
381 #define DtWidgetDefines DtSearchDefines
382 #define DtPrintDefines DtSearchDefines
384 #ifndef CompressAllFonts
385 #define CompressAllFonts YES
388 /* For DtHelp TIFF processing routines. */
389 #if defined(AMD64Architecture) || defined(i386Architecture)
390 #define LSBBitOrder YES
393 #define baseDtMailDefines \
394 -DSunOS=OSMajorVersion\#\#OSMinorVersion -DMMAP_NORESERVE -DSPRO_V2
395 #ifndef i386Architecture
396 # define DtMailDefines baseDtMailDefines
398 # define DtMailDefines -DBIG_ENDIAN baseDtMailDefines
401 #define ArchitectureDefines -DSUN_ARCHITECTURE
403 #define TtClientExtraLibs ExtraLibraries -ldl -lintl
405 #ifndef TopMotifInclude
406 # define TopMotifInclude /usr/X11/include
409 #define ShlibExportListOpt(filename) -M filename
411 #define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB)
412 #define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
414 #define CdeProjectDefines \
415 -DMULTIBYTE -DNLS16 -DMESSAGE_CAT -D__EXTENSIONS__ \
416 -DOSMAJORVERSION=OSMajorVersion -DOSMINORVERSION=OSMinorVersion