Merge branch 'master' of ssh://git.code.sf.net/p/cdesktopenv/code
[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 /* To reduce the number of warnings generated by X11 and Motif headers that
4    dislike -ansi and -pedantic we can include them with -isystem instead of
5    -I, this tells GCC to treat them as system includes out of our control */
6 #define TopXInclude -isystem$(TOP)/imports/x11/include
7
8 #ifndef OSName
9 #define OSName                  DefaultOSName
10 #endif
11 #ifndef OSMajorVersion
12 #define OSMajorVersion          DefaultOSMajorVersion
13 #endif
14 #ifndef OSMinorVersion
15 #define OSMinorVersion          DefaultOSMinorVersion
16 #endif
17 #ifndef OSTeenyVersion
18 #define OSTeenyVersion          DefaultOSTeenyVersion
19 #endif
20
21 #ifndef LinuxDistribution 
22 #define LinuxDistribution       DefaultLinuxDistribution
23 /*
24   Add "#define LinuxDistribution Linux<mumble>" to your site.def or host.def.
25   Currently only LinuxSuSE will be figured out automatically.
26   Valid values are (from the list at www.linux.org in Oct. '97):
27     LinuxUnknown    (0)
28     LinuxSuSE       (1)
29     LinuxCaldera    (2)
30     LinuxCraftworks (3)
31     LinuxDebian     (4)
32     LinuxInfoMagic  (5)
33     LinuxKheops     (6)
34     LinuxPro        (7)
35     LinuxRedHat     (8)
36     LinuxSlackware  (9)
37     LinuxTurbo      (10)
38     LinuxWare       (11)
39     LinuxYggdrasil  (12)
40 */
41 #endif
42 #ifndef LinuxCLibMajorVersion
43 #define LinuxCLibMajorVersion   DefaultLinuxCLibMajorVersion
44 #endif
45 #ifndef LinuxCLibMinorVersion
46 #define LinuxCLibMinorVersion   DefaultLinuxCLibMinorVersion
47 #endif
48 #ifndef LinuxCLibTeenyVersion
49 #define LinuxCLibTeenyVersion   DefaultLinuxCLibTeenyVersion
50 #endif
51 #ifndef LinuxBinUtilsMajorVersion
52 #define LinuxBinUtilsMajorVersion       DefaultLinuxBinUtilsMajorVersion
53 #endif
54
55 XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
56 XCOMM libc:  (LinuxCLibMajorVersion./**/LinuxCLibMinorVersion./**/LinuxCLibTeenyVersion)
57 XCOMM binutils:  (LinuxBinUtilsMajorVersion)
58
59 #ifndef UseElfFormat
60 #if OSMajorVersion > 1 || (OSMajorVersion == 1 && OSMinorVersion > 1)
61 #define UseElfFormat            YES
62 #else
63 #define UseElfFormat            NO
64 #error "Only ELF format is supported on linux"
65 #endif
66 #endif
67 #define BuildLibPathVar         LD_LIBRARY_PATH
68 #define HasGcc                  YES
69 #define HasGcc2                 YES
70 #define HasGcc2ForCplusplus     YES
71 #define GccUsesGas              YES
72 #define UseGas                  YES
73 #define GnuCpp                  YES
74 #define HasShadowPasswd         YES
75 #define HasPutenv               YES
76 #define HasShm                  YES
77 #define HasSockets              YES
78 #if (LinuxDistribution == LinuxRedHat)
79 #define HasZlib                 YES
80 #endif
81
82 #define AvoidNullMakeCommand    YES
83 #define StripInstalledPrograms  YES
84 #define CompressAllFonts        YES
85 #define Malloc0ReturnsNull      YES
86 #define NeedConstPrototypes     YES
87 #define NeedFunctionPrototypes  YES
88 #define NeedNestedPrototypes    YES
89 #define NeedVarargsPrototypes   YES
90 #define NeedWidePrototypes      NO
91 #define SetTtyGroup             YES
92
93 #define CcCmd                   gcc -g -pipe
94 #define CplusplusCmd            g++ -g -pipe -fpermissive
95 #define AsCmd                   as
96 #define LdCmd                   ld
97
98 #define CplusplusLibC           -lstdc++
99 #define AsmDefines              -D__ELF__
100
101 #define MkdirHierCmd            mkdir -p
102 #define CppCmd                  /lib/cpp
103 #if OSMajorVersion >= 2
104 #define YaccCmd                 yacc
105 #else
106 #define YaccCmd                 bison -y
107 #endif
108 #define LexCmd                  flex -l
109 #define LexLib                  -lfl
110 #define PreProcessCmd           CcCmd -E
111 #define PostIncDir              DefaultGccIncludeDir
112 #define LdCombineFlags          -r
113 #define XawI18nDefines          -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
114 #define HasWChar32              YES
115 #define StandardCppDefines      -traditional StandardDefines
116 #define ExtensionOSDefines      -DXTESTEXT1
117
118 #define LinuxLocaleDefines      /**/
119
120 #if LinuxCLibMajorVersion < 6
121 # define LinuxSourceDefines     -D_POSIX_SOURCE \
122                                 -D_BSD_SOURCE -D_SVID_SOURCE LinuxLocaleDefines
123 # ifndef HasLibCrypt
124 #  define HasLibCrypt           NO
125 # endif
126
127 #else
128 # define LinuxSourceDefines     -D_POSIX_C_SOURCE=199309L \
129                                 -D_POSIX_SOURCE \
130                                 -D_BSD_SOURCE -D_SVID_SOURCE -D_XOPEN_SOURCE \
131                                 -D__NO_STRING_INLINES -D__NO_MATH_INLINES \
132                                 LinuxLocaleDefines
133 # define HasPosixThreads        YES
134 # define ThreadedX              YES
135 # define HasThreadSafeAPI       YES
136 # define ThreadsLibraries       -lpthread
137 # define SystemMTDefines                -D_REENTRANT
138 # ifndef HasLibCrypt
139 #  define HasLibCrypt           YES
140 # endif
141 #endif
142
143 #ifdef SparcArchitecture
144 #define LinuxMachineDefines -Dsparc
145
146 #if UseElfFormat
147 #define HasPlugin               YES
148 #define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
149 #endif
150 #endif /* SparcArchitecture */
151
152 #ifdef ARMArchitecture
153 #define LinuxMachineDefines -D__arm__
154 #define LSBBitOrder             YES
155
156 #if UseElfFormat
157 #define HasPlugin               YES
158 #define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
159 #endif 
160 #endif /* ARMArchitecture */
161
162 #ifdef i386Architecture
163 #define OptimizedCDebugFlags    DefaultGcc2i386Opt
164 #define LinuxMachineDefines     -D__i386__
165 /* For DtHelp TIFF processing routines. */
166 #define LSBBitOrder             YES
167
168 #if UseElfFormat
169 #define HasPlugin               YES
170 #define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
171 #endif
172 /* add this to void screenfuls of warnings from makedepend */
173 #define DependFlags -I/usr/include/i386-linux-gnu
174 #endif /* i386Architecture */
175
176 #ifdef AMD64Architecture
177 #define OptimizedCDebugFlags    DefaultGcc2i386Opt
178 #define LinuxMachineDefines     -D__x86_64__ 
179 /* For DtHelp TIFF processing routines. */
180 #define LSBBitOrder             YES
181
182 #if UseElfFormat
183 #define HasPlugin               YES
184 #define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
185 #endif
186 /* add this to void screenfuls of warnings from makedepend */
187 #define DependFlags -I/usr/include/x86_64-linux-gnu
188 #endif /* AMD64Architecture */
189
190 #ifdef PpcArchitecture
191 #define OptimizedCDebugFlags    -O2
192 #define LinuxMachineDefines     -D__powerpc__
193 #endif /* PpcArchitecture */
194
195 #ifdef AlphaArchitecture
196 #define OptimizedCDebugFlags    -O2
197 #define LinuxMachineDefines     -D__alpha__
198 #endif /* AlphaArchitecture */
199
200 #ifdef Mc68020Architecture
201 #define OptimizedCDebugFlags    -O2
202 #define LinuxMachineDefines     -D__mc68000__
203 #define StandardCppDefines      -traditional 
204 #endif /* Mc68020Architecture */
205
206 #define StandardDefines         -Dlinux LinuxMachineDefines LinuxSourceDefines
207
208 #define ConnectionFlags         -DUNIXCONN -DTCPCONN
209
210 XCOMM This is needed for CDE currently
211 #define CplusplusStandardDefines StandardDefines 
212
213 /* Some of these man page defaults are overriden in the above OS sections */
214 #ifndef ManSuffix
215 # define ManSuffix      1x
216 #endif
217 #ifndef ManDir
218 # define ManDir         $(MANSOURCEPATH)1
219 #endif
220 #ifndef LibManSuffix
221 # define LibManSuffix   3x
222 #endif
223 #ifndef LibmanDir
224 # define LibmanDir      $(MANSOURCEPATH)3
225 #endif
226 #ifndef FileManSuffix
227 # define FileManSuffix  5x
228 #endif
229 #ifndef FileManDir
230 # define FileManDir     $(MANSOURCEPATH)5
231 #endif
232
233 #define ArchitectureDefines     -DLINUX_ARCHITECTURE
234
235 #define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB)
236 #define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
237
238 #include <lnxLib.rules>
239 #include <xfree86.cf>