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 2.x.
34 * === C++ Compiler Setup ==========================================
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.
42 * In any case, you may also need to set CplusplusDependIncludes.
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.
51 # if (HasGcc || HasGcc2 || OSMajorVersion < 5)
59 # ifndef CCompilerMajorVersion
60 # define CCompilerMajorVersion DefaultSunProCCompilerMajorVersion
62 # ifndef CCompilerMinorVersion
63 # define CCompilerMinorVersion DefaultSunProCCompilerMinorVersion
65 XCOMM SunPro C CCompilerMajorVersion./**/CCompilerMinorVersion
70 # define HasCplusplus YES
72 # ifndef CplusplusCompilerMajorVersion
73 # ifdef DefaultSunProCplusplusCompilerMajorVersion
74 # define CplusplusCompilerMajorVersion DefaultSunProCplusplusCompilerMajorVersion
76 # define CplusplusCompilerMajorVersion 3
79 # ifndef CplusplusCompilerMinorVersion
80 # ifdef DefaultSunProCplusplusCompilerMinorVersion
81 # define CplusplusCompilerMinorVersion DefaultSunProCplusplusCompilerMinorVersion
83 # define CplusplusCompilerMinorVersion 0
86 XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
90 # ifndef CCompilerMajorVersion
91 # define CCompilerMajorVersion DefaultGnuCCompilerMajorVersion
93 # ifndef CCompilerMinorVersion
94 # define CCompilerMinorVersion DefaultGnuCCompilerMinorVersion
96 XCOMM Gnu C CCompilerMajorVersion./**/CCompilerMinorVersion
99 #if HasGcc2ForCplusplus
100 # ifndef HasCplusplus
101 # define HasCplusplus YES
103 # ifndef CplusplusCompilerMajorVersion
104 # ifdef DefaultGnuCplusplusCompilerMajorVersion
105 # define CplusplusCompilerMajorVersion DefaultGnuCplusplusCompilerMajorVersion
107 # define CplusplusCompilerMajorVersion 4
110 # ifndef CplusplusCompilerMinorVersion
111 # ifdef DefaultGnuCplusplusCompilerMinorVersion
112 # define CplusplusCompilerMinorVersion DefaultGnuCplusplusCompilerMinorVersion
114 # define CplusplusCompilerMinorVersion 6
117 XCOMM Gnu C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
121 #if OSMajorVersion > 4
122 #define MkdirHierCmd mkdir -p
125 #ifndef OptimizedCDebugFlags
126 # define OptimizedCDebugFlags -O2
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
136 #if OSMajorVersion == 4
137 # if OSMinorVersion == 1
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
146 #ifdef i386Architecture
147 # if OSMajorVersion > 4
148 # define ServerExtraDefines AllocateLocalDefines XFree86ServerDefines
149 # define ServerOSDefines XFree86ServerOSDefines
151 # define ServerExtraDefines AllocateLocalDefines
152 # define ServerOSDefines -DDDXOSINIT
155 # define ServerExtraDefines AllocateLocalDefines
156 # define ServerOSDefines -DDDXOSINIT
157 # define HasPlugin YES
160 #define XkbServerDefines -DXKB_ALWAYS_USES_SOFT_REPEAT
162 #if OSMajorVersion > 4
163 #define ConnectionFlags -DTCPCONN -DUNIXCONN -DLOCALCONN
166 * Assume /opt/solarisstudio/bin/ contains symlinks to the appropriate tools
169 # define CcCmd /opt/solarisstudio/bin/cc
172 # define CplusplusCmd /opt/solarisstudio/bin/CC
174 #ifndef CplusplusFilt
175 # define CplusplusFilt /opt/solarisstudio/bin/c++filt
177 #ifndef CplusplusLibC
178 #define CplusplusLibC -L/opt/solarisstudio/lib -lCrun
180 #ifndef OptimizedCplusplusDebugFlags
181 # define OptimizedCplusplusDebugFlags -O2 -erroff=attrskipunsup
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
191 # define CplusplusDependIncludes -I/opt/SUNWspro/SC2.0.1/include/CC
195 # if HasSunC && (CCompilerMajorVersion < 3)
196 # define BootstrapCFlags -DSVR4
198 # define BootstrapCFlags /* none needed */
200 # ifndef XawI18nDefines
201 # if OSMinorVersion < 4
202 # define XawI18nDefines -DHAS_WCTYPE_H -DHAS_ISW_FUNCS
204 # define XawI18nDefines -DHAS_WCHAR_H -DHAS_ISW_FUNCS
207 # if OSMinorVersion > 10
208 # define InstallCmd /usr/bin/ginstall
209 # elif OSMinorVersion > 3
210 # define InstallCmd /usr/ucb/install
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
219 # define StandardDefines -Dsun -DSVR4
220 # define ToolkitStringsABIOptions -sparcabi
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
229 # define SystemMTDefines -D_REENTRANT
230 # define ThreadsLibraries -lthread
232 # if HasSunCplusplus && CplusplusCompilerMajorVersion > 3
233 # define ThreadsCplusplusCompileFlags -mt
235 # define CplusplusSystemMTDefines -D_REENTRANT
236 # define ThreadsCplusplusLibraries -lthread
238 # endif /* OSMinorVersion > 1 */
239 # ifndef UseExportLists
240 # define UseExportLists NO
243 # define InstKmemFlags -g sys -m 2711
244 # define ShLibIncludeFile <sunLib.tmpl>
246 * Set flags for position independent code before including sv4Lib.rules
247 * if the compiler in use doesn't use standard SVR4 flags
250 # define PositionIndependentCFlags -Kpic
251 # define LargePositionIndependentCFlags -KPIC
254 # define PositionIndependentCplusplusFlags -pic
255 # define LargePositionIndependentCplusplusFlags -PIC
257 #else /* not OSMajorVersion > 4 */
258 #define InstKmemFlags -g kmem -m 2711
259 #include <sunLib.rules>
260 #endif /* OSMajorVersion > 4 (else) */
262 #define BuildLibPathVar LD_LIBRARY_PATH
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 */
273 # define XsunServer YES /* color and mono, 8 bit only */
275 # ifndef XsunMonoServer
276 # define XsunMonoServer NO /* monochrome only */
278 #endif /* not i386Architecture */
280 #if HasGcc || HasGcc2
281 # if OSMajorVersion > 4 && defined(i386Architecture)
282 # ifndef DefaultCCOptions
283 # define DefaultCCOptions -DNO_ASM
287 # define SharedLibraryLoadFlags -shared
288 # define ExtraLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
289 # if defined(i386Architecture) || defined(SparcArchitecture)
293 # define SharedLibraryCcCmd cc
294 # define ExtraLoadFlags -B/usr/bin/
295 # define AllocateLocalDefines /**/
298 ClearmakeOSName $(CC) -c $(CFLAGS) $*.c
300 # endif /* HasGcc2 (else) */
302 #else /* not HasGcc, not HasGcc2 */
304 # define AllocateLocalDefines -DINCLUDE_ALLOCA_H
306 /* Set up compiler-dependent options for Sun C */
309 # ifdef Sun3Architecture
310 # ifndef DefaultCCOptions
311 # define DefaultCCOptions -f68881 -pipe
313 # else /* not defined(Sun3Architecture) */
314 # if OSMajorVersion < 5
315 # ifndef DefaultCCOptions
316 # define DefaultCCOptions -pipe
318 # else /* OSMajorVersion >= 5*/
319 # ifndef DefaultCCOptions
320 # define DefaultCCOptions -Xa
326 # define PexCCOptions DefaultCCOptions
328 #endif /* HasGcc || HasGcc2 (else) */
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)
336 #if HasGcc2ForCplusplus
337 #define CplusplusCmd g++
338 #ifndef CplusplusLibC
339 #define CplusplusLibC -L/usr/gnu/lib -lstdc++
341 #endif /* HasGcc2ForCplusplus */
344 #if OSMajorVersion < 5
345 # define SharedAllocateLocalDefines -DINCLUDE_ALLOCA_H
346 # define LibraryCCOptions /* don't want special floating point */
347 #endif /* OSMajorVersion < 5 */
349 #if OSMajorVersion > 4
353 #ifndef ManKeywordsTarget
354 # define ManKeywordsTarget(manpath) @@\
356 catman -M $(DESTDIR)manpath -w
359 #if !defined(UsePamLibrary)
360 # if (OSMajorVersion > 5) || ((OSMajorVersion == 5) && (OSMinorVersion >= 4))
361 # define UsePamLibrary NO
365 #if (OSMajorVersion > 5) || ((OSMajorVersion == 5) && (OSMinorVersion >= 10))
366 #define SharedLibXau YES
367 #define SharedXauRev 6
368 #define SharedLibXdmcp YES
369 #define SharedXdmcpRev 6
372 #define HasMakefileSafeInclude YES
373 #define IncludeMakefile(file) HASH_SIGN dependencies are in .depend
374 #define DependFileName .depend
376 #define DependDefines -D__BUILTIN_VA_ARG_INCR
379 /* Use installed X11 includes/libs */
380 #define UseInstalledX11 YES
382 #define LdPreLib -L$(BUILDLIBDIR)
383 #define PamUnixDefines -DPAM_NIS
384 #define TtLargePICTable YES
385 #define DtSvcDefines -DMULTIBYTE -DNO_REGCOMP
386 #define DtSearchDefines -DI18N_MSG DtSvcDefines
387 #define DtWidgetDefines DtSearchDefines
388 #define DtPrintDefines DtSearchDefines
390 #ifndef CompressAllFonts
391 #define CompressAllFonts YES
394 /* For DtHelp TIFF processing routines. */
395 #if defined(AMD64Architecture) || defined(i386Architecture)
396 #define LSBBitOrder YES
399 #define baseDtMailDefines \
400 -DSunOS=OSMajorVersion\#\#OSMinorVersion -DMMAP_NORESERVE -DSPRO_V2
401 #ifndef i386Architecture
402 # define DtMailDefines baseDtMailDefines
404 # define DtMailDefines -DBIG_ENDIAN baseDtMailDefines
407 #define ArchitectureDefines -DSUN_ARCHITECTURE
409 #define TtClientExtraLibs ExtraLibraries -ldl -lintl
411 #ifndef TopMotifInclude
412 # define TopMotifInclude $(MPROJECTROOT)/include
415 #define ShlibExportListOpt(filename) -M filename
417 #define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB)
418 #define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
420 #define CdeProjectDefines \
421 -DMULTIBYTE -DNLS16 -DMESSAGE_CAT -D__EXTENSIONS__ \
422 -DOSMAJORVERSION=OSMajorVersion -DOSMINORVERSION=OSMinorVersion