linux.cf revision 1c80d5b0
1XCOMM $XdotOrg: xc/config/cf/linux.cf,v 1.24 2005/03/06 01:05:00 branden Exp $
2XCOMM platform:  $Xorg: linux.cf,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
3
4
5
6
7
8XCOMM platform:  $XFree86: xc/config/cf/linux.cf,v 3.220 2003/12/30 22:38:33 tsi Exp $
9
10#ifndef LinuxElfDefault
11# define LinuxElfDefault	YES
12#endif
13
14#ifndef UseElfFormat
15# define UseElfFormat		LinuxElfDefault
16#endif
17
18#ifndef OSBinaryType
19# if UseElfFormat
20#  define OSBinaryType		[ELF]
21# else
22#  ifdef AlphaArchitecture
23#   define OSBinaryType		[ECOFF]
24#  else
25#   define OSBinaryType		[a.out]
26#  endif
27# endif
28#endif
29
30#ifndef OSName
31# define OSName			DefaultOSName OSBinaryType
32#endif
33
34#ifndef OSVendor
35# define OSVendor		/**/
36#endif
37#ifndef OSMajorVersion
38# define OSMajorVersion		DefaultOSMajorVersion
39#endif
40#ifndef OSMinorVersion
41# define OSMinorVersion		DefaultOSMinorVersion
42#endif
43#ifndef OSTeenyVersion
44# define OSTeenyVersion		DefaultOSTeenyVersion
45#endif
46
47#ifndef LinuxDistribution
48# define LinuxDistribution	DefaultLinuxDistribution
49/*
50  Add "#define LinuxDistribution Linux<mumble>" to your site.def or host.def.
51  Currently only LinuxSuSE, LinuxRedHat and LinuxDebian will be figured out
52  automatically.
53  Valid values are (from the list at www.linux.org in Oct. '97):
54    LinuxUnknown    (0)
55    LinuxSuSE       (1)
56    LinuxCaldera    (2)
57    LinuxCraftworks (3)
58    LinuxDebian     (4)
59    LinuxInfoMagic  (5)
60    LinuxKheops     (6)
61    LinuxPro        (7)
62    LinuxRedHat     (8)
63    LinuxSlackware  (9)
64    LinuxTurbo      (10)
65    LinuxWare       (11)
66    LinuxYggdrasil  (12)
67*/
68#endif
69#ifndef LinuxDistName
70# define LinuxDistName		DefaultLinuxDistName
71#endif
72#ifndef LinuxCLibMajorVersion
73# define LinuxCLibMajorVersion	DefaultLinuxCLibMajorVersion
74#endif
75#ifndef LinuxCLibMinorVersion
76# define LinuxCLibMinorVersion	DefaultLinuxCLibMinorVersion
77#endif
78#ifndef LinuxCLibTeenyVersion
79# define LinuxCLibTeenyVersion	DefaultLinuxCLibTeenyVersion
80#endif
81
82#ifndef HasGhostScript
83# define HasGhostScript YES
84#endif
85#ifndef BuildPDFdocs
86# define BuildPDFdocs NO
87#endif
88
89#ifndef LinuxBinUtilsMajorVersion
90# define LinuxBinUtilsMajorVersion	DefaultLinuxBinUtilsMajorVersion
91#endif
92
93XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
94XCOMM libc:	(LinuxCLibMajorVersion./**/LinuxCLibMinorVersion./**/LinuxCLibTeenyVersion)
95XCOMM binutils:	(LinuxBinUtilsMajorVersion)
96
97#if LinuxDistribution == LinuxDebian
98# if !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot
99#  define SystemManDirectory	/usr/share/man
100# endif
101# define HasPam			YES
102/* un-comment this when it is un-broken */
103/* # define JoystickSupport YES */
104# if !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot
105#  define XAppLoadDir		EtcX11Directory/app-defaults
106# define XFileSearchPathDefault	Concat4(EtcX11Directory/%L/%T/%N%C,%S:EtcX11Directory/%l/%T/%N%C,%S:EtcX11Directory/%T/%N%C,%S:EtcX11Directory/%L/%T/%N%S:EtcX11Directory/%l/%T/%N%S:EtcX11Directory/%T/%N%S):Concat4($(LIBDIR)/%L/%T/%N%C,%S:$(LIBDIR)/%l/%T/%N%C,%S:$(LIBDIR)/%T/%N%C,%S:$(LIBDIR)/%L/%T/%N%S:$(LIBDIR)/%l/%T/%N%S:$(LIBDIR)/%T/%N%S)
107/* the relative symlink created by this rule causes problems for us */
108# if defined(InstallAppDefFiles) && InstallAppDefFiles
109#  define InstallAppDefaultsLong(file,class)				@@\
110InstallNamedTarget(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
111# else
112#  define InstallAppDefaultsLong(file,class)				@@\
113InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
114# endif /* InstallAppDefFiles */
115# endif /* !defined(NothingOutsideProjectRoot) || !NothingOutsideProjectRoot */
116# define SharedLibXdmGreet	NO
117# define LinkGLToUsrInclude	NO
118# define LinkGLToUsrLib		NO
119# define SharedLibFont		NO
120# define SharedLibGlu		YES
121# define NormalLibGlu		YES
122# define FSUseSyslog		YES
123
124# define BuildLibGlxWithoutPIC  NO
125
126# define DriverManSuffix       4x
127# define DriverManDir          $(MANSOURCEPATH)4
128
129# define MiscManSuffix         7x
130# define MiscManDir            $(MANSOURCEPATH)7
131
132/*
133 *
134 *
135# define DebianMaintainer	YES
136 *
137 *
138 */
139
140# ifdef DebianMaintainer
141#  ifndef XorgCustomVersion
142#   define XorgCustomVersion		"Debian"
143#  endif
144#  ifndef BuilderEMailAddr
145#   define BuilderEMailAddr		"debian-x@lists.debian.org"
146#  endif
147#  define XFree86Devel			YES
148#  define BuildAllSpecsDocs		YES
149#  define InstallXinitConfig		YES
150#  define InstallXdmConfig		YES
151#  define InstallFSConfig		YES
152#  define DebuggableLibraries		YES
153#  define ForceNormalLib		YES
154#  define BuildSpecsDocs		YES
155#  define SpecsDocDirs			CTEXT GL ICCCM X11 Xext Xv i18n xterm
156#  define BuildRman			NO
157#  define BuildHtmlManPages		NO
158
159/* we build-depend on libfreetype6-dev (FreeType 2.x) */
160#   define BuildFreetype2Library	NO
161#   define HasFreetype2			YES
162/* m68k has no 2.4 kernel yet */
163#   ifndef Mc68020Architecture
164#    define HasLinuxInput		YES
165#   endif
166#   define HasXdmAuth			YES
167#   define HasLatex			YES
168/* at present, glide2 only works on i386 */
169#   if defined(__linux__) && defined(i386Architecture)
170#    define HasGlide2			YES
171#    define Glide2IncDir		/usr/include/glide
172#   endif /* __linux__ && i386Architecture */
173/* at present, glide3 only works on alpha, amd64, i386 and ia64 */
174#   if defined(__linux__) && (defined(i386Architecture) || \
175       defined(AlphaArchitecture) || defined(ia64Architecture) || \
176       defined(AMD64Architecture))
177#    define HasGlide3			YES
178#    define Glide3IncDir		/usr/include/glide3
179#   endif /* __linux__ && (i386Architecture || AlphaArchitecture || \
180             ia64Architecture || AMD64Architecture) */
181/* extended instruction set support */
182#   ifdef i386Architecture
183#   define HasX86Support		YES
184#    define HasMMXSupport		YES
185#    define Has3DNowSupport		YES
186/* 2.4 is not yet the official (or predominant) kernel in unstable */
187#    define HasSSESupport		NO
188#   endif /* i386Architecture */
189# endif /* DebianMaintainer */
190#endif /* LinuxDebian */
191
192#if LinuxDistribution == LinuxRedHat
193#define FSUseSyslog		YES
194#endif
195
196#ifndef HasDevRandom
197# define HasDevRandom YES
198# ifndef RandomDeviceName
199#  define RandomDeviceName /dev/urandom
200# endif
201#endif
202
203/*
204 * The Linux BinUtils major version.  25 => 2.5.x, which is what is included
205 * with Slackware 3.0
206 *
207 * This remains for compatibility only.
208 *
209 */
210#ifndef BinUtilsMajorVersion
211# define BinUtilsMajorVersion	LinuxBinUtilsMajorVersion
212#endif
213
214#if (LinuxCLibMajorVersion >= 6 || LinuxDistribution == LinuxSuSE)
215# define LinuxLocaleDefines	/**/
216#else
217# define LinuxLocaleDefines	-DX_LOCALE
218#endif
219
220#ifndef  LinuxAdditionalIncludes
221# define LinuxAdditionalIncludes	/**/
222#endif
223
224#ifndef LinuxGnuSourceDefines
225# ifdef UseInstalled
226#  define LinuxGnuSourceDefines	/**/
227# else
228#  define LinuxGnuSourceDefines	-D_GNU_SOURCE
229# endif
230#endif
231
232#if LinuxCLibMajorVersion >= 6
233# define LinuxSourceDefines	-D_POSIX_C_SOURCE=199309L \
234				-D_POSIX_SOURCE -D_XOPEN_SOURCE \
235				-D_BSD_SOURCE -D_SVID_SOURCE \
236                                -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
237				LinuxAdditionalIncludes LinuxGnuSourceDefines \
238				LinuxLocaleDefines
239# define XawI18nDefines		-DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H
240# define HasPosixThreads	YES
241# define ThreadedX		YES
242# define HasThreadSafeAPI	YES
243# define ThreadsLibraries	-lpthread
244# define SystemMTDefines	-D_REENTRANT
245# ifndef HasLibCrypt
246#  define HasLibCrypt		YES
247# endif
248/* netscape wraps select but not poll as of communicator 4.72 */
249# ifndef HasPoll
250#  define HasPoll		NO
251# endif
252#else
253# define LinuxSourceDefines	-D_POSIX_SOURCE -D_POSIX_C_SOURCE=2 \
254				-D_BSD_SOURCE -D_SVID_SOURCE \
255				LinuxGnuSourceDefines LinuxLocaleDefines
256# define XawI18nDefines		-DUSE_XWCHAR_STRING -DUSE_XMBTOWC
257# ifndef HasLibCrypt
258#  define HasLibCrypt		NO
259# endif
260# ifndef HasBasename
261#  define HasBasename		NO
262# endif
263  /* Proliferation of C99isms makes -ansi unpalatable... */
264# if !defined(DefaultCCOptions) && !defined(UseInstalled) && HasGcc
265#  define DefaultCCOptions	GccWarningOptions
266# endif
267#endif
268
269#ifndef InstallXloadSetGID
270#define InstallXloadSetGID	NO
271#endif
272
273/*
274 * XXX Check which versions of Linux really have IPv6.  glibc 2.0 on
275 * Red Hat 5.2 doesn't.
276 */
277#if LinuxCLibMajorVersion < 6 || \
278    (LinuxCLibMajorVersion == 6 && LinuxCLibMinorVersion == 0)
279#define BuildIPv6		NO
280#endif
281
282/* <linux/input.h> support mainly for USB support */
283#ifndef HasLinuxInput
284# if defined(__linux__) && (OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 4))
285#  define HasLinuxInput YES
286# else
287#  define HasLinuxInput NO
288# endif
289#endif
290
291#ifndef JoystickSupport
292# define JoystickSupport	NO	/* joystick driver is broken */
293#endif
294
295/* <linux/joystick.h> appeared in 2.1.45 (officially) */
296#ifndef HasLinuxSupport
297# if defined(__linux__) && (JoystickSupport || \
298     (OSMajorVersion > 2) || \
299     ((OSMajorVersion == 2) && (OSMinorVersion > 1)) || \
300     ((OSMajorVersion == 2) && (OSMinorVersion == 1) && (OSTeenyVersion >= 45)))
301#  define HasLinuxJoystick	YES
302# else
303#  define HasLinuxJoystick	NO
304# endif
305#endif
306
307/* Libtool on linux always uses minor numbers */
308#define LibtoolMinorVersions	YES
309
310/* On x86, determine whether to build with MTRR support */
311#ifndef HasMTRRSupport
312# if defined (i386Architecture) || defined (AMD64Architecture)
313#  if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || \
314      (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 99)
315#   define HasMTRRSupport	YES
316#  else
317#   define HasMTRRSupport	NO
318#  endif
319# else
320#  define HasMTRRSupport	NO	/* no for non-ix86 */
321# endif
322#endif
323
324#ifndef XF86INT10_BUILD
325# if defined(__linux__) && defined(i386Architecture)
326#  define XF86INT10_BUILD	X86VM
327# elif defined(__linux__) && defined(AMD64Architecture)
328#  define XF86INT10_BUILD	X86EMU_OS
329# else
330#  define XF86INT10_BUILD	X86EMU_GENERIC
331# endif
332#endif
333
334/*
335 * Let the OS restore console fonts instead of the generic VGA
336 * layer. This exists for Linux only at the moment so put it
337 * here.
338 */
339#ifndef DoOSFontRestore
340# define DoOSFontRestore YES
341#endif
342
343/* Should we check the OS version to determine if the kernel supports it? */
344#if DoOSFontRestore
345# ifndef FontRestoreCheckOsVersion
346#  define FontRestoreCheckOsVersion YES
347# endif
348#endif
349
350/* The DRM module requires kernel services that appeared in late 2.1.x
351   kernels and are known to be present in 2.2.x kernels. */
352#ifndef BuildXF86DRI
353#  if defined(AlphaArchitecture)
354#    define BuildXF86DRI	YES
355#  elif defined(Arm32Architecture)
356#    define BuildXF86DRI	NO
357#  elif defined(HPArchitecture)
358#    define BuildXF86DRI	YES
359#  elif defined(i386Architecture)
360#    if (defined(__linux__) && (OSMajorVersion > 2 || (OSMajorVersion == 2 && \
361        OSMinorVersion >= 2))) || \
362        defined(__FreeBSD_kernel__)
363#      define BuildXF86DRI	YES
364#    else
365#      define BuildXF86DRI	NO
366#    endif
367#  elif defined(ia64Architecture)
368#    define BuildXF86DRI	YES
369#  elif defined(Mc68020Architecture)
370#    define BuildXF86DRI	NO
371#  elif defined(MipsArchitecture)
372#    define BuildXF86DRI	NO
373#  elif defined(PpcArchitecture)
374#    define BuildXF86DRI	YES
375#  elif defined(Ppc64Architecture)
376#    define BuildXF86DRI	NO
377#  elif defined(s390Architecture) || defined(s390xArchitecture)
378#    define BuildXF86DRI	NO
379#  elif defined(SparcArchitecture)
380#    define BuildXF86DRI	YES
381#  elif defined(SuperHArchitecture)
382#    define BuildXF86DRI	NO
383#  elif defined(AMD64Architecture)
384#    define BuildXF86DRI	YES
385#  else
386#    define BuildXF86DRI	NO
387#  endif
388#endif
389
390/*
391 * Build shared libGL and the DRI modules without -fPIC on some architectures.
392 * This improves performance.
393 */
394#ifndef BuildLibGlxWithoutPIC
395# if BuildXF86DRI
396#  if defined(i386Architecture)
397#   define BuildLibGlxWithoutPIC	YES
398#  endif
399# endif
400#endif
401
402#ifndef HasAgpGart
403#  if defined(i386Architecture) || defined(ia64Architecture) || defined(AMD64Architecture)
404     /* The AGPGART header file is included in os-support/linux, which
405        allows all drivers that depend on AGP to build properly. */
406#    define HasAgpGart	YES
407#  else
408#    define HasAgpGart	NO
409#  endif
410#endif
411
412/*
413 * Support for Intel's SSE Native Instructions, also known as the
414 * Streaming SIMD Extensions, was introduced in the 2.4.x kernels.
415 */
416#ifndef HasSSESupport
417#  if defined(i386Architecture)
418#    if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 4)
419#      define HasSSESupport		YES
420#    else
421#      define HasSSESupport		NO
422#    endif
423#  else
424#    define HasSSESupport		NO
425#  endif
426#endif
427
428/*
429 * Support for MMX isn't present in the Assembler used in Red Hat 4.2, so
430 * don't enable it for libc5 as a reasonable default.
431 */
432#ifndef HasMMXSupport
433#  if defined(i386Architecture)
434#    if (LinuxCLibMajorVersion > 5)
435#      define HasMMXSupport		YES
436#    else
437#      define HasMMXSupport		NO
438#    endif
439#  else
440#    define HasMMXSupport		NO
441#  endif
442#endif
443
444/*
445 * Support for 3DNow isn't present in the Assembler used in Red Hat 4.2, so
446 * don't enable it for libc5 as a reasonable default.
447 *
448 * XXX This is preliminary.
449 */
450#ifndef Has3DNowSupport
451#  if defined(i386Architecture)
452#    if (LinuxCLibMajorVersion > 5)
453#      define Has3DNowSupport		YES
454#    else
455#      define Has3DNowSupport		NO
456#    endif
457#  else
458#    define Has3DNowSupport		NO
459#  endif
460#endif
461
462/*
463 * The Rush extension support.
464 */
465#ifndef BuildXF86RushExt
466# define BuildXF86RushExt	YES
467#endif
468
469#if defined(__linux__) && !defined(LinuxFBDevSupport)
470# define LinuxFBDevSupport	YES
471#endif
472
473/* For compatibility */
474#define SourceDefines		LinuxSourceDefines
475
476#define BuildLibPathVar		LD_LIBRARY_PATH
477#define GccUsesGas		YES
478#define UseGas			YES
479#define GnuCpp			YES
480#if UseElfFormat
481# ifndef HasDlopen
482#  define HasDlopen		YES
483# endif
484#endif
485#define HasWeakSymbols		UseElfFormat
486#ifndef HasShadowPasswd
487# if UseElfFormat
488#  define HasShadowPasswd	YES
489# else
490#  define HasShadowPasswd	NO
491# endif
492#endif
493#define HasPutenv		YES
494#ifndef HasShm
495# define HasShm			YES
496#endif
497
498/* Use SecureRPC (used for SUN-DES-1 auth. and other goodies) when
499 * glibc has support for it */
500#ifndef HasSecureRPC
501# if !(LinuxCLibMajorVersion < 6 || \
502       (LinuxCLibMajorVersion == 6 && LinuxCLibMinorVersion < 3))
503#  define HasSecureRPC          YES
504# endif
505#endif
506
507#define HasSockets		YES
508#if UseElfFormat || defined(AlphaArchitecture)
509#ifndef HasSnprintf
510#define HasSnprintf		YES
511#endif
512#define HasMkstemp		YES
513#endif
514/* getresuid() appeared in 2.1.4, and getresgid in 2.1.44 */
515#if !defined(HasGetresuid) && \
516 (((OSMajorVersion*100000) + (OSMinorVersion*1000) + OSTeenyVersion) >= 201044)
517#define HasGetresuid		YES
518#endif
519#if OSMajorVersion >= 2
520#define HasUsableFileMmap	YES
521#endif
522#ifndef HasNCurses
523#define HasNCurses		YES
524#endif
525
526#ifndef HasGroff
527#define HasGroff		YES
528#endif
529
530#ifndef HasZlib
531#define HasZlib			YES
532#endif
533
534#ifndef HasLibpng
535#define HasLibpng		YES
536#endif
537
538#ifndef HasExpat
539# define HasExpat		YES
540#endif
541
542#ifndef HasFreetype2
543# define HasFreetype2		YES
544#endif
545
546#define AvoidNullMakeCommand	YES
547#ifndef DebuggableLibraries
548#define DebuggableLibraries	NO
549#endif
550#define CompressAllFonts	YES
551#define Malloc0ReturnsNull	YES
552#define NeedConstPrototypes	YES
553#define NeedFunctionPrototypes	YES
554#define NeedNestedPrototypes	YES
555#define NeedVarargsPrototypes	YES
556#ifndef NeedWidePrototypes
557#define NeedWidePrototypes	NO
558#endif
559#define SetTtyGroup		YES
560
561#ifndef UseStaticTermcapLib
562#define UseStaticTermcapLib	NO
563#endif
564
565#ifndef HasCookieMaker
566#define HasCookieMaker		YES
567#define MkCookieCmd		mcookie
568#endif
569
570#ifndef BourneShell
571/*
572 * This will cause builds/installs to terminate on errors, as on other
573 * platforms.
574 */
575#define BourneShell		/bin/sh -e
576#endif
577
578#define MkdirHierCmd		mkdir -p
579
580#ifndef HaveLib64
581# if defined (AMD64Architecture) || defined (s390xArchitecture) || defined (Ppc64Architecture) || defined (AArch64Architecture)
582#  define HaveLib64	YES
583# else
584#  define HaveLib64	NO
585# endif
586#endif
587
588#if UseElfFormat
589# ifndef DoLoadableServer
590#  if defined(MipsArchitecture) || defined(SuperHArchitecture)
591#   define DoLoadableServer	NO
592#  else
593#   define DoLoadableServer	YES
594#  endif
595# endif
596#endif
597
598
599#if LinuxElfDefault
600# if UseElfFormat
601#  ifdef MipsArchitecture
602#   ifndef AsCmd
603#     define AsCmd		gcc -c -x assembler-with-cpp
604#   endif
605#   ifndef MakeDllModules
606#     define MakeDllModules	YES
607#   endif
608#  endif /* MipsArchitecure */
609#  if defined (i386Architecture) && ((GccMajorVersion >3) \
610   || ((GccMajorVersion == 3) &&  (GccMinorVersion >= 1)))
611#   ifndef CcCmd
612#    define CcCmd		gcc -m32
613#   endif
614#   ifndef CplusplusCmd
615#    define CplusplusCmd	c++ -m32
616#   endif
617#  endif
618#  if defined (Ppc64Architecture)
619#   ifndef CcCmd
620#    define CcCmd		gcc -m64
621#   endif
622#   ifndef CplusplusCmd
623#    define CplusplusCmd	c++ -m64
624#   endif
625#  endif
626#  ifndef CcCmd
627#   define CcCmd		gcc
628#   define CplusplusCmd		c++
629#  endif
630#  ifndef AsCmd
631#   define AsCmd		CcCmd -c -x assembler
632#  endif
633#  define AsmDefines		-D__ELF__
634#  ifndef LdCmd
635#   define LdCmd		CcCmd -nostdlib
636#  endif
637#  ifndef LinuxUsesNcurses
638#   if LinuxCLibMajorVersion >= 6 || (LinuxDistribution == LinuxSuSE)
639#    define LinuxUsesNcurses	YES
640#   else
641#    define LinuxUsesNcurses	NO
642#   endif
643#  endif
644#  ifndef TermcapLibrary
645#   if UseStaticTermcapLib
646#    if LinuxUsesNcurses
647#     if !HaveLib64
648#      define TermcapLibrary	StaticLibrary(/usr/lib,ncurses)
649#     else
650#      define TermcapLibrary	StaticLibrary(/usr/lib64,ncurses)
651#     endif
652#    else
653#     if !HaveLib64
654#      define TermcapLibrary	StaticLibrary(/usr/lib/termcap,termcap)
655#     else
656#      define TermcapLibrary	StaticLibrary(/usr/lib64/termcap,termcap)
657#     endif
658#    endif
659#   else
660#    if LinuxUsesNcurses
661#     define TermcapLibrary	-lncurses
662#    else
663#     define TermcapLibrary	-ltermcap
664#    endif
665#   endif
666#  endif
667# else /* UseElfFormat */
668#  ifdef AlphaArchitecture
669#   define CcCmd		gcc -b alpha-linuxecoff
670#   define CplusplusCmd		g++ -b alpha-linuxecoff
671#   define AsCmd		CcCmd -c -x assembler
672#   define LdCmd		CcCmd -nostdlib -Wl,"-m alpha"
673#   define AsmDefines		-DUSE_GAS -U__ELF__
674#  endif /* AlphaArchitecture */
675#  ifdef HPArchitecture
676#   define CcCmd		gcc
677#   define CplusplusCmd		g++
678#   define AsCmd		CcCmd -c -x assembler
679#   define LdCmd		CcCmd -nostdlib
680#   define AsmDefines		-DUSE_GAS -U__ELF__
681#  endif /* HPArchitecture */
682#  ifdef i386Architecture
683#   define CcCmd		gcc -b i486-linuxaout
684#   define CplusplusCmd		g++ -b i486-linuxaout
685#   define AsCmd		CcCmd -c -x assembler
686#   define LdCmd		CcCmd -nostdlib -Wl,"-m i386linux"
687#   define AsmDefines		-DUSE_GAS -U__ELF__
688#  endif /* i386Architecture */
689#  ifdef ia64Architecture
690#   define CcCmd		gcc
691#   define CplusplusCmd		g++
692#   define AsCmd		CcCmd -c -x assembler
693#   define LdCmd		CcCmd -nostdlib
694#   define AsmDefines		-DUSE_GAS -U__ELF__
695#  endif /* ia64Architecture */
696#  ifdef Mc68020Architecture
697#   define CcCmd		gcc -b m68k-linuxaout
698#   define CplusplusCmd		g++ -b m68k-linuxaout
699#   define AsCmd		CcCmd -c -x assembler
700#   define LdCmd		CcCmd -nostdlib -Wl,"-m m68klinux"
701#   define AsmDefines		-DUSE_GAS -U__ELF__
702#  endif /* Mc68020Architecture */
703#  ifdef AMD64Architecture
704#   define CcCmd		gcc
705#   define CplusplusCmd		g++
706#   define AsCmd		CcCmd -c -x assembler
707#   define LdCmd		CcCmd -nostdlib
708#   define AsmDefines		-DUSE_GAS -U__ELF__
709#  endif /* AMD64Architecture */
710# endif /* UseElfFormat */
711#else
712# if UseElfFormat
713#  ifdef AlphaArchitecture
714#   define CcCmd		gcc -b alpha-linux
715#   define AsCmd		CcCmd -c -x assembler
716#   define LdCmd		CcCmd -nostdlib -Wl,"-m elf64alpha"
717#   define AsmDefines		-D__ELF__
718#   define CplusplusCmd		c++ -b alpha-linux
719#  endif /* AlphaArchitecture */
720#  ifdef HPArchitecture
721#   define CcCmd		gcc
722#   define CplusplusCmd		g++
723#   define AsCmd		CcCmd -c -x assembler
724#   define LdCmd		CcCmd -nostdlib
725#   define AsmDefines		-D__ELF__
726#   define SharedLibXau		YES
727#  endif /* HPArchitecture */
728#  ifdef i386Architecture
729#   define CcCmd		gcc -b i486-linux
730#   define AsCmd		CcCmd -c -x assembler
731#   define LdCmd		CcCmd -nosdlib -Wl,"-m elf_i386"
732#   define AsmDefines		-D__ELF__
733#   define CplusplusCmd		c++ -b i486-linux
734#  endif /* i386Architecture */
735#  ifdef ia64Architecture
736#   define CcCmd		gcc
737#   define CplusplusCmd		g++
738#   define AsCmd		CcCmd -c -x assembler
739#   define LdCmd		CcCmd -nostdlib
740#   define AsmDefines		-D__ELF__
741#  endif /* ia64Architecture */
742#  ifdef Mc68020Architecture
743#   define CcCmd		gcc -b m68k-linux
744#   define AsCmd		CcCmd -c -x assembler
745#   define LdCmd		CcCmd -nostdlib -W,l"-m m68kelf"
746#   define AsmDefines		-D__ELF__
747#   define CplusplusCmd		c++ -b m68k-linux
748#  endif /* Mc68020Architecture */
749#  ifdef AMD64Architecture
750#   define CcCmd                 gcc
751#   define CplusplusCmd          g++
752#   define AsCmd                 CcCmd -c -x assembler
753#   define LdCmd                 CcCmd -nostdlib
754#   define AsmDefines            -D__ELF__
755#  endif /* AMD64Architecture */
756# else
757#  define CcCmd			gcc
758#  define AsCmd			CcCmd -c -x assembler
759#  define LdCmd			CcCmd -nostdlib
760#  define AsmDefines		-DUSE_GAS
761# endif
762#endif
763
764/*
765 * Some older distros still need /lib/cpp.  There's probably a better
766 * test, but this handles the older Red Hat releases at least.
767 */
768#ifndef CppCmd
769# if (LinuxDistribution == LinuxRedHat) && \
770     ((LinuxCLibMajorVersion < 6) || \
771      (LinuxCLibMajorVersion == 6 && LinuxCLibMinorVersion < 1))
772#  define CppCmd		/lib/cpp
773# else
774#  define CppCmd		cpp
775# endif
776#endif
777
778/* Some Linux distributions have yacc, some don't. All have bison. */
779#define YaccCmd			bison -y
780#define LexCmd			flex -l
781#define HasFlex			YES
782#define LexLib			-lfl
783#define PreProcessCmd		CcCmd -E
784#define PostIncDir		DefaultGccIncludeDir
785#define LdCombineFlags		-r
786#ifndef LdPostLib
787# define LdPostLib		/* Never needed */
788#endif
789#define HasWChar32		YES
790#define StandardCppOptions	-traditional
791#define StandardCppDefines	StandardDefines
792
793#define HasVarRun		YES
794#ifndef VarDbDirectory
795# define VarDbDirectory		$(VARDIR)/lib
796#endif
797
798#ifndef XF86OSCardDrivers
799# ifdef __linux__
800#  define XF86OSCardDrivers	fbdev v4l sisusb
801# else
802#  define XF86OSCardDrivers	/**/
803# endif
804#endif
805
806#ifndef OSXInputDrivers
807# if HasLinuxJoystick
808#  define OSXInputDrivers1	ur98
809# else
810#  define OSXInputDrivers1	/**/
811# endif
812# if HasLinuxInput
813#  define OSXInputDrivers2	aiptek evdev
814# else
815#  define OSXInputDrivers2	/**/
816# endif
817# define OSXInputDrivers	OSXInputDrivers1 OSXInputDrivers2
818#endif
819
820#if UseElfFormat
821# define HasPlugin			YES
822# define VendorHasX11R6_3libXext	YES	/* XC or XFree86 >= 3.3.1 */
823#endif
824
825#ifdef AlphaArchitecture
826# ifndef OptimizedCDebugFlags
827#  define OptimizedCDebugFlags	DefaultGcc2AxpOpt
828# endif
829# define LinuxMachineDefines	-D__alpha__
830# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
831# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64 -DJENSEN_SUPPORT
832# ifdef UseCompaqMathLibrary
833#  define MathLibrary		-lcpml -lm
834# endif
835#endif /* AlphaArchitecture */
836
837#ifdef Arm32Architecture
838# define DefaultCCOptions
839# ifndef OptimizedCDebugFlags
840#  define OptimizedCDebugFlags	-O3
841# endif
842# define LinuxMachineDefines	-D__arm__ -D__arm32__ -U__arm -Uarm
843# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
844# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
845#endif /* Arm32Achitecture */
846
847#ifdef HPArchitecture
848# define OptimizedCDebugFlags	-O2  GccAliasingArgs
849# define LinuxMachineDefines	-D__hppa__
850# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
851# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
852#endif
853
854#ifdef i386Architecture
855# ifndef OptimizedCDebugFlags
856#  define OptimizedCDebugFlags	DefaultGcc2i386Opt
857# endif
858# define LinuxMachineDefines	-D__i386__
859# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
860# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
861#endif /* i386Architecture */
862
863#ifdef ia64Architecture
864# ifndef OptimizedCDebugFlags
865#  define OptimizedCDebugFlags	-O2  GccAliasingArgs
866# endif
867# define LinuxMachineDefines	-D__ia64__
868# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
869# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
870#endif /* ia64Architecture */
871
872#ifdef Mc68020Architecture
873# ifndef OptimizedCDebugFlags
874#  define OptimizedCDebugFlags	-O2  GccAliasingArgs
875# endif
876# define LinuxMachineDefines	-D__mc68000__
877# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
878# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
879#endif /* Mc68020Architecture */
880
881#ifdef MipsArchitecture
882# ifndef OptimizedCDebugFlags
883#  define OptimizedCDebugFlags	DefaultGcc2MipsOpt
884# endif
885# define LinuxMachineDefines	-D__mips__
886# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
887# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
888#endif
889
890#ifdef Ppc64Architecture
891# define DefaultCCOptions	-mminimal-toc
892# ifndef OptimizedCDebugFlags
893#  define OptimizedCDebugFlags	DefaultGcc2Ppc64Opt
894# endif
895# define LinuxMachineDefines	-D__powerpc64__ -D__powerpc__
896# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME -DPART_NET
897# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
898#endif /* Ppc64Architecture */
899
900#ifdef PpcArchitecture
901# define DefaultCCOptions
902# ifndef OptimizedCDebugFlags
903#  define OptimizedCDebugFlags	DefaultGcc2PpcOpt
904# endif
905# define LinuxMachineDefines	-D__powerpc__
906# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
907# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
908#endif /* PpcArchitecture */
909
910#ifdef s390Architecture
911# ifndef OptimizedCDebugFlags
912#  define OptimizedCDebugFlags	-O2 -fomit-frame-pointer GccAliasingArgs
913# endif
914# define LinuxMachineDefines	-D__s390__
915# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
916# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
917#endif /* s390Architecture */
918
919#ifdef s390xArchitecture
920/*#define DefaultCCOptions	-fsigned-char */
921#define OptimizedCDebugFlags	-O3 -fomit-frame-pointer
922#define LinuxMachineDefines	-D__s390x__
923#define ServerOSDefines		XFree86ServerOSDefines -DDDXTIME
924#define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
925#endif /* s390xArchitecture */
926
927#ifdef SparcArchitecture
928# ifndef OptimizedCDebugFlags
929#  define OptimizedCDebugFlags	-O2  GccAliasingArgs
930# endif
931# define LinuxMachineDefines	-D__sparc__
932# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
933# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
934# define AsVISOption		-Av9a
935# ifdef Sparc64Architecture
936#  define AsOutputArchSize	64
937# else
938#  define AsOutputArchSize	32
939# endif
940#endif
941
942#ifdef SuperHArchitecture
943# ifndef SuperHArchOptFlags
944#  ifdef SuperH4Architecture
945#   define SuperHArchOptFlags	-m4
946#  elif defined(SuperH4NOFPUArchitecture)
947#   define SuperHArchOptFlags	-m4-nofpu
948#  else
949#   define SuperHArchOptFlags	-m3
950#  endif
951# endif
952# ifndef SuperHebArchitecture
953#  ifdef SuperHebArchitecture
954#   define SuperHEndianFlags	-mb
955#  else
956#   define SuperHEndianFlags	-ml
957#  endif
958# endif
959# ifndef OptimizedCDebugFlags
960#  define OptimizedCDebugFlags	-O2 SuperHArchOptFlags SuperHEndianFlags  GccAliasingArgs
961# endif
962# define LinuxMachineDefines	-D__sh__
963# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
964# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
965# ifndef DoLoadableServer
966#  define DoLoadableServer NO
967# endif
968#endif
969
970#ifdef AMD64Architecture
971# ifndef OptimizedCDebugFlags
972#  define OptimizedCDebugFlags	DefaultGcc2AMD64Opt
973# endif
974# define LinuxMachineDefines   -D__amd64__
975# define ServerOSDefines	XFree86ServerOSDefines -DDDXTIME
976# define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
977#endif /* AMD64Architecture */
978
979#ifdef AArch64Architecture
980# ifndef OptimizedCDebugFlags
981#  define OptimizedCDebugFlags DefaultGcc2AArch64Opt
982# endif
983# define LinuxMachineDefines   -D__aarch64__
984# define ServerOSDefines   XFree86ServerOSDefines -DDDXTIME
985# define ServerExtraDefines    -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
986#endif /* AArch64Architecture */
987
988#ifndef StandardDefines
989# ifdef __linux__
990#  define StandardDefines	-Dlinux LinuxMachineDefines LinuxSourceDefines
991# else
992#  define StandardDefines	LinuxMachineDefines LinuxSourceDefines
993# endif
994#endif
995
996#if UseElfFormat
997# define DlLibrary		-rdynamic -ldl
998#else
999# define DlLibrary		/**/
1000#endif
1001
1002#define ServerExtraSysLibs	/**/
1003
1004#ifndef PamLibraries
1005#define PamLibraries		-lpam DlLibrary
1006#endif
1007
1008#ifndef PamMiscLibraries
1009#define PamMiscLibraries	-lpam_misc
1010#endif
1011
1012#ifndef HasDECnet
1013#define HasDECnet		NO
1014#endif
1015#if HasDECnet
1016# define ConnectionFlags	-DUNIXCONN -DTCPCONN -DDNETCONN
1017# define ExtraLibraries		-ldnet
1018#else
1019# define ConnectionFlags	-DUNIXCONN -DTCPCONN
1020#endif
1021
1022/* Some of these man page defaults are overriden in the above OS sections */
1023#ifndef ManSuffix
1024# define ManSuffix	1x
1025#endif
1026#ifndef ManDir
1027# define ManDir		$(MANSOURCEPATH)1
1028#endif
1029#ifndef LibManSuffix
1030# define LibManSuffix	3x
1031#endif
1032#ifndef LibmanDir
1033# define LibmanDir	$(MANSOURCEPATH)3
1034#endif
1035#ifndef FileManSuffix
1036# define FileManSuffix	5x
1037#endif
1038#ifndef FileManDir
1039# define FileManDir	$(MANSOURCEPATH)5
1040#endif
1041
1042#ifndef StaticLibrary
1043# define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic
1044#endif
1045
1046#ifndef LinkGLToUsrLib
1047# define LinkGLToUsrLib		YES
1048#endif
1049# ifndef LinkGLToUsrInclude
1050# define LinkGLToUsrInclude	YES
1051#endif
1052
1053
1054#define HasGnuMake		YES
1055
1056#define MakeNamedTargetSubdir(dir,flags,subname)\
1057	$(MAKE) -C dir $(MFLAGS) $(PARALLELMFLAGS) flags subname
1058
1059#define ArchitectureDefines	-DLINUX_ARCHITECTURE
1060
1061#define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB)
1062#define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
1063
1064#if HaveLib64
1065# ifndef LibDirName
1066#  define LibDirName		lib64
1067# endif
1068# ifndef SystemUsrLibDir
1069#  define SystemUsrLibDir	/usr/lib64
1070# endif
1071# ifndef TkLibDir
1072#  define TkLibDir		/usr/lib64
1073# endif
1074#endif
1075
1076#ifndef BuildDmx
1077#define BuildDmx	YES
1078#endif
1079
1080#include <lnxLib.rules>
1081# include <xorg.cf>
1082
1083#ifndef XFree86ServerOSDefines
1084# define XFree86ServerOSDefines
1085#endif
1086