Index: xc/ChangeLog =================================================================== RCS file: /cvs/xorg/xc/ChangeLog,v retrieving revision 1.787 diff -u -2 -0 -r1.787 ChangeLog --- xc/ChangeLog 1 Mar 2005 19:53:27 -0000 1.787 +++ xc/ChangeLog 2 Mar 2005 11:13:44 -0000 @@ -1,20 +1,39 @@ +2005-03-02 Roland Mainz + * xc/config/cf/DragonFly.cf + * xc/config/cf/Imake.cf + * xc/config/cf/Imakefile + * xc/config/imake/imake.c + * xc/config/imake/imakemdep.h + * xc/extras/drm/shared/drm.h + * xc/include/Xos_r.h + * xc/lib/xtrans/Xtranssock.c + * xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h + * xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h + * xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c + * xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c + Bugzilla #1712 (https://bugs.freedesktop.org/show_bug.cgi?id=1712) + attachment #xxx (https://bugs.freedesktop.org/attachment.cgi?id=xxx): + Add support for DragonFly/BSD platform. + Patch by Jeroen Ruigrok and Mike Verona + . + 2005-03-01 Alan Hourihane * xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c Fix an off by one error when scaling which caused occasional overlay color lines at the far right and bottom of the window. 2005-03-01 Alexander Gottwald * programs/Xserver/GL/glx/Imakefile: Remove stdcall objects in clean rule 2005-02-26 Felix Kuehling * programs/Xserver/hw/xfree86/drivers/savage/savage_dri.c: (SAVAGEDRIMapInit), (SAVAGEDRICloseScreen): * programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c: (SavagePreInit): * programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h: Fixed ShadowStatus handling with DRI: - always enable ShadowStatus when DRI is enabled - if DRI initialization fails, reset ShadowStatus to configured setting Index: xc/config/cf/DragonFly.cf =================================================================== RCS file: xc/config/cf/DragonFly.cf diff -N xc/config/cf/DragonFly.cf --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ xc/config/cf/DragonFly.cf 2 Mar 2005 11:13:44 -0000 @@ -0,0 +1,354 @@ +XCOMM $XdotOrg: xc/config/cf/DragonFly.cf,v 1.1 2005/02/19 02:02:31 marvis Exp $ + +#define UseElfFormat YES + +#define OSBinaryFormat [ELF] + +#ifndef OSName +#define OSName DefaultOSName OSBinaryFormat +#endif +#ifndef OSVendor +#define OSVendor /**/ +#endif +#ifndef OSMajorVersion +#define OSMajorVersion DefaultOSMajorVersion +#endif +#ifndef OSMinorVersion +#define OSMinorVersion DefaultOSMinorVersion +#endif + +#ifndef OSRelVersion +/* Include this to get finer-grained information about the OS version */ +#include "/usr/include/osreldate.h" +#define OSRelVersion __DragonFly_version +#endif + +XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion) (OSRelVersion) + +/* + * Base OS setup + */ +#define HasCplusplus YES +#define GccUsesGas YES +#define UseGas YES +#define GnuCpp YES +#define HasBasename YES +#define HasBSD44Sockets YES +#define HasDlopen YES +#define HasGetIfAddrs YES +#define HasIssetugid YES +#define HasLibCrypt YES +#define HasMktemp YES +#define HasNCurses YES +#define HasNdbm YES +#define HasPlugin YES +#define HasPoll YES +#define HasPutenv YES +#define HasUsableFileMmap YES +#define HasSetProcTitle YES +#define HasShm YES +#define HasSnprintf YES +#define HasStrlcat YES +#define HasVarDb YES +#define HasVarRun YES +#define HasWChar32 YES +#define HasWeakSymbols UseElfFormat +#define BuildXaw6 NO /*depreciated*/ +#define BuildXaw7 NO /*depreciated*/ +#define BuildXaw YES /*needed*/ +#ifndef BuildPDFdocs +#define BuildPDFdocs NO +#endif +#define IPv6SocketsAlsoIPv4 NO +#define InstallXloadSetGID NO + +/* + * Multi-thread safe libs + */ +#ifndef HasLibPthread +# define HasLibPthread NO +#endif +#define HasPosixThreads YES +#define ThreadedX YES +#define SystemMTDefines -D_REENTRANT -D_THREAD_SAFE +#define HasThreadSafeAPI YES +#define MTSafeAPIDefines -DXUSE_MTSAFE_API -DXNO_MTSAFE_PWDAPI +#if HasLibPthread +# define ThreadsLibraries -lpthread +#else +# define ThreadsLibraries -pthread +#endif + + +#define AvoidNullMakeCommand YES +#define StripInstalledPrograms YES +#define CompressAllFonts YES +#define Malloc0ReturnsNull YES +#define NeedConstPrototypes YES +#define NeedFunctionPrototypes YES +#define NeedNestedPrototypes YES +#define NeedVarargsPrototypes YES +#define NeedWidePrototypes NO + +#define MkdirHierCmd mkdir -p + +#define LexCmd flex -l +#define HasFlex YES + +#ifndef CcCmd +# define CcCmd cc +#endif +#ifndef CplusplusCmd +# define CplusplusCmd c++ +#endif +#define CppCmd /usr/bin/cpp +#define PreProcessCmd CppCmd +#define StandardCppOptions -traditional +#define StandardCppDefines /**/ +#ifndef DefaultCCOptions +# if defined(UseInstalled) +# define DefaultCCOptions /**/ +# else +# if defined(HasGcc3) && HasGcc3 +# define NoSystemWarn -Wno-system-headers +# else +# define NoSystemWarn +# endif +# define DefaultCCOptions -ansi NoSystemWarn -Dasm=__asm GccWarningOptions +#endif +#ifndef ExtraLibraries +/* support for multi-byte locales is in libxpg4 rather than libc */ +#define ExtraLibraries -lxpg4 +#endif +#define HasSetUserContext YES +#define HasGetpeereid YES +#define HasMTRRSupport YES + +#ifndef BuildXF86DRI +# define BuildXF86DRI YES +#endif + +#if defined(i386Architecture) +#define HasAgpGart YES +#endif + +/* + * SSE and 3DNow will be autodetected, so binutils is the only + * requirement for enabling this. + */ +#if defined(i386Architecture) +# define HasX86Support YES +# define HasMMXSupport YES +# define Has3DNowSupport YES +# define HasSSESupport YES +#else +# define HasX86Support NO +# define HasMMXSupport NO +# define Has3DNowSupport NO +# define HasSSESupport NO +#endif + +#ifndef UseRpath +# define UseRpath YES +#endif + +#ifndef RpathLoadFlags +# if UseRpath +# define RpathLoadFlags -Wl,-rpath,$(USRLIBDIRPATH) +# else +# define RpathLoadFlags /**/ +# endif +#endif + +#ifndef ExtraLoadFlags +# if !defined(UseInstalled) +# define ExtraLoadFlags RpathLoadFlags -Wl,-rpath-link,$(BUILDLIBDIR) +# else +# define ExtraLoadFlags RpathLoadFlags +# endif +#endif + +#endif + +#ifndef LibraryRpathLoadFlags +# if UseRpath +# define LibraryRpathLoadFlags -rpath $(USRLIBDIRPATH) +# else +# define LibraryRpathLoadFlags /**/ +# endif +#endif + +#ifndef SharedLibraryLoadFlags +# define SharedLibraryLoadFlags -shared LibraryRpathLoadFlags +#endif + +#ifndef HasZlib +# define HasZlib YES +#endif + +#ifndef HasPam +# define HasPam YES +#endif + +/* Take from FreeBSD */ +/* There are two options for building. One is to assume that the system has + * many of the dependencies provided by the ports tree. The other is to just + * build everything from this tree. + */ + +#ifndef HasStandardPorts +# define HasStandardPorts YES +#endif + +#ifndef LocalBase +# define LocalBase /usr/local +#endif +#ifndef X11Base +# define X11Base /usr/X11R6 +#endif + +#if HasStandardPorts + +#ifndef HasExpat +# define HasExpat YES +# define ExpatDir LocalBase +#endif + +#ifndef HasFreetype2 +# define HasFreetype2 NO /* set this to YES once DragonFly ships FT218 */ +# define Freetype2Dir LocalBase +#endif + +#ifndef HasFontconfig +# define HasFontconfig YES +# define FontconfigDir X11Base +#endif + +#ifndef HasLibpng +# define HasLibpng YES +# define LibpngDir LocalBase +#endif + +#endif /* HasStandardPorts */ + +#undef InstallCmd +#define InstallCmd /usr/bin/install + +#define AsmElfDefines -D__ELF__ + +#if GccUsesGas +# define GccGasOption -DGCCUSESGAS +# define AsmDefines -DUSE_GAS AsmElfDefines +#else +# define GccGasOption /**/ +# define AsmDefines AsmElfDefines +#endif + +#ifdef i386Architecture +#define ServerExtraDefines GccGasOption XFree86ServerDefines +#endif +#if defined(Sparc64Architecture) || defined(ia64Architecture) || \ + defined(AMD64Architecture) +#define ServerExtraDefines GccGasOption XFree86ServerDefines -D_XSERVER64 +#endif + +#define StandardDefines -DCSRG_BASED + +#define ServerOSDefines XFree86ServerOSDefines -DDDXTIME +#define XawI18nDefines -DUSE_XWCHAR_STRING +#define HasMakefileSafeInclude YES +#define IncludeMakefile(file) @@# dependencies are in .depend +#define DependFileName .depend +#ifndef DoLoadableServer +# define DoLoadableServer YES +#endif +#ifndef ForceNormalLib +# define ForceNormalLib YES +#endif +#define HasMkstemp YES + +#define OptimizedCDebugFlags -O + +#ifndef PreIncDir +# define PreIncDir /usr/include +#endif + +#define HasGroff YES +#define NroffCmd env GROFF_NO_SGR=y groff -Tascii +#define SetTtyGroup YES + +#ifndef ExtraFilesToClean +# define ExtraFilesToClean *.core +#endif + +#define DefaultUserPath /bin:/usr/bin:/sbin:/usr/sbin:$(BINDIR):/usr/local/bin +#define DefaultSystemPath /bin:/usr/bin:/sbin:/usr/sbin:$(BINDIR) +#ifndef SystemManDirectory +# define SystemManDirectory /usr/share/man +#endif + +#define InstKmemFlags -g kmem -m 2755 + +/* + * Compress manual pages + */ +#ifndef CompressManPages +# define CompressManPages YES +#endif + +#define HasBsdMake YES + +#ifndef StaticLibrary +# define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) Concat(-l,libname) -Wl,-Bdynamic +#endif + +#define DlLibrary -Wl,--export-dynamic + +#ifndef PamLibraries +# define PamLibraries -lpam DlLibrary +#endif + +#ifndef SharedLibXdmGreet +# define SharedLibXdmGreet NO +#endif + +/* + * On FreeBSD, the run-time loader will use the built-in "rpath" before + * LD_LIBRARY_PATH. This means that utilities like mkfontdir will load + * installed libraries (if they exist) in preference to the ones in the + * build tree, even though LD_LIBRARY_PATH points to the build tree. + * This can result in the build failing. One way to avoid this is to + * pre-load the libraries from the build tree. + * + * There should be a better way than this hack... + */ +#if UseElfFormat +#ifndef PreloadFontSetup +#define PreloadFontSetup LD_PRELOAD="`(cd $(XENVLIBDIR); echo $(XFONTPRELOADPATTERN))`" +#endif +#ifndef PreloadFreetypeSetup +#define PreloadFreetypeSetup LD_PRELOAD="`(cd $(XENVLIBDIR); echo $(FT2PRELOADPATTERN))`" +#endif +#ifndef PreloadXFTSetup +#define PreloadXFTSetup LD_PRELOAD="`(cd $(XENVLIBDIR); echo $(FT2PRELOADPATTERN) $(XFTPRELOADPATTERN) $(XRENDERPRELOADPATTERN) $(FCPRELOADPATTERN))`" +#endif +#endif + +#ifndef HasCookieMaker +# define HasCookieMaker YES +# define MkCookieCmd \ + 'dd if=/dev/urandom bs=16 count=1 2>/dev/null | hexdump -e \\"%08x\\"' +#endif + +/* + * A hack to work around an optimization problem with gcc 2.95.2 - 2.95.4 + */ +#if (GccMajorVersion == 2 && GccMinorVersion == 95) +# define GccOptBug295 +#endif + +#include + +#include + + Index: xc/config/cf/Imake.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/Imake.cf,v retrieving revision 1.6 diff -u -2 -0 -r1.6 Imake.cf --- xc/config/cf/Imake.cf 15 Nov 2004 15:06:52 -0000 1.6 +++ xc/config/cf/Imake.cf 2 Mar 2005 11:13:44 -0000 @@ -236,40 +236,67 @@ # endif # ifdef __arm32__ # define Arm32Architecture # undef __arm32__ # endif # ifdef __vax__ # define VaxArchitecture # undef __vax__ # endif # ifdef __powerpc__ # define PpcArchitecture # undef __powerpc__ # endif #endif /* NetBSD */ /* Systems based on kernel of NetBSD */ #if defined(__NetBSD_kernel__) #define KNetBSDArchitecture #endif +#ifdef __DragonFly__ +# define MacroIncludeFile +# define MacroFile DragonFly.cf +# undef __DragonFly__ +# undef __FreeBSD__ +# define DragonFlyArchitecture +# define FreeBSDArchitecture +# ifdef __i386__ +# define i386BsdArchitecture +# define i386Architecture +# undef i386 +# endif +# ifdef __sparc64__ +# define Sparc64Architecture +# undef __sparc64__ +# endif +# ifdef __ia64__ +# define ia64Architecture +# undef __ia64__ +# endif +# ifdef __amd64__ +# define x86_64Architecture +# undef __amd64__ +# undef __x86_64__ +# endif +#endif /* __DragonFly__ */ + #ifdef __FreeBSD__ # define MacroIncludeFile # define MacroFile FreeBSD.cf # undef __FreeBSD__ # define FreeBSDArchitecture # define KFreeBSDArchitecture # ifdef __i386__ # define i386BsdArchitecture # define i386Architecture # undef i386 # endif # ifdef __alpha__ # define AlphaBsdArchitecture # define AlphaArchitecture # undef __alpha__ # endif # ifdef __sparc64__ # define Sparc64Architecture # undef __sparc64__ # endif Index: xc/config/cf/Imakefile =================================================================== RCS file: /cvs/xorg/xc/config/cf/Imakefile,v retrieving revision 1.5 diff -u -2 -0 -r1.5 Imakefile --- xc/config/cf/Imakefile 15 Nov 2004 15:06:52 -0000 1.5 +++ xc/config/cf/Imakefile 2 Mar 2005 11:13:45 -0000 @@ -76,40 +76,41 @@ darwinLib.tmpl \ hpLib.tmpl \ gnuLib.tmpl \ ibmLib.tmpl \ lnxLib.tmpl \ lnxdoc.tmpl \ necLib.tmpl \ os2Lib.tmpl \ osfLib.tmpl \ sgiLib.tmpl \ sunLib.tmpl \ sv3Lib.tmpl \ sv4Lib.tmpl \ xf86.tmpl \ xorg.tmpl CFFILES = \ Imake.cf \ Amoeba.cf \ DGUX.cf \ +DragonFly.cf \ FreeBSD.cf \ Mips.cf \ NetBSD.cf \ OpenBSD.cf \ Oki.cf \ cygwin.cf \ mingw.cf \ Win32.cf \ apollo.cf \ bsd.cf \ bsdi.cf \ convex.cf \ cray.cf \ fujitsu.cf \ generic.cf \ gnu.cf \ hp.cf \ ibm.cf \ isc.cf \ linux.cf \ Index: xc/config/imake/imake.c =================================================================== RCS file: /cvs/xorg/xc/config/imake/imake.c,v retrieving revision 1.6 diff -u -2 -0 -r1.6 imake.c --- xc/config/imake/imake.c 24 Feb 2005 15:31:09 -0000 1.6 +++ xc/config/imake/imake.c 2 Mar 2005 11:13:46 -0000 @@ -128,41 +128,41 @@ * #define IMAKE_LOCAL_MACROS "localmacros" * #include IMAKE_LOCAL_MACROS * 5. Start up cpp and provide it with this file. * Note that the define for INCLUDE_IMAKEFILE is intended for * use in the template file. This implies that the imake is * useless unless the template file contains at least the line * #include INCLUDE_IMAKEFILE * 6. Gather the output from cpp, and clean it up, expanding @@ to * newlines, stripping trailing white space, cpp control lines, * and extra blank lines, and changing XCOMM to #. This cleaned * output is placed in a new file, default "Makefile", but can * be specified with -s or -e options. * 7. Optionally start up make on the resulting file. * * The design of the template makefile should therefore be: * * * #include INCLUDE_IMAKEFILE * */ -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) /* This needs to be before _POSIX_SOURCE gets defined */ # include # include # include #endif #include #include #include "Xosdefs.h" #include #include #ifdef WIN32 # include "Xw32defs.h" #endif #if 0 #ifndef X_NOT_POSIX # ifndef _POSIX_SOURCE # define _POSIX_SOURCE # endif #endif #endif @@ -1003,41 +1003,41 @@ fp = popen (command, "w"); if (fp == NULL || fprintf (fp, "%s\n", libc_c) < 0 || pclose (fp) != 0) abort (); fp = popen (aout, "r"); if (fp == NULL) abort (); while (fgets (command, len, fp)) fprintf (inFile, command); len = pclose (fp); remove (aout); if (len) abort (); } #endif -#if defined(__OpenBSD__) +#if defined(__OpenBSD__) || defined(__DragonFly__) static void get_stackprotector(FILE *inFile) { FILE *fp; char *cc; char command[1024], buf[1024]; cc = getenv("CC"); if (cc == NULL) { cc = "cc"; } snprintf(command, sizeof(command), "%s -v 2>&1", cc); fp = popen(command, "r"); if (fp == NULL) abort(); while (fgets(buf, sizeof(buf), fp)) { if (strstr(buf, "propolice") != NULL) { fprintf(inFile, "#define ProPoliceSupport YES\n"); break; } @@ -1334,40 +1334,41 @@ # endif #endif fprintf (inFile, "#define GccMajorVersion %d\n", __GNUC__); fprintf (inFile, "#define GccMinorVersion %d\n", __GNUC_MINOR__); } #if defined(HAS_MERGE_CONSTANTS) fprintf (inFile, "#define HasGccMergeConstants %d\n", HAS_MERGE_CONSTANTS); #endif } #endif static boolean get_gcc(char *cmd) { struct stat sb; static char* gcc_path[] = { # if defined(linux) || \ defined(__NetBSD__) || \ defined(__OpenBSD__) || \ defined(__FreeBSD__) || \ + defined(__DragonFly__) || \ defined(__APPLE__) || \ defined(__CYGWIN__) || \ defined(__MINGW32__) || \ defined(__GNU__) "/usr/bin/cc", /* for Linux PostIncDir */ # endif "/usr/local/bin/gcc", "/opt/gnu/bin/gcc", "/usr/pkg/bin/gcc" }; #ifdef CROSSCOMPILE static char* cross_cc_name[] = { "cc", "gcc" }; if (CrossCompiling) { int i; for (i = 0; i < sizeof (cross_cc_name) / sizeof cross_cc_name[0]; i++){ @@ -1673,41 +1674,41 @@ fprintf (inFile, "#define DefaultOSName Microsoft %s\n", os_names[osvi.dwPlatformId]); fprintf(inFile, "#define DefaultOSMajorVersion %d\n", osvi.dwMajorVersion); fprintf(inFile, "#define DefaultOSMinorVersion %d\n", osvi.dwMinorVersion); fprintf(inFile, "#define DefaultOSTeenyVersion %d\n", osvi.dwBuildNumber & 0xFFFF); } #endif /* WIN32 */ #ifdef CROSSCOMPILE else if (sys == emx) #endif #if defined CROSSCOMPILE || defined __UNIXOS2__ { fprintf(inFile, "#define DefaultOSMajorVersion 4\n"); fprintf(inFile, "#define DefaultOSMinorVersion 0\n"); fprintf(inFile, "#define DefaultOSTeenyVersion 0\n"); } #endif /* EMX */ -#if defined(__OpenBSD__) +#if defined(__OpenBSD__) || defined(__DragonFly__) get_stackprotector(inFile); #endif return FALSE; } void cppit(char *imakefile, char *template, char *masterc, FILE *outfd, char *outfname) { FILE *inFile; haveImakefileC = TRUE; inFile = fopen(masterc, "w"); if (inFile == NULL) LogFatal("Cannot open %s for output.", masterc); if (fprintf(inFile, "%s\n", ImakefileCHeader) < 0 || define_os_defaults(inFile) || optional_include(inFile, "IMAKE_LOCAL_DEFINES", "localdefines") || optional_include(inFile, "IMAKE_ADMIN_DEFINES", "admindefines") || fprintf(inFile, "#define %s <%s>\n", ImakeDefSym, imakefile) < 0 || Index: xc/config/imake/imakemdep.h =================================================================== RCS file: /cvs/xorg/xc/config/imake/imakemdep.h,v retrieving revision 1.8 diff -u -2 -0 -r1.8 imakemdep.h --- xc/config/imake/imakemdep.h 19 Jan 2005 22:28:20 -0000 1.8 +++ xc/config/imake/imakemdep.h 2 Mar 2005 11:13:47 -0000 @@ -277,41 +277,41 @@ #define DEFAULT_CPP "/usr/ccs/lib/cpp" #endif #if defined(sun) && (defined(SVR4) || defined(__svr4__) || defined(__SVR4) || defined(__sol__)) #define DEFAULT_CPP "/usr/ccs/lib/cpp" #endif #ifdef __bsdi__ #define DEFAULT_CPP "/usr/bin/cpp" #endif #ifdef __uxp__ #define DEFAULT_CPP "/usr/ccs/lib/cpp" #endif #ifdef __sxg__ #define DEFAULT_CPP "/usr/lib/cpp" #endif #ifdef _CRAY #define DEFAULT_CPP "/lib/pcpp" #endif #if defined(__386BSD__) #define DEFAULT_CPP "/usr/libexec/cpp" #endif -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) #define USE_CC_E #endif #if defined(__sgi) && defined(__ANSI_CPP__) #define USE_CC_E #endif #if defined(MACH) && !defined(__GNU__) #define USE_CC_E #endif #ifdef __minix_vmd #define DEFAULT_CPP "/usr/lib/cpp" #endif #if defined(__UNIXOS2__) /* expects cpp in PATH */ #define DEFAULT_CPP "cpp" #endif #ifdef __CYGWIN__ #define DEFAULT_CC "gcc" #define DEFAULT_CPP "/usr/bin/cpp" #endif #if defined (__QNX__) @@ -340,42 +340,42 @@ * b. Put this symbol in the definition of BootstrapCFlags in your * .cf file. * c. When doing a make World, always add "BOOTSTRAPCFLAGS=-Dsymbol" * to the end of the command line. * * Note that you may define more than one symbol (useful for platforms * that support multiple operating systems). */ #define ARGUMENTS 50 /* number of arguments in various arrays */ #if !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP) char *cpp_argv[ARGUMENTS] = { "cc", /* replaced by the actual program to exec */ "-I.", /* add current directory to include path */ #if !defined(__NetBSD_Version__) || __NetBSD_Version__ < 103080000 #ifdef unix "-Uunix", /* remove unix symbol so that filename unix.c okay */ #endif #endif #if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ - defined(__FreeBSD__) || defined(MACH) || defined(linux) || \ - defined(__GNU__) || defined(__bsdi__) || defined(__GNUC__) + defined(__FreeBSD__) || defined(__DragonFly__) || defined(MACH) || \ + defined(linux) || defined(__GNU__) || defined(__bsdi__) || defined(__GNUC__) # ifdef __i386__ "-D__i386__", # if defined(__GNUC__) && (__GNUC__ >= 3) "-m32", # endif # endif # ifdef __i486__ "-D__i486__", # endif # ifdef __i586__ "-D__i586__", # endif # ifdef __i686__ "-D__i686__", # endif # ifdef __k6__ "-D__k6__", # endif # ifdef __ia64__ "-D__ia64__", @@ -819,48 +819,48 @@ # define DEFAULT_OS_MAJOR_REV "r %[0-9]" # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]" # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]" # define DEFAULT_OS_NAME "srm %[^\n]" # if defined(__CYGWIN__) && defined (CROSSCOMPILE_CPP) # define CROSS_UTS_SYSNAME "Cygwin" # include # define CROSS_UTS_RELEASE "1.3.12" # endif # elif defined(__GNU__) # define DEFAULT_OS_MAJOR_REV "r %[0-9]" # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]" # define DEFAULT_OS_NAME "srm %[^\n]" # elif defined(ISC) /* ISC all Versions ? */ /* uname -r returns "x.y", e.g. "3.2" ,uname -v returns "x" e.g. "2" */ # define DEFAULT_OS_MAJOR_REV "r %[0-9]" # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]" # define DEFAULT_OS_TEENY_REV "v %[0-9]" /* # define DEFAULT_OS_NAME "srm %[^\n]" */ /* Not useful on ISC */ -# elif defined(__FreeBSD__) || defined(__OpenBSD__) +# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) /* BSD/OS too? */ /* uname -r returns "x.y[.z]-mumble", e.g. "2.1.5-RELEASE" or "2.2-0801SNAP" */ # define DEFAULT_OS_MAJOR_REV "r %[0-9]" # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]" # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]" # define DEFAULT_OS_NAME "srm %[^\n]" -# if defined(__FreeBSD__) +# if defined(__FreeBSD__) || defined(__DragonFly__) /* Use an alternate way to find the teeny version for -STABLE, -SNAP versions */ # ifndef CROSSCOMPILE_CPP # define DEFAULT_OS_TEENY_REV_FROB(buf, size) \ do { \ if (*buf == 0) { \ int __mib[2]; \ size_t __len; \ int __osrel; \ \ __mib[0] = CTL_KERN; \ __mib[1] = KERN_OSRELDATE; \ __len = sizeof(__osrel); \ sysctl(__mib, 2, &__osrel, &__len, NULL, 0); \ if (__osrel < 210000) { \ if (__osrel < 199607) \ buf[0] = '0'; \ else if (__osrel < 199612) \ buf[0] = '5'; \ else if (__osrel == 199612) \ buf[0] = '6'; \ @@ -1240,40 +1240,43 @@ {"__sgi", "1"}, #endif #ifdef _MIPS_FPSET {"_MIPS_FPSET", DEF_STRINGIFY(_MIPS_FPSET)}, #endif #ifdef _MIPS_ISA {"_MIPS_ISA", DEF_STRINGIFY(_MIPS_ISA)}, #endif #ifdef _MIPS_SIM {"_MIPS_SIM", DEF_STRINGIFY(_MIPS_SIM)}, #endif #ifdef _MIPS_SZINT {"_MIPS_SZINT", DEF_STRINGIFY(_MIPS_SZINT)}, #endif #ifdef _MIPS_SZLONG {"_MIPS_SZLONG", DEF_STRINGIFY(_MIPS_SZLONG)}, #endif #ifdef _MIPS_SZPTR {"_MIPS_SZPTR", DEF_STRINGIFY(_MIPS_SZPTR)}, #endif +#ifdef __DragonFly__ + {"__DragonFly__", "1"}, +#endif #ifdef __FreeBSD__ {"__FreeBSD__", "1"}, #endif #ifdef __OpenBSD__ {"__OpenBSD__", "1"}, #endif #ifdef __NetBSD__ {"__NetBSD__", "1"}, #endif #ifdef __GNU__ {"__GNU__", "1"}, #endif #ifdef __ELF__ {"__ELF__", "1"}, #endif #ifdef __UNIXOS2__ {"__UNIXOS2__", "1"}, #endif #if defined(__QNX__) {"__QNX__", "1"}, @@ -1421,53 +1424,56 @@ # else boolean remove_cpp_leadspace = FALSE; # endif # ifdef INLINE_SYNTAX boolean inline_syntax = TRUE; # else boolean inline_syntax = FALSE; # endif # ifdef MAGIC_MAKE_VARS boolean magic_make_vars = TRUE; # else boolean magic_make_vars = FALSE; # endif typedef enum { unknown, freeBSD, netBSD, LinuX, emx, - win32 + win32, + dragonfly } System; # ifdef linux System sys = LinuX; # elif defined __FreeBSD__ System sys = freebsd; # elif defined __NetBSD__ System sys = netBSD; # elif defined __EMX__ System sys = emx; # elif defined WIN32 System sys = win32; +# elif defined __DragonFly__ +System sys = dragonfly; # else System sys = unknown; # endif # if defined __GNUC__ int gnu_c = __GNUC__; int gnu_c_minor = __GNUC_MINOR__; # else int gnu_c = 0; int gnu_c_minor = -1; # endif # if defined linux # include int glibc_major = __GLIBC__ + 4; int glibc_minor = __GLIBC_MINOR__; # else int glibc_major = 0; int glibc_minor = -1; # endif # endif /* !CROSSCOMPILE || CROSSCOMPILE_CPP */ Index: xc/extras/drm/shared/drm.h =================================================================== RCS file: /cvs/xorg/xc/extras/drm/shared/drm.h,v retrieving revision 1.1.1.1 diff -u -2 -0 -r1.1.1.1 drm.h --- xc/extras/drm/shared/drm.h 16 Jun 2004 09:16:06 -0000 1.1.1.1 +++ xc/extras/drm/shared/drm.h 2 Mar 2005 11:14:00 -0000 @@ -29,41 +29,41 @@ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _DRM_H_ #define _DRM_H_ #if defined(__linux__) #include #include /* For _IO* macros */ #define DRM_IOCTL_NR(n) _IOC_NR(n) #define DRM_IOC_VOID _IOC_NONE #define DRM_IOC_READ _IOC_READ #define DRM_IOC_WRITE _IOC_WRITE #define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) && defined(IN_MODULE) /* Prevent name collision when including sys/ioccom.h */ #undef ioctl #include #define ioctl(a,b,c) xf86ioctl(a,b,c) #else #include #endif /* __FreeBSD__ && xf86ioctl */ #define DRM_IOCTL_NR(n) ((n) & 0xff) #define DRM_IOC_VOID IOC_VOID #define DRM_IOC_READ IOC_OUT #define DRM_IOC_WRITE IOC_IN #define DRM_IOC_READWRITE IOC_INOUT #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) #endif #define XFREE86_VERSION(major,minor,patch,snap) \ ((major << 16) | (minor << 8) | patch) #ifndef CONFIG_XFREE86_VERSION Index: xc/include/Xos_r.h =================================================================== RCS file: /cvs/xorg/xc/include/Xos_r.h,v retrieving revision 1.2 diff -u -2 -0 -r1.2 Xos_r.h --- xc/include/Xos_r.h 23 Apr 2004 18:43:05 -0000 1.2 +++ xc/include/Xos_r.h 2 Mar 2005 11:14:06 -0000 @@ -240,41 +240,41 @@ typedef int _Xgetpwparams; /* dummy */ # define _XGetpwuid(u,p) getpwuid((u)) # define _XGetpwnam(u,p) getpwnam((u)) #elif !defined(XOS_USE_MTSAFE_PWDAPI) || defined(XNO_MTSAFE_PWDAPI) /* UnixWare 2.0, or other systems with thread support but no _r API. */ # define X_NEEDS_PWPARAMS typedef struct { struct passwd pws; char pwbuf[1024]; struct passwd* pwp; size_t len; } _Xgetpwparams; /* * NetBSD and FreeBSD, at least, are missing several of the unixware passwd * fields. */ #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \ - defined(__APPLE__) + defined(__APPLE__) || defined(__DragonFly__) static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) { memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)); (p).pws.pw_name = (p).pwbuf; (p).len = strlen((p).pwp->pw_name); strcpy((p).pws.pw_name, (p).pwp->pw_name); (p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1; (p).len = strlen((p).pwp->pw_passwd); strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd); (p).pws.pw_class = (p).pws.pw_passwd + (p).len + 1; (p).len = strlen((p).pwp->pw_class); strcpy((p).pws.pw_class, (p).pwp->pw_class); (p).pws.pw_gecos = (p).pws.pw_class + (p).len + 1; (p).len = strlen((p).pwp->pw_gecos); strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos); @@ -410,41 +410,41 @@ # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_NETDBAPI) # define XOS_USE_MTSAFE_NETDBAPI 1 # endif #endif #if !defined(X_INCLUDE_NETDB_H) || defined(_XOS_INCLUDED_NETDB_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xgethostbynameparams; /* dummy */ typedef int _Xgetservbynameparams; /* dummy */ # define _XGethostbyname(h,hp) gethostbyname((h)) # define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t)) # define _XGetservbyname(s,p,sp) getservbyname((s),(p)) #elif !defined(XOS_USE_MTSAFE_NETDBAPI) || defined(XNO_MTSAFE_NETDBAPI) /* UnixWare 2.0, or other systems with thread support but no _r API. */ /* WARNING: The h_addr_list and s_aliases values are *not* copied! */ -#if defined(__NetBSD__) || defined(__FreeBSD__) +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) #include #endif typedef struct { struct hostent hent; char h_name[MAXHOSTNAMELEN]; struct hostent *hptr; } _Xgethostbynameparams; typedef struct { struct servent sent; char s_name[255]; char s_proto[255]; struct servent *sptr; } _Xgetservbynameparams; # define XTHREADS_NEEDS_BYNAMEPARAMS # define _Xg_copyHostent(hp) \ (memcpy(&(hp).hent, (hp).hptr, sizeof(struct hostent)), \ strcpy((hp).h_name, (hp).hptr->h_name), \ Index: xc/lib/xtrans/Xtranssock.c =================================================================== RCS file: /cvs/xorg/xc/lib/xtrans/Xtranssock.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 Xtranssock.c --- xc/lib/xtrans/Xtranssock.c 15 Nov 2004 15:06:56 -0000 1.3 +++ xc/lib/xtrans/Xtranssock.c 2 Mar 2005 11:14:09 -0000 @@ -74,44 +74,44 @@ #ifdef UNIXCONN #ifndef X_NO_SYS_UN #ifndef Lynx #include #else #include #endif #endif #include #endif #if defined(hpux) || (defined(MOTOROLA) && defined(SYSV)) #define NO_TCP_H #endif #ifndef NO_TCP_H #if defined(__osf__) || defined(linux) || defined(AIXV5) #include #endif /* osf */ -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) +#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) #include #include -#endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ */ +#endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ || __DragonFly__ */ #include #endif /* !NO_TCP_H */ #include #if defined(SVR4) && !defined(SCO325) && !defined(DGUX) && !defined(_SEQUENT_) #include #endif #if (defined(i386) && defined(SYSV)) && !defined(sco) && !defined(sun) #include #endif #if (defined(i386) && defined(SYSV)) && (!defined(ISC) || !defined(I_NREAD) || defined(SCO325)) || defined(_SEQUENT_) #include #endif #else /* !WIN32 */ #include #include Index: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v retrieving revision 1.4 diff -u -2 -0 -r1.4 xf86_OSlib.h --- xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h 28 Jul 2004 03:57:19 -0000 1.4 +++ xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h 2 Mar 2005 11:14:14 -0000 @@ -423,60 +423,60 @@ # include # if !defined(LINKKIT) /* Don't need this stuff for the Link Kit */ # if defined(__bsdi__) # include # define CONSOLE_X_MODE_ON PCCONIOCRAW # define CONSOLE_X_MODE_OFF PCCONIOCCOOK # define CONSOLE_X_BELL PCCONIOCBEEP # else /* __bsdi__ */ # if defined(__OpenBSD__) # ifdef PCCONS_SUPPORT # include # undef CONSOLE_X_MODE_ON # undef CONSOLE_X_MODE_OFF # undef CONSOLE_X_BELL # endif # endif # ifdef SYSCONS_SUPPORT # define COMPAT_SYSCONS -# if defined(__NetBSD__) || defined(__OpenBSD__) +# if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) # include # else # if defined(__FreeBSD__) # include # if __FreeBSD_version >= 410000 # include # include # else # include # endif /* FreeBSD 4.1 RELEASE or lator */ # else # include # endif # endif # endif /* SYSCONS_SUPPORT */ # if defined(PCVT_SUPPORT) # if !defined(SYSCONS_SUPPORT) /* no syscons, so include pcvt specific header file */ -# if defined(__FreeBSD__) +# if defined(__FreeBSD__) || defined(__DragonFly__) # include # else # if defined(__NetBSD__) || defined(__OpenBSD__) # if !defined(WSCONS_SUPPORT) # include # endif /* WSCONS_SUPPORT */ # else # include # endif /* __NetBSD__ */ # endif /* __FreeBSD__ || __OpenBSD__ */ # else /* pcvt and syscons: hard-code the ID magic */ # define VGAPCVTID _IOWR('V',113, struct pcvtid) struct pcvtid { char name[16]; int rmajor, rminor; }; # endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */ # endif /* PCVT_SUPPORT */ # ifdef WSCONS_SUPPORT # include Index: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v retrieving revision 1.2 diff -u -2 -0 -r1.2 xf86_libc.h --- xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h 23 Apr 2004 19:54:07 -0000 1.2 +++ xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h 2 Mar 2005 11:14:15 -0000 @@ -552,41 +552,43 @@ #undef stdin #define stdin xf86stdin #undef stdout #define stdout xf86stdout #undef stderr #define stderr xf86stderr #undef SEEK_SET #define SEEK_SET XF86_SEEK_SET #undef SEEK_CUR #define SEEK_CUR XF86_SEEK_CUR #undef SEEK_END #define SEEK_END XF86_SEEK_END /* * XXX Basic I/O functions BAD,BAD,BAD! */ #define open xf86open #define close(a) xf86close(a) #define lseek(a,b,c) xf86lseek(a,b,c) +#if !defined(__DragonFly__) #define ioctl(a,b,c) xf86ioctl(a,b,c) +#endif #define read(a,b,c) xf86read(a,b,c) #define write(a,b,c) xf86write(a,b,c) #define mmap(a,b,c,d,e,f) xf86mmap(a,b,c,d,e,f) #define munmap(a,b) xf86munmap(a,b) #define stat(a,b) xf86stat(a,b) #define fstat(a,b) xf86fstat(a,b) #define access(a,b) xf86access(a,b) #undef O_RDONLY #define O_RDONLY XF86_O_RDONLY #undef O_WRONLY #define O_WRONLY XF86_O_WRONLY #undef O_RDWR #define O_RDWR XF86_O_RDWR #undef O_CREAT #define O_CREAT XF86_O_CREAT #undef PROT_EXEC #define PROT_EXEC XF86_PROT_EXEC #undef PROT_READ #define PROT_READ XF86_PROT_READ #undef PROT_WRITE Index: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 lnx_agp.c --- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c 4 Dec 2004 00:43:10 -0000 1.3 +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c 2 Mar 2005 11:14:16 -0000 @@ -1,41 +1,41 @@ /* * Abstraction of the AGP GART interface. * * This version is for both Linux and FreeBSD. * * Copyright © 2000 VA Linux Systems, Inc. * Copyright © 2001 The XFree86 Project, Inc. */ /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.11 2003/04/03 22:47:42 dawes Exp $ */ #include "X.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" #if defined(linux) #include #include -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) #include #include #endif #ifndef AGP_DEVICE #define AGP_DEVICE "/dev/agpgart" #endif /* AGP page size is independent of the host page size. */ #ifndef AGP_PAGE_SIZE #define AGP_PAGE_SIZE 4096 #endif #define AGPGART_MAJOR_VERSION 0 #define AGPGART_MINOR_VERSION 99 static int gartFd = -1; static int acquiredScreen = -1; static Bool initDone = FALSE; /* * Close /dev/agpgart. This frees all associated memory allocated during * this server generation. Index: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 xf86drmCompat.c --- xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c 16 Jun 2004 09:39:15 -0000 1.3 +++ xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c 2 Mar 2005 11:14:17 -0000 @@ -61,52 +61,52 @@ # define _DRM_MALLOC Xmalloc # define _DRM_FREE Xfree # endif #endif /* Not all systems have MAP_FAILED defined */ #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) #endif #ifdef __linux__ #include /* for makedev() */ #endif #include "xf86drm.h" #include "xf86drmCompat.h" #include "drm.h" #include "mga_drm.h" #include "r128_drm.h" #include /* for int64_t & friends */ #include "radeon_drm.h" -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__DragonFly__) #include "sis_drm.h" #include "i810_drm.h" #include "i830_drm.h" #endif /* WARNING: Do not change, or add, anything to this file. It is only provided * for binary backwards compatability with the old driver specific DRM * extensions used before XFree86 4.3. */ -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__DragonFly__) /* I810 */ Bool drmI810CleanupDma(int driSubFD) { drm_i810_init_t init; memset(&init, 0, sizeof(drm_i810_init_t)); init.func = I810_CLEANUP_DMA; if(ioctl(driSubFD, DRM_IOCTL_I810_INIT, &init)) { return 0; /* FALSE */ } return 1; /* TRUE */ } Bool drmI810InitDma(int driSubFD, drmCompatI810Init *info) { drm_i810_init_t init; @@ -996,41 +996,41 @@ } } int drmRadeonFlushIndirectBuffer( int fd, int index, int start, int end, int discard ) { drm_radeon_indirect_t ind; ind.idx = index; ind.start = start; ind.end = end; ind.discard = discard; if ( ioctl( fd, DRM_IOCTL_RADEON_INDIRECT, &ind ) < 0 ) { return -errno; } else { return 0; } } -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__DragonFly__) /* SiS */ Bool drmSiSAgpInit(int driSubFD, int offset, int size) { drm_sis_agp_t agp; agp.offset = offset; agp.size = size; ioctl(driSubFD, DRM_IOCTL_SIS_AGP_INIT, &agp); return 1; /* TRUE */ } /* I830 */ Bool drmI830CleanupDma(int driSubFD) { drm_i830_init_t init; memset(&init, 0, sizeof(drm_i830_init_t));