linux depend: stop using makedepend, use gcc instead
[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. 1997):
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
68 #define BuildLibPathVar         LD_LIBRARY_PATH
69 #define HasGcc                  YES
70 #define HasGcc2                 YES
71 #define HasGcc2ForCplusplus     YES
72 #define GccUsesGas              YES
73 #define UseGas                  YES
74 #define GnuCpp                  YES
75 #define HasShadowPasswd         YES
76 #define HasPutenv               YES
77 #define HasShm                  YES
78 #define HasSockets              YES
79
80 #define HasMakefileSafeInclude  YES
81 #define DependFileName .depend
82 #define DependCmd $(CC) -E -MM -MG
83
84 #ifdef IncludeMakefile
85 # undef IncludeMakefile
86 #endif
87
88 #define IncludeMakefile(file) -include file
89
90 #if (LinuxDistribution == LinuxRedHat)
91 # define HasZlib                YES
92 #endif
93
94 #define AvoidNullMakeCommand    YES
95 #define StripInstalledPrograms  YES
96 #define CompressAllFonts        YES
97 #define Malloc0ReturnsNull      YES
98 #define NeedConstPrototypes     YES
99 #define NeedFunctionPrototypes  YES
100 #define NeedNestedPrototypes    YES
101 #define NeedVarargsPrototypes   YES
102 #define NeedWidePrototypes      NO
103 #define SetTtyGroup             YES
104
105 #define CcCmd                   gcc -g -pipe
106 #define CplusplusCmd            g++ -g -pipe -fpermissive
107 #define AsCmd                   as
108 #define LdCmd                   ld
109
110 #define CplusplusLibC           -lstdc++
111 #define AsmDefines              -D__ELF__
112
113 #define MkdirHierCmd            mkdir -p
114 #define CppCmd                  /lib/cpp
115 #if OSMajorVersion >= 2
116 # define YaccCmd                yacc
117 #else
118 # define YaccCmd                bison -y
119 #endif
120 #define LexCmd                  flex -l
121 #define LexLib                  -lfl
122 #define PreProcessCmd           CcCmd -E
123 #define PostIncDir              DefaultGccIncludeDir
124 #define LdCombineFlags          -r
125 #define XawI18nDefines          -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
126 #define HasWChar32              YES
127 #define StandardCppDefines      -traditional StandardDefines
128 #define ExtensionOSDefines      -DXTESTEXT1
129
130 #define LinuxLocaleDefines      /**/
131
132 XCOMM If you have the tirpc library on your system, and you have the
133 XCOMM libtirpc-dev installed, then define HasTIRPCLib to YES in either
134 XCOMM your host.def or site.def file.  Using the tirpc lib should
135 XCOMM allow running rpcbind in secure mode (ie: without the -i option).
136 XCOMM The default is NO.
137
138 #ifndef HasTIRPCLib
139 # define HasTIRPCLib NO
140 #endif
141
142 #if HasTIRPCLib
143 TIRPCLIB = -ltirpc
144 #else
145 TIRPCLIB = 
146 #endif
147
148 #if !defined(DefaultGcc2i386Opt)
149 # define DefaultGcc2i386Opt -O2 -fno-strict-aliasing
150 #endif
151
152 #if LinuxCLibMajorVersion < 6
153 # define LinuxSourceDefines     -D_POSIX_SOURCE \
154                                 -D_BSD_SOURCE -D_SVID_SOURCE LinuxLocaleDefines
155 # ifndef HasLibCrypt
156 #  define HasLibCrypt           NO
157 # endif
158
159 #else
160 # define LinuxSourceDefines     -D_POSIX_C_SOURCE=199309L \
161                                 -D_POSIX_SOURCE \
162                                 -D_BSD_SOURCE -D_SVID_SOURCE -D_XOPEN_SOURCE \
163                                 -D__NO_STRING_INLINES -D__NO_MATH_INLINES \
164                                 LinuxLocaleDefines
165 # define HasPosixThreads        YES
166 # define ThreadedX              YES
167 # define HasThreadSafeAPI       YES
168 # define ThreadsLibraries       -lpthread
169 # define SystemMTDefines                -D_REENTRANT
170 # ifndef HasLibCrypt
171 #  define HasLibCrypt           YES
172 # endif
173 #endif
174
175 #ifdef SparcArchitecture
176 # define LinuxMachineDefines -Dsparc
177
178 # if UseElfFormat
179 #  define HasPlugin             YES
180 #  define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
181 # endif
182 #endif /* SparcArchitecture */
183
184 #ifdef ARMArchitecture
185 # define LinuxMachineDefines -D__arm__
186 # define LSBBitOrder             YES
187
188 # if UseElfFormat
189 #  define HasPlugin              YES
190 #  define VendorHasX11R6_3libXext YES     /* XC or XFree86 3.3.1 */
191 # endif 
192 #endif /* ARMArchitecture */
193
194 #ifdef i386Architecture
195 # define OptimizedCDebugFlags   DefaultGcc2i386Opt
196 # define LinuxMachineDefines    -D__i386__
197 /* For DtHelp TIFF processing routines. */
198 # define LSBBitOrder             YES
199
200 # if UseElfFormat
201 #  define HasPlugin             YES
202 #  define VendorHasX11R6_3libXext       YES     /* XC or XFree86 3.3.1 */
203 # endif
204 #endif /* i386Architecture */
205
206 #ifdef AMD64Architecture
207 # define OptimizedCDebugFlags   DefaultGcc2i386Opt
208 # define LinuxMachineDefines    -D__x86_64__ 
209 /* For DtHelp TIFF processing routines. */
210 # define LSBBitOrder            YES
211
212 # if UseElfFormat
213 #  define HasPlugin             YES
214 #  define VendorHasX11R6_3libXext       YES     /* XC or XFree86 3.3.1 */
215 # endif
216 #endif /* AMD64Architecture */
217
218 #ifdef PpcArchitecture
219 # define OptimizedCDebugFlags    DefaultGcc2i386Opt
220 # define LinuxMachineDefines     -D__powerpc__
221 #endif /* PpcArchitecture */
222
223 #ifdef AlphaArchitecture
224 # define OptimizedCDebugFlags   DefaultGcc2i386Opt
225 # define LinuxMachineDefines    -D__alpha__
226 #endif /* AlphaArchitecture */
227
228 #ifdef Mc68020Architecture
229 # define OptimizedCDebugFlags   DefaultGcc2i386Opt
230 # define LinuxMachineDefines    -D__mc68000__
231 # define StandardCppDefines      -traditional 
232 #endif /* Mc68020Architecture */
233
234 #define StandardDefines         -Dlinux LinuxMachineDefines LinuxSourceDefines
235
236 #define ConnectionFlags         -DUNIXCONN -DTCPCONN
237
238 XCOMM This is needed for CDE currently
239 #define CplusplusStandardDefines StandardDefines 
240
241 /* Some of these man page defaults are overriden in the above OS sections */
242 #ifndef ManSuffix
243 # define ManSuffix      1x
244 #endif
245 #ifndef ManDir
246 # define ManDir         $(MANSOURCEPATH)1
247 #endif
248 #ifndef LibManSuffix
249 # define LibManSuffix   3x
250 #endif
251 #ifndef LibmanDir
252 # define LibmanDir      $(MANSOURCEPATH)3
253 #endif
254 #ifndef FileManSuffix
255 # define FileManSuffix  5x
256 #endif
257 #ifndef FileManDir
258 # define FileManDir     $(MANSOURCEPATH)5
259 #endif
260
261 #define ArchitectureDefines     -DLINUX_ARCHITECTURE
262
263 XCOMM different dependancy handling
264 #ifndef DependDependency
265 #define DependDependency() /**/
266 #endif
267
268 #ifdef DependTarget
269 # undef DependTarget
270 #endif
271
272 #define DependTarget()                                                  @@@@\
273 DependDependency()                                                      @@@@\
274                                                                         @@@@\
275 depend:: DependFileName                                                 @@@@\
276                                                                         @@@@\
277 DependFileName::                                                        @@@@\
278         -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) $(SRCS)) > $@
279
280 #ifdef DependTarget3
281 # undef DependTarget3
282 #endif
283
284 #define DependTarget3(srcs1,srcs2,srcs3)                                @@@@\
285 DependDependency()                                                      @@@@\
286                                                                         @@@@\
287 depend:: DependFileName                                                 @@@@\
288                                                                         @@@@\
289 DependFileName::                                                        @@@@\
290         -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) srcs1) > $@   @@@@\
291         -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) srcs2) >> $@  @@@@\
292         -RunProgram(DEPEND,$(DEPENDFLAGS) $(ALLDEFINES) $(DEPEND_DEFINES) srcs3) >> $@
293
294
295
296 #define TtClientLibs $(TTLIB) $(TIRPCLIB) $(XTOOLLIB) $(XLIB)
297 #define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
298
299 #include <lnxLib.rules>
300 #include <xfree86.cf>