a93176ad4c83934412593cd7860584244307cd7b
[oweals/cde.git] / cde / config / cf / linux.cf
1 XCOMM platform:  $TOG: linux.cf /main/47 1998/04/17 11:32:51 mgreess $
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
16 #ifndef LinuxDistribution 
17 #define LinuxDistribution       DefaultLinuxDistribution
18 /*
19   Add "#define LinuxDistribution Linux<mumble>" to your site.def or host.def.
20   Currently only LinuxSuSE will be figured out automatically.
21   Valid values are (from the list at www.linux.org in Oct. 1997):
22     LinuxUnknown    (0)
23     LinuxSuSE       (1)
24     LinuxCaldera    (2)
25     LinuxCraftworks (3)
26     LinuxDebian     (4)
27     LinuxInfoMagic  (5)
28     LinuxKheops     (6)
29     LinuxPro        (7)
30     LinuxRedHat     (8)
31     LinuxSlackware  (9)
32     LinuxTurbo      (10)
33     LinuxWare       (11)
34     LinuxYggdrasil  (12)
35 */
36 #endif
37
38 #ifndef DefaultLinuxCLibMajorVersion
39 # define DefaultLinuxCLibMajorVersion    6
40 #endif
41 #ifndef DefaultLinuxCLibMinorVersion
42 # define DefaultLinuxCLibMinorVersion    0
43 #endif
44 #ifndef DefaultLinuxCLibTeenyVersion
45 # define DefaultLinuxCLibTeenyVersion    0
46 #endif
47
48 #ifndef LinuxCLibMajorVersion
49 # define LinuxCLibMajorVersion           DefaultLinuxCLibMajorVersion
50 #endif
51 #ifndef LinuxCLibMinorVersion
52 # define LinuxCLibMinorVersion           DefaultLinuxCLibMinorVersion
53 #endif
54 #ifndef LinuxCLibTeenyVersion
55 # define LinuxCLibTeenyVersion           DefaultLinuxCLibTeenyVersion
56 #endif
57
58 #ifndef LinuxBinUtilsMajorVersion
59 # define LinuxBinUtilsMajorVersion       DefaultLinuxBinUtilsMajorVersion
60 #endif
61
62 XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
63 XCOMM libc:  (LinuxCLibMajorVersion./**/LinuxCLibMinorVersion./**/LinuxCLibTeenyVersion)
64 XCOMM binutils:  (LinuxBinUtilsMajorVersion)
65
66 #ifndef UseElfFormat
67 # if OSMajorVersion > 1 || (OSMajorVersion == 1 && OSMinorVersion > 1)
68 #  define UseElfFormat          YES
69 # else
70 #  define UseElfFormat          NO
71 #  error "Only ELF format is supported on linux"
72 # endif
73 #endif
74
75 #define BuildLibPathVar         LD_LIBRARY_PATH
76 #define HasGcc                  YES
77 #define HasGcc2                 YES
78 #define HasGcc2ForCplusplus     YES
79 #define GccUsesGas              YES
80 #define UseGas                  YES
81 #define GnuCpp                  YES
82 #define HasShadowPasswd         YES
83 #define HasPutenv               YES
84 #define HasShm                  YES
85 #define HasSockets              YES
86
87 #define HasMakefileSafeInclude  YES
88 #define DependFileName          .depend
89 #define DependCmd               $(CC) -E -MM -MG
90 #define M4Cmd                   /usr/bin/m4
91
92 #ifdef IncludeMakefile
93 # undef IncludeMakefile
94 #endif
95
96 #define IncludeMakefile(file)   -include file
97
98 #if (LinuxDistribution == LinuxRedHat)
99 # define HasZlib                YES
100 #endif
101
102 #define AvoidNullMakeCommand    YES
103 #define StripInstalledPrograms  NO
104 #define CompressAllFonts        YES
105 #define Malloc0ReturnsNull      YES
106 #define NeedConstPrototypes     YES
107 #define NeedFunctionPrototypes  YES
108 #define NeedNestedPrototypes    YES
109 #define NeedVarargsPrototypes   YES
110 #define NeedWidePrototypes      NO
111 #define SetTtyGroup             YES
112
113 #define CcCmd                   gcc -g -pipe
114 #define CplusplusCmd            g++ -g -pipe
115 #define AsCmd                   as
116 #define LdCmd                   ld
117
118 #define CplusplusLibC           -lstdc++
119 #define AsmDefines              -D__ELF__
120
121 #define MkdirHierCmd            mkdir -p
122 #define CppCmd                  /lib/cpp
123 #if OSMajorVersion >= 2
124 # define YaccCmd                yacc
125 #else
126 # define YaccCmd                bison -y
127 #endif
128 #define LexCmd                  flex -l
129 #define LexLib                  -lfl
130 #define PreProcessCmd           CcCmd -E
131 #define PostIncDir              DefaultGccIncludeDir
132 #define LdCombineFlags          -r
133 #define XawI18nDefines          -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
134 #define HasWChar32              YES
135 #define StandardCppDefines      -traditional -nostdinc StandardDefines
136 #define ExtensionOSDefines      -DXTESTEXT1
137
138 #define LinuxLocaleDefines      /**/
139
140 #define DefaultCCOptions        -ansi
141
142 XCOMM Lets try XdmAuth instead of the ancient MIT/DES auth
143 #define HasXdmAuth  YES
144
145 XCOMM TIRPC is enabled by default now on Linux.  The libtirpc-dev package is
146 XCOMM required for this support.  If you cannot use tirpc for some reason,
147 XCOMM can disable it by defining HasTIRPCLib to NO in either
148 XCOMM your host.def or site.def file.  Not using the TIRPC lib will require
149 XCOMM that you run rpcbind in insecure mode (ie: with the -i option).
150 XCOMM The default is YES.
151
152 #ifndef HasTIRPCLib
153 # define HasTIRPCLib YES
154 #endif
155
156 #if HasTIRPCLib
157 TIRPCLIB = -ltirpc
158 TIRPCINC = -I/usr/include/tirpc
159 #else
160 TIRPCLIB =
161 TIRPCINC =
162 #endif
163
164 #if !defined(DefaultGcc2i386Opt)
165 # define DefaultGcc2i386Opt -O2 -fno-strict-aliasing -Wno-write-strings \
166         -Wno-unused-result
167 #endif
168
169 #if LinuxCLibMajorVersion < 6
170 # define LinuxSourceDefines     -D_POSIX_SOURCE -D_DEFAULT_SOURCE \
171                                 -D_BSD_SOURCE -D_SVID_SOURCE LinuxLocaleDefines
172 # ifndef HasLibCrypt
173 #  define HasLibCrypt           NO
174 # endif
175
176 #else
177 # define LinuxSourceDefines     -D_POSIX_SOURCE -D_DEFAULT_SOURCE \
178                                 -D_BSD_SOURCE -D_SVID_SOURCE \
179                                 -D__NO_STRING_INLINES -D__NO_MATH_INLINES \
180                                 LinuxLocaleDefines
181 # define HasPosixThreads        YES
182 # define ThreadedX              YES
183 # define HasThreadSafeAPI       YES
184 # define ThreadsLibraries       -lpthread
185 # define SystemMTDefines        -D_REENTRANT
186 # ifndef HasLibCrypt
187 #  define HasLibCrypt           YES
188 # endif
189 #endif
190
191 #ifdef SparcArchitecture
192 # define LinuxMachineDefines -Dsparc
193
194 # if UseElfFormat
195 #  define HasPlugin             YES
196 #  define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
197 # endif
198 #endif /* SparcArchitecture */
199
200 #ifdef ARMArchitecture
201 # ifndef OptimizedCDebugFlags
202 #  define OptimizedCDebugFlags  DefaultGcc2i386Opt
203 # endif
204 # define LinuxMachineDefines -D__arm__
205 # define LSBBitOrder             YES
206
207 # if UseElfFormat
208 #  define HasPlugin              YES
209 #  define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
210 # endif 
211 #endif /* ARMArchitecture */
212
213 #ifdef i386Architecture
214 # ifndef OptimizedCDebugFlags
215 #  define OptimizedCDebugFlags  DefaultGcc2i386Opt
216 # endif
217 # define LinuxMachineDefines    -D__i386__
218 /* For DtHelp TIFF processing routines. */
219 # define LSBBitOrder             YES
220
221 # if UseElfFormat
222 #  define HasPlugin             YES
223 #  define VendorHasX11R6_3libXext       YES     /* XC or XFree86 3.3.1 */
224 # endif
225 #endif /* i386Architecture */
226
227 #ifdef AMD64Architecture
228 # ifndef OptimizedCDebugFlags
229 #  define OptimizedCDebugFlags  DefaultGcc2i386Opt
230 # endif
231 # define LinuxMachineDefines    -D__x86_64__ 
232 /* For DtHelp TIFF processing routines. */
233 # define LSBBitOrder            YES
234
235 # if UseElfFormat
236 #  define HasPlugin             YES
237 #  define VendorHasX11R6_3libXext       YES     /* XC or XFree86 3.3.1 */
238 # endif
239 #endif /* AMD64Architecture */
240
241 #ifdef AArch64Architecture
242 # ifndef OptimizedCDebugFlags
243 #  define OptimizedCDebugFlags -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -fno-strict-aliasing
244 # endif
245 # define LinuxMachineDefines   -D__aarch64__
246 # define ServerOSDefines   XFree86ServerOSDefines -DDDXTIME
247 # define ServerExtraDefines    -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
248 #endif /* AArch64Architecture */
249
250
251 #ifdef PpcArchitecture
252 # ifndef OptimizedCDebugFlags
253 #  define OptimizedCDebugFlags    DefaultGcc2i386Opt
254 # endif
255 # define LinuxMachineDefines     -D__powerpc__
256 #endif /* PpcArchitecture */
257
258 #ifdef AlphaArchitecture
259 # ifndef OptimizedCDebugFlags
260 #  define OptimizedCDebugFlags  DefaultGcc2i386Opt
261 # endif
262 # define LinuxMachineDefines    -D__alpha__
263 #endif /* AlphaArchitecture */
264
265 #ifdef Mc68020Architecture
266 # ifndef OptimizedCDebugFlags
267 #  define OptimizedCDebugFlags  DefaultGcc2i386Opt
268 # endif
269 # define LinuxMachineDefines    -D__mc68000__
270 # define StandardCppDefines      -traditional 
271 #endif /* Mc68020Architecture */
272
273 #define StandardDefines         -D__linux__ LinuxMachineDefines LinuxSourceDefines
274
275 #define ConnectionFlags         -DUNIXCONN -DTCPCONN
276
277 XCOMM This is needed for CDE currently
278 #define CplusplusStandardDefines StandardDefines 
279
280 /* Some of these man page defaults are overriden in the above OS sections */
281 #ifndef ManSuffix
282 # define ManSuffix      1x
283 #endif
284 #ifndef ManDir
285 # define ManDir         $(MANSOURCEPATH)1
286 #endif
287 #ifndef LibManSuffix
288 # define LibManSuffix   3x
289 #endif
290 #ifndef LibmanDir
291 # define LibmanDir      $(MANSOURCEPATH)3
292 #endif
293 #ifndef FileManSuffix
294 # define FileManSuffix  5x
295 #endif
296 #ifndef FileManDir
297 # define FileManDir     $(MANSOURCEPATH)5
298 #endif
299
300 #define ArchitectureDefines     -DLINUX_ARCHITECTURE
301
302 #define TtClientLibs $(TTLIB) $(TIRPCLIB) $(XTOOLLIB) $(XLIB)
303
304 #define SharedTtReqs $(TIRPCLIB) $(LDPRELIBS) SharedXReqs $(CXXLIB)
305
306 #include <lnxDep.rules>
307 #include <lnxLib.rules>