sun.cf 12 KB

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