--- config/cf/FreeBSD.cf.orig Tue Jan 14 21:52:12 2003 +++ config/cf/FreeBSD.cf Thu Feb 5 12:33:53 2004 @@ -89,14 +89,14 @@ # endif # define HasPosixThreads YES # define ThreadedX YES -# define SystemMTDefines -D_REENTRANT -D_THREAD_SAFE +# define SystemMTDefines %%PTHREAD_CFLAGS%% /* * FreeBSD has tread-safe api but no getpwnam_r yet. */ # define HasThreadSafeAPI YES # define MTSafeAPIDefines -DXUSE_MTSAFE_API -DXNO_MTSAFE_PWDAPI # if HasLibPthread -# define ThreadsLibraries -lpthread +# define ThreadsLibraries %%PTHREAD_LIBS%% # else # if OSRelVersion >= 500043 # define BuildThreadStubLibrary NO @@ -106,9 +106,9 @@ # define NeedUIThrStubs YES # endif # if (OSRelVersion >= 500016) -# define ThreadsLibraries -lc_r +# define ThreadsLibraries %%PTHREAD_LIBS%% # else -# define ThreadsLibraries -pthread +# define ThreadsLibraries %%PTHREAD_LIBS%% # endif # define SharedX11Reqs $(LDPRELIB) $(XTHRSTUBLIB) # define SharedXtReqs $(LDPRELIB) $(XLIBONLY) $(SMLIB) $(ICELIB) $(XTHRSTUBLIB) @@ -162,11 +162,11 @@ * ld: warning: libXThrStub.so.6, needed by libX11.so, not found */ #if BuildThreadStubLibrary && (!defined(UseInstalledX11) || !UseInstalledX11) -# define CcCmd $(CLIENTENVSETUP) cc -# define CplusplusCmd $(CLIENTENVSETUP) c++ +# define CcCmd $(CLIENTENVSETUP) FreeBSDCC +# define CplusplusCmd $(CLIENTENVSETUP) FreeBSDCXX #else -# define CcCmd cc -# define CplusplusCmd c++ +# define CcCmd FreeBSDCC +# define CplusplusCmd FreeBSDCXX #endif #define CppCmd /usr/bin/cpp @@ -177,7 +177,12 @@ #if defined(UseInstalled) #define DefaultCCOptions /**/ #else -#define DefaultCCOptions -ansi -pedantic -Dasm=__asm GccWarningOptions +#if defined(HasGcc3) && HasGcc3 +#define NoSystemWarn -Wno-system-headers +#else +#define NoSystemWarn +#endif +#define DefaultCCOptions -ansi -Dasm=__asm NoSystemWarn GccWarningOptions #endif #endif #ifndef ExtraLibraries @@ -228,21 +233,25 @@ #endif /* - * 4.1/i386 and 5.0/i386 have the AGP driver. + * 4.1/i386 and 5.0/i386,alpha,ia64,amd64 have the AGP driver. */ #ifndef HasAgpGart #if defined(i386Architecture) && \ (OSMajorVersion >= 5 || (OSMajorVersion == 4 && OSMinorVersion >= 1)) #define HasAgpGart YES #endif +#if (defined(AlphaArchitecture) || defined(ia64Architecture) || \ + defined(x86_64Architecture)) && (OSMajorVersion >= 5) +#define HasAgpGart YES +#endif #endif /* * SSE and 3DNow will be autodetected, so binutils is the only * requirement for enabling this. By 4.2 they were all supported. */ -#if defined(i386Architecture) && \ - (OSMajorVersion >= 5 || (OSMajorVersion == 4 && OSMinorVersion >= 2)) +#if defined(x86_64Architecture) || (defined(i386Architecture) && \ + (OSMajorVersion >= 5 || (OSMajorVersion == 4 && OSMinorVersion >= 2))) # define HasX86Support YES # define HasMMXSupport YES # define Has3DNowSupport YES @@ -299,7 +308,7 @@ #ifndef SharedLibraryLoadFlags #if UseElfFormat -#define SharedLibraryLoadFlags -shared -rpath $(USRLIBDIRPATH) +#define SharedLibraryLoadFlags -shared -Wl,-rpath,$(USRLIBDIRPATH) #else #define SharedLibraryLoadFlags -Bshareable -R $(USRLIBDIRPATH) #endif @@ -455,10 +464,8 @@ #ifdef i386Architecture #define ServerExtraDefines GccGasOption XFree86ServerDefines #endif -#ifdef AlphaArchitecture -#define ServerExtraDefines GccGasOption XFree86ServerDefines -D_XSERVER64 -#endif -#ifdef Sparc64Architecture +#if defined(AlphaArchitecture) || defined(Sparc64Architecture) || \ + defined(ia64Architecture) || defined(x86_64Architecture) #define ServerExtraDefines GccGasOption XFree86ServerDefines -D_XSERVER64 #endif @@ -482,18 +489,8 @@ #define XawI18nDefines -DUSE_XWCHAR_STRING -DUSE_XMBTOWC #endif -/* The GCC strength-reduce bug is fixed for FreeBSD 2.1.5 and later */ -#ifndef DefaultGcc2i386Opt -#if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 5) -#define DefaultGcc2i386Opt -O2 -#endif -#endif - -#ifdef i386Architecture -# define OptimizedCDebugFlags DefaultGcc2i386Opt -#else -# define OptimizedCDebugFlags -O -#endif +#define DefaultGcc2i386Opt +#define OptimizedCDebugFlags FreeBSDCFLAGS #ifndef PreIncDir # define PreIncDir /usr/include