[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force X.Org X11 SVN commit: r439 - in trunk/debian: . patches patches/freebsd



Author: dnusinow
Date: 2005-07-30 16:28:37 -0500 (Sat, 30 Jul 2005)
New Revision: 439

Added:
   trunk/debian/patches/freebsd/001_gnu-kbsd.diff
   trunk/debian/patches/freebsd/002_gnu-kbsd_wacom.diff
Modified:
   trunk/debian/changelog
   trunk/debian/patches/series
Log:
- More GNU/kFreeBSD fixes
  - Add megapatch freebsd/001 and wacom fixes in freebsd/002


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2005-07-30 21:09:00 UTC (rev 438)
+++ trunk/debian/changelog	2005-07-30 21:28:37 UTC (rev 439)
@@ -32,6 +32,7 @@
          on non-linux platforms
        - Miscellaneous fixes to xserver-xorg.config.in
        - Update MANIFEST and various .install files
+       - Add megapatch freebsd/001 and wacom fixes in freebsd/002
 
   Changes by Eugene Konev:
      - Do not impose selinux on the whole world out there: move selinux 

Added: trunk/debian/patches/freebsd/001_gnu-kbsd.diff
===================================================================
--- trunk/debian/patches/freebsd/001_gnu-kbsd.diff	2005-07-30 21:09:00 UTC (rev 438)
+++ trunk/debian/patches/freebsd/001_gnu-kbsd.diff	2005-07-30 21:28:37 UTC (rev 439)
@@ -0,0 +1,1185 @@
+Index: xc/config/cf/Imake.cf
+===================================================================
+--- xc/config/cf/Imake.cf.orig	2005-07-26 01:11:28.000000000 -0400
++++ xc/config/cf/Imake.cf	2005-07-30 17:19:00.000000000 -0400
+@@ -699,11 +699,13 @@
+ # define Win32Architecture
+ #endif /* WIN32 */
+ 
+-#ifdef linux 
++#if defined(linux) || defined(__GLIBC__)
+ # define MacroIncludeFile <linux.cf>
+ # define MacroFile linux.cf
+ # undef linux
+-# define LinuxArchitecture
++# ifdef __linux__
++#  define LinuxArchitecture
++# endif
+ # ifdef i386
+ #  ifndef i386Architecture
+ #   define i386Architecture
+@@ -928,7 +930,7 @@
+ #   define AMD64Architecture
+ #  endif
+ # endif
+-#endif /* linux */
++#endif /* linux || __GLIBC__ */
+ 
+ #if (defined(__Lynx__) || defined(Lynx)) && (defined(i386) || defined(__i386__) || defined(__x86__) || defined(__powerpc__) || defined(__sparc__) || defined(sparc))
+ # define MacroIncludeFile <lynx.cf>
+@@ -1008,9 +1010,7 @@
+ #endif /* minix */
+ 
+ /* Systems with GNU libc and userland */
+-#if defined(__GNU__) || defined(__GNU_userland__) || \
+-  defined(__GNU_KFreeBSD__) || \
+-  defined(__GNU_KNetBSD__) || defined(__GNU_KOpenBSD__)
++#if defined(__GNU__)
+ #define GNUArchitecture
+ #define MacroIncludeFile <gnu.cf>
+ #define MacroFile gnu.cf
+Index: xc/config/cf/linux.cf
+===================================================================
+--- xc/config/cf/linux.cf.orig	2005-07-30 17:13:28.000000000 -0400
++++ xc/config/cf/linux.cf	2005-07-30 17:19:00.000000000 -0400
+@@ -261,13 +261,14 @@
+ #  define HasXdmAuth			YES
+ 
+ /* Glide2 only works on i386. */
+-#  ifdef i386Architecture
++#  if defined(__linux__) && defined(i386Architecture)
+ #   define HasGlide2			YES
+ #   define Glide2IncDir		/usr/include/glide
+ #  endif /* i386Architecture */
+ /* Glide3 only works on alpha, amd64, i386 and ia64. */
+-#  if defined(i386Architecture) || defined(AlphaArchitecture) || \
+-      defined(ia64Architecture) || defined(AMD64Architecture)
++#  if defined(__linux__) && (defined(i386Architecture) || \
++      defined(AlphaArchitecture) || defined(ia64Architecture) || \
++      defined(AMD64Architecture))
+ #   define HasGlide3			YES
+ #   define Glide3IncDir		/usr/include/glide3
+ #  endif /* i386Architecture || AlphaArchitecture || ia64Architecture ||
+@@ -374,22 +375,23 @@
+ 
+ /* <linux/input.h> support mainly for USB support */
+ #ifndef HasLinuxInput
+-# if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 4)
++# if defined(__linux__) && (OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 4))
+ #  define HasLinuxInput YES
+ # else
+ #  define HasLinuxInput NO
+ # endif
+ #endif
+ 
+-/* <linux/joystick.h> appeared in 2.1.45 (officially) */
+ #ifndef JoystickSupport
+ # define JoystickSupport	NO	/* joystick driver is broken */
+ #endif
++
++/* <linux/joystick.h> appeared in 2.1.45 (officially) */
+ #ifndef HasLinuxSupport
+-# if JoystickSupport || \
++# if defined(__linux__) && (JoystickSupport || \
+      (OSMajorVersion > 2) || \
+      ((OSMajorVersion == 2) && (OSMinorVersion > 1)) || \
+-     ((OSMajorVersion == 2) && (OSMinorVersion == 1) && (OSTeenyVersion >= 45))
++     ((OSMajorVersion == 2) && (OSMinorVersion == 1) && (OSTeenyVersion >= 45)))
+ #  define HasLinuxJoystick	YES
+ # else
+ #  define HasLinuxJoystick	NO
+@@ -414,9 +416,9 @@
+ #endif
+ 
+ #ifndef XF86INT10_BUILD
+-# if defined (i386Architecture)
++# if defined(__linux__) && defined(i386Architecture)
+ #  define XF86INT10_BUILD	X86VM
+-# elif defined (AMD64Architecture)
++# elif defined(__linux__) && defined(AMD64Architecture)
+ #  define XF86INT10_BUILD	X86EMU_OS
+ # else
+ #  define XF86INT10_BUILD	X86EMU_GENERIC
+@@ -433,7 +435,9 @@
+ #  elif defined(HPArchitecture)
+ #    define BuildXF86DRI	NO
+ #  elif defined(i386Architecture)
+-#    if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 2)
++#    if (defined(__linux__) && (OSMajorVersion > 2 || (OSMajorVersion == 2 && \
++        OSMinorVersion >= 2))) || \
++        defined(__FreeBSD_kernel__)
+ #      define BuildXF86DRI	YES
+ #    else
+ #      define BuildXF86DRI	NO
+@@ -538,7 +542,7 @@
+ # define BuildXF86RushExt	YES
+ #endif
+ 
+-#ifndef LinuxFBDevSupport
++#if defined(__linux__) && !defined(LinuxFBDevSupport)
+ # define LinuxFBDevSupport	YES
+ #endif
+ 
+@@ -861,7 +865,11 @@
+ #endif
+ 
+ #ifndef XF86OSCardDrivers
+-# define XF86OSCardDrivers	fbdev v4l
++# ifdef __linux__
++#  define XF86OSCardDrivers	fbdev v4l
++# else
++#  define XF86OSCardDrivers	/**/
++# endif
+ #endif
+ 
+ #ifndef OSXInputDrivers
+@@ -1041,7 +1049,11 @@
+ #endif /* AMD64Architecture */
+ 
+ #ifndef StandardDefines
+-# define StandardDefines	-Dlinux LinuxMachineDefines LinuxSourceDefines
++# ifdef __linux__
++#  define StandardDefines	-Dlinux LinuxMachineDefines LinuxSourceDefines
++# else
++#  define StandardDefines	LinuxMachineDefines LinuxSourceDefines
++# endif
+ #endif
+ 
+ #if UseElfFormat
+Index: xc/config/cf/xfree86.cf
+===================================================================
+--- xc/config/cf/xfree86.cf.orig	2005-07-30 17:13:28.000000000 -0400
++++ xc/config/cf/xfree86.cf	2005-07-30 17:19:00.000000000 -0400
+@@ -1666,7 +1666,8 @@
+ # if SystemV || SystemV4 || \
+     defined(LinuxArchitecture) || \
+     defined(i386BsdArchitecture) || defined(LynxOSArchitecture) || \
+-    defined(OS2Architecture) || defined(GNUMachArchitecture)
++    defined(OS2Architecture) || defined(GNUMachArchitecture) || \
++    defined(KFreeBSDArchitecture)
+ #   define BuildScanpci		YES
+ # else
+ #   define BuildScanpci		NO
+@@ -1772,9 +1773,9 @@
+ #endif
+ 
+ #ifndef XFree86ConsoleDefines
+-# if defined(i386BsdArchitecture) || defined(AlphaBsdArchitecture)
++# if defined(i386BsdArchitecture) || defined(AlphaBsdArchitecture) || (defined(KFreeBSDArchitecture) && defined(i386Architecture))
+ #  define XFree86ConsoleDefines	-DPCCONS_SUPPORT -DSYSCONS_SUPPORT -DPCVT_SUPPORT
+-# elif defined(FreeBSDArchitecture)
++# elif defined(KFreeBSDArchitecture)
+ #  define XFree86ConsoleDefines -DSYSCONS_SUPPORT
+ # else
+ #  define XFree86ConsoleDefines	/**/
+Index: xc/config/cf/xorg.cf
+===================================================================
+--- xc/config/cf/xorg.cf.orig	2005-07-30 17:13:09.000000000 -0400
++++ xc/config/cf/xorg.cf	2005-07-30 17:19:00.000000000 -0400
+@@ -1310,7 +1310,8 @@
+ # if SystemV || SystemV4 || \
+     (defined(LinuxArchitecture) && !defined(Mc68020Architecture)) || \
+     defined(i386BsdArchitecture) || defined(LynxOSArchitecture) || \
+-    defined(OS2Architecture) || defined(GNUMachArchitecture)
++    defined(OS2Architecture) || defined(GNUMachArchitecture) || \
++    defined(KFreeBSDArchitecture)
+ #   define BuildScanpci		YES
+ # else
+ #   define BuildScanpci		NO
+@@ -1417,9 +1418,9 @@
+ #endif
+ 
+ #ifndef XFree86ConsoleDefines
+-# if defined(i386BsdArchitecture) || defined(AlphaBsdArchitecture)
++# if defined(i386BsdArchitecture) || defined(AlphaBsdArchitecture) || (defined(KFreeBSDArchitecture) && defined(i386Architecture))
+ #  define XFree86ConsoleDefines	-DPCCONS_SUPPORT -DSYSCONS_SUPPORT -DPCVT_SUPPORT
+-# elif defined(FreeBSDArchitecture)
++# elif defined(KFreeBSDArchitecture)
+ #  define XFree86ConsoleDefines -DSYSCONS_SUPPORT
+ # else
+ #  define XFree86ConsoleDefines	/**/
+Index: xc/config/imake/imake.c
+===================================================================
+--- xc/config/imake/imake.c.orig	2005-07-30 17:13:28.000000000 -0400
++++ xc/config/imake/imake.c	2005-07-30 17:19:00.000000000 -0400
+@@ -251,7 +251,7 @@
+ #  define SYS_NMLN 257
+ # endif
+ #endif
+-#if defined(linux) || defined(__GNU__)
++#if defined(linux) || defined(__GNU__) || defined(__GLIBC__)
+ #include <limits.h>
+ #include <stdio.h>
+ #endif
+@@ -913,7 +913,7 @@
+ }
+ #endif
+ 
+-#if defined linux
++#if defined(linux) || defined(__GLIBC__)
+ const char *libc_c=
+ "#include <stdio.h>\n"
+ "#include <ctype.h>\n"
+@@ -1048,7 +1048,7 @@
+ #endif
+ 	
+ 
+-#if defined CROSSCOMPILE || defined linux
++#if defined CROSSCOMPILE || defined linux || defined(__GLIBC__)
+ static void
+ get_distrib(FILE *inFile)
+ {
+@@ -1360,7 +1360,8 @@
+      defined(__OpenBSD__) || \
+      defined(__FreeBSD__) || \
+      defined(__APPLE__) || \
+-     defined(__GNU__)
++     defined(__GNU__) || \
++     defined(__GLIBC__)
+ 	"/usr/bin/cc",	/* for Linux PostIncDir */
+ # endif
+ 	"/usr/local/bin/gcc",
+@@ -1449,7 +1450,7 @@
+ 	  else
+ 	      name = &uts_name;
+       }
+-#if defined CROSSCOMPILE && defined linux
++#if defined CROSSCOMPILE && (defined linux || defined(__GLIBC__))
+       else {
+ 	  strncpy(uts_name.sysname,cross_uts_sysname,SYS_NMLN);
+ 	  strncpy(uts_name.release,cross_uts_release,SYS_NMLN);
+@@ -1606,13 +1607,13 @@
+ # if defined CROSSCOMPILE
+       if (CrossCompiling && sys == LinuX)
+ # endif
+-# if defined CROSSCOMPILE || defined linux
+-#  ifdef CROSSCOMPILE
++# if defined CROSSCOMPILE || defined linux || defined(__GLIBC__)
++#  if defined(CROSSCOMPILE) && defined(__linux__)
+ 	if (sys == LinuX)
+ #  endif
+ 	  get_distrib (inFile);
+ # endif
+-# if defined linux
++# if defined linux || defined(__GLIBC__)
+ #  if defined CROSSCOMPILE
+       if (!CrossCompiling)
+ #  endif
+@@ -1626,9 +1627,9 @@
+ 	  fprintf(inFile,"#define DefaultLinuxCLibTeenyVersion 0\n");
+       }
+ #  endif
+-# endif /* linux */
+-# if defined CROSSCOMPILE || defined linux
+-#  if defined CROSSCOMPILE
++# endif /* linux || __GLIBC__ */
++# if defined CROSSCOMPILE || defined linux || defined(__GLIBC__)
++#  if defined CROSSCOMPILE && defined(__linux__)
+       if (sys == LinuX)
+ #  endif
+ 	  get_ld_version(inFile);
+Index: xc/config/imake/imakemdep.h
+===================================================================
+--- xc/config/imake/imakemdep.h.orig	2005-05-08 23:33:34.000000000 -0400
++++ xc/config/imake/imakemdep.h	2005-07-30 17:19:00.000000000 -0400
+@@ -349,7 +349,8 @@
+ #endif
+ #if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
+     defined(__FreeBSD__) || defined(MACH) || defined(linux) || \
+-    defined(__GNU__) || defined(__bsdi__) || defined(__GNUC__)
++    defined(__GNU__) || defined(__bsdi__) || defined(__GNUC__) || \
++    defined(__GLIBC__)
+ # ifdef __i386__
+ 	"-D__i386__",
+ #  if defined(__GNUC__) && (__GNUC__ >= 3)
+@@ -816,7 +817,7 @@
+ #  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(__FreeBSD_kernel__) || defined(__OpenBSD__)
+ /* 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]"
+@@ -1411,7 +1412,7 @@
+   win32
+ } System;
+ 
+-#   ifdef linux
++#   if defined(linux) || defined(__GLIBC__)
+ System sys = LinuX;
+ #   elif defined __FreeBSD__
+ System sys = freebsd;
+@@ -1432,7 +1433,7 @@
+ int gnu_c = 0;
+ int gnu_c_minor = -1;
+ #   endif
+-#   if defined linux
++#   if defined(linux) || defined(__GLIBC__)
+ #    include <features.h>
+ int glibc_major = __GLIBC__ + 4;
+ int glibc_minor = __GLIBC_MINOR__;
+Index: xc/extras/drm/shared/drm.h
+===================================================================
+--- xc/extras/drm/shared/drm.h.orig	2005-07-30 17:13:04.000000000 -0400
++++ xc/extras/drm/shared/drm.h	2005-07-30 17:19:00.000000000 -0400
+@@ -48,15 +48,15 @@
+ #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__)
+-#if defined(__FreeBSD__) && defined(IN_MODULE)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(IN_MODULE)
+ /* Prevent name collision when including sys/ioccom.h */
+ #undef ioctl
+ #include <sys/ioccom.h>
+ #define ioctl(a,b,c)		xf86ioctl(a,b,c)
+ #else
+ #include <sys/ioccom.h>
+-#endif /* __FreeBSD__ && xf86ioctl */
++#endif /* __FreeBSD_kernel__ && xf86ioctl */
+ #define DRM_IOCTL_NR(n)		((n) & 0xff)
+ #define DRM_IOC_VOID		IOC_VOID
+ #define DRM_IOC_READ		IOC_OUT
+Index: xc/lib/GL/dri/drm/Imakefile
+===================================================================
+--- xc/lib/GL/dri/drm/Imakefile.orig	2005-05-08 23:36:10.000000000 -0400
++++ xc/lib/GL/dri/drm/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -25,7 +25,7 @@
+ OS_SUBDIR2 = linux
+ OS_SUBDIR3 = shared
+ #endif
+-#if defined(FreeBSDArchitecture) || defined(BSDOSArchitecture) || \
++#if defined(KFreeBSDArchitecture) || defined(BSDOSArchitecture) || \
+     defined(NetBSDArchitecture) || defined(OpenBSDArchitecture)
+ OS_SUBDIR = bsd
+ OS_SUBDIR2 = linux
+Index: xc/lib/xtrans/Xtranssock.c
+===================================================================
+--- xc/lib/xtrans/Xtranssock.c.orig	2005-05-08 23:35:35.000000000 -0400
++++ xc/lib/xtrans/Xtranssock.c	2005-07-30 17:19:00.000000000 -0400
+@@ -88,7 +88,7 @@
+ #endif 
+ 
+ #ifndef NO_TCP_H
+-#if defined(__osf__) || defined(linux) || defined(AIXV5)
++#if defined(__osf__) || defined(linux) || defined(__GLIBC__) || defined(AIXV5)
+ #include <sys/param.h>
+ #endif /* osf */
+ #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) 
+Index: xc/programs/Xserver/hw/vfb/Imakefile
+===================================================================
+--- xc/programs/Xserver/hw/vfb/Imakefile.orig	2005-05-08 23:25:44.000000000 -0400
++++ xc/programs/Xserver/hw/vfb/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -17,6 +17,7 @@
+     SystemV4 || \
+     defined(OSF1Architecture) || \
+     defined(i386BsdArchitecture) || \
++    defined(KFreeBSDArchitecture) || \
+     defined(LinuxArchitecture) || \
+     defined(DarwinArchitecture)
+ MMAPDEF = -DHAS_MMAP
+Index: xc/programs/Xserver/hw/xfree86/Imakefile
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/Imakefile.orig	2005-05-08 23:25:12.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -154,7 +154,7 @@
+ DPI75USFONTPATH=\"$(LIBDIR)/fonts/75dpi/:unscaled\"
+ DPI100USFONTPATH=\"$(LIBDIR)/fonts/100dpi/:unscaled\"
+ 
+-#ifdef FreeBSDArchitecture
++#ifdef KFreeBSDArchitecture
+   FREEBSDMOUSEDEV="    Option	\"Device\"	\"/dev/mse0\""
+ #else
+   FREEBSDMOUSEDEV="XCOMM    Option	\"Device\"	\"/dev/mse0\""
+Index: xc/programs/Xserver/hw/xfree86/common/Imakefile
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/common/Imakefile.orig	2005-07-30 17:13:08.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/common/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -19,7 +19,7 @@
+ #else
+ # if defined(i386BsdArchitecture) || defined(AlphaBsdArchitecture) \
+ 	|| defined(OpenBSDArchitecture) || defined(NetBSDArchitecture) \
+-	|| defined(FreeBSDArchitecture)
++	|| defined(KFreeBSDArchitecture)
+         KBD = xf86KbdBSD
+ # else
+ #  ifdef LinuxArchitecture
+Index: xc/programs/Xserver/hw/xfree86/common/xf86Config.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/common/xf86Config.c.orig	2005-07-30 17:13:19.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/common/xf86Config.c	2005-07-30 17:19:00.000000000 -0400
+@@ -79,7 +79,8 @@
+ #endif
+ 
+ #if (defined(i386) || defined(__i386__)) && \
+-    (defined(__FreeBSD__) || defined(__NetBSD__) || defined(linux) || \
++    (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
++     defined(__NetBSD__) || defined(linux) || \
+      (defined(SVR4) && !defined(sun)) || defined(__GNU__))
+ #define SUPPORT_PC98
+ #endif
+Index: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/common/xf86Configure.c.orig	2005-05-08 23:22:38.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/common/xf86Configure.c	2005-07-30 17:19:00.000000000 -0400
+@@ -79,7 +79,7 @@
+ #elif defined(__QNXNTO__)
+ static char *DFLT_MOUSE_PROTO = "OSMouse";
+ static char *DFLT_MOUSE_DEV = "/dev/devi/mouse0";
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ static char *DFLT_MOUSE_DEV = "/dev/sysmouse";
+ static char *DFLT_MOUSE_PROTO = "auto";
+ #else
+Index: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h.orig	2005-05-08 23:22:38.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h	2005-07-30 17:19:00.000000000 -0400
+@@ -120,7 +120,7 @@
+     /* graphics part */
+     Bool		sharedMonitor;
+     ScreenPtr		currentScreen;
+-#ifdef CSRG_BASED
++#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
+     int			screenFd;	/* fd for memory mapped access to
+ 					 * vga card */
+     int			consType;	/* Which console driver? */
+@@ -222,7 +222,7 @@
+ #define XCOMP	((unsigned long) 0x00008000)
+ 
+ /* BSD console driver types (consType) */
+-#ifdef CSRG_BASED
++#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
+ #define PCCONS		   0
+ #define CODRV011	   1
+ #define CODRV01X	   2
+Index: xc/programs/Xserver/hw/xfree86/input/joystick/Imakefile
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/input/joystick/Imakefile.orig	2005-05-08 23:21:40.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/input/joystick/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -15,7 +15,7 @@
+         ARCH_JSTK = ../os-support/linux/lnx_jstk.o
+ #endif
+ 
+-#if defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || defined(OpenBSDArchitecture)
++#if defined(KFreeBSDArchitecture) || defined(NetBSDArchitecture) || defined(OpenBSDArchitecture)
+         ARCH_JSTK = ../os-support/bsd/bsd_jstk.o
+ #endif
+ 
+Index: xc/programs/Xserver/hw/xfree86/os-support/Imakefile
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/Imakefile.orig	2005-05-08 23:21:32.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -63,7 +63,7 @@
+ OS_SUBDIR = lynxos
+ #endif
+ 
+-#if defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || \
++#if defined(KFreeBSDArchitecture) || defined(NetBSDArchitecture) || \
+     defined(OpenBSDArchitecture)
+ OS_SUBDIR = bsd
+ #endif
+Index: xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile.orig	2005-05-08 23:21:31.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -8,7 +8,7 @@
+ 
+ #include <Server.tmpl>
+ 
+-#if defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || defined(OpenBSDArchitecture)
++#if defined(KFreeBSDArchitecture) || defined(NetBSDArchitecture) || defined(OpenBSDArchitecture)
+ #if BuildXInputExt
+ # if JoystickSupport
+  JOYSTICK_SRC = bsd_jstk.c
+@@ -47,7 +47,7 @@
+   IOPERM_SRC = ioperm_noop.c
+   IOPERM_OBJ = ioperm_noop.o
+ # endif
+-#elif defined(FreeBSDArchitecture)
++#elif defined(KFreeBSDArchitecture)
+ # if defined(i386Architecture) || defined(AMD64Architecture)
+   IOPERMDEFINES = -DUSE_DEV_IO
+ # elif defined(AlphaBsdArchitecture)
+@@ -106,7 +106,7 @@
+ APMOBJ = pm_noop.o
+ #endif
+ 
+-#if defined(FreeBSDArchitecture) && (OSMajorVersion > 2)
++#if defined(KFreeBSDArchitecture) && (OSMajorVersion > 2)
+ KMODSRC = bsd_kmod.c
+ KMODOBJ = bsd_kmod.o
+ #else
+@@ -127,7 +127,7 @@
+ AXP_OBJ=bsd_ev56.o xf86Axp.o bsd_axp.o
+ #endif
+ 
+-#if (defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || \
++#if (defined(KFreeBSDArchitecture) || defined(NetBSDArchitecture) || \
+ 	defined(OpenBSDArchitecture)) && HasAgpGart
+ AGP_SRC=lnx_agp.c
+ AGP_OBJ=lnx_agp.o
+@@ -219,7 +219,7 @@
+ LinkSourceFile(vidmem.c,../shared)
+ LinkSourceFile(sigio.c,../shared)
+ LinkSourceFile(kmod_noop.c,../shared)
+-#if (defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || \
++#if (defined(KFreeBSDArchitecture) || defined(NetBSDArchitecture) || \
+ 	defined(OpenBSDArchitecture)) && HasAgpGart
+ LinkSourceFile(lnx_agp.c,../linux)
+ #else
+Index: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c.orig	2005-05-08 23:21:31.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c	2005-07-30 17:19:00.000000000 -0400
+@@ -33,7 +33,7 @@
+ #include <sys/param.h>
+ #ifndef __NetBSD__
+ #  include <sys/sysctl.h>
+-#  ifdef __FreeBSD__
++#  if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #      include <machine/sysarch.h>
+ #   endif
+ # else
+@@ -395,7 +395,7 @@
+ }
+ 
+ 
+-#if defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+ 
+ extern int ioperm(unsigned long from, unsigned long num, int on);
+ 
+@@ -412,7 +412,7 @@
+ 	return;
+ }
+ 
+-#endif /* __FreeBSD__ || __OpenBSD__ */
++#endif /* __FreeBSD_kernel__ || __OpenBSD__ */
+ 
+ #ifdef USE_ALPHA_PIO
+ 
+@@ -486,7 +486,7 @@
+ static void
+ writeSparse32(int Value, pointer Base, register unsigned long Offset);
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ extern int sysarch(int, char *);
+ #endif
+ 
+@@ -498,7 +498,7 @@
+ static int
+ sethae(u_int64_t hae)
+ {
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #ifndef ALPHA_SETHAE
+ #define ALPHA_SETHAE 0
+ #endif
+Index: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c.orig	2005-05-08 23:21:31.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c	2005-07-30 17:19:00.000000000 -0400
+@@ -34,7 +34,9 @@
+ #include "xf86_OSlib.h"
+ 
+ #include <sys/utsname.h>
++#include <sys/ioctl.h>
+ #include <stdlib.h>
++#include <errno.h>
+ 
+ static Bool KeepTty = FALSE;
+ static int devConsoleFd = -1;
+@@ -76,6 +78,10 @@
+ #define WSCONS_PCVT_COMPAT_CONSOLE_DEV "/dev/ttyE0"
+ #endif
+ 
++#ifdef __GLIBC__
++#define setpgrp setpgid
++#endif
++
+ #define CHECK_DRIVER_MSG \
+   "Check your kernel's console driver configuration and /dev entries"
+ 
+@@ -235,11 +241,11 @@
+ 	     * switching anymore. Here we check for FreeBSD 3.1 and up.
+ 	     * Add cases for other *BSD that behave the same.
+ 	    */
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	    uname (&uts);
+-	    if (strcmp(uts.sysname, "FreeBSD") == 0) {
+-		i = atof(uts.release) * 100;
+-		if (i >= 310) goto acquire_vt;
+-	    }
++	    i = atof(uts.release) * 100;
++	    if (i >= 310) goto acquire_vt;
++#endif
+ 	    /* otherwise fall through */
+ 	case PCVT:
+ 	    /*
+Index: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c.orig	2005-05-08 23:21:31.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c	2005-07-30 17:19:00.000000000 -0400
+@@ -34,6 +34,8 @@
+ #include "xf86Priv.h"
+ #include "xf86_OSlib.h"
+ 
++#include <termios.h>
++
+ #ifdef WSCONS_SUPPORT
+ #define KBD_FD(i) ((i).kbdFd != -1 ? (i).kbdFd : (i).consoleFd)
+ #endif
+@@ -144,7 +146,7 @@
+ }
+ 
+ #if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
+-static struct termio kbdtty;
++static struct termios kbdtty;
+ #endif
+ 
+ void
+Index: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c.orig	2005-05-08 23:21:31.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c	2005-07-30 17:19:00.000000000 -0400
+@@ -23,6 +23,8 @@
+ #include "atKeynames.h"
+ #include "bsd_kbd.h"
+ 
++#include <termios.h>
++
+ extern Bool VTSwitchEnabled;
+ #ifdef USE_VT_SYSREQ
+ extern Bool VTSysreqToggle;
+@@ -37,7 +39,7 @@
+ };
+ 
+ typedef struct {
+-   struct termio kbdtty;
++   struct termios kbdtty;
+ } BsdKbdPrivRec, *BsdKbdPrivPtr;
+ 
+ static
+@@ -70,10 +72,16 @@
+     KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+     int real_leds = 0;
+ 
++#ifdef LED_CAP
+     if (leds & XLED1)  real_leds |= LED_CAP;
++#endif
++#ifdef LED_NUM
+     if (leds & XLED2)  real_leds |= LED_NUM;
++#endif
++#ifdef LED_SCR
+     if (leds & XLED3)  real_leds |= LED_SCR;
+     if (leds & XLED4)  real_leds |= LED_SCR;
++#endif
+ 
+     switch (pKbd->consType) {
+ 
+@@ -115,9 +123,15 @@
+ #endif
+     }
+ 
++#ifdef LED_CAP
+     if (real_leds & LED_CAP) leds |= XLED1;
++#endif
++#ifdef LED_NUM
+     if (real_leds & LED_NUM) leds |= XLED2;
++#endif
++#ifdef LED_SCR
+     if (real_leds & LED_SCR) leds |= XLED3;
++#endif
+ 
+     return(leds);
+ }
+@@ -307,16 +321,20 @@
+              case KEY_F8:
+              case KEY_F9:
+              case KEY_F10:
++#ifdef VT_ACTIVATE
+                   if (down) {
+                     ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
+                     return TRUE;
+                   }
++#endif
+              case KEY_F11:
+              case KEY_F12:
++#ifdef VT_ACTIVATE
+                   if (down) {
+                     ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
+                     return TRUE;
+                   }
++#endif
+          }
+       }
+     }
+Index: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c.orig	2005-05-08 23:21:31.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c	2005-07-30 17:19:00.000000000 -0400
+@@ -68,7 +68,7 @@
+ static void usbSigioReadInput (int fd, void *closure);
+ #endif
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ /* These are for FreeBSD */
+ #define DEFAULT_MOUSE_DEV		"/dev/mouse"
+ #define DEFAULT_SYSMOUSE_DEV		"/dev/sysmouse"
+@@ -97,7 +97,7 @@
+ {
+ #if defined(__NetBSD__)
+     return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+     return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC;
+ #else
+     return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
+@@ -120,7 +120,7 @@
+  * main "mouse" driver.
+  */
+ static const char *miscNames[] = {
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	"SysMouse",
+ #endif
+ 	NULL
+@@ -149,7 +149,7 @@
+ static const char *
+ DefaultProtocol(void)
+ {
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+     return "Auto";
+ #elif defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+     return "WSMouse";
+@@ -158,7 +158,7 @@
+ #endif
+ }
+ 
+-#if defined(__FreeBSD__) && defined(MOUSE_PROTO_SYSMOUSE)
++#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(MOUSE_PROTO_SYSMOUSE)
+ static struct {
+ 	int dproto;
+ 	const char *name;
+@@ -227,7 +227,7 @@
+     mode.rate = rate > 0 ? rate : -1;
+     mode.resolution = res > 0 ? res : -1;
+     mode.accelfactor = -1;
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+     if (pMse->autoProbe ||
+ 	(protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
+ 	/*
+@@ -245,7 +245,7 @@
+ }
+ #endif
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 
+ #define MOUSED_PID_FILE "/var/run/moused.pid"
+ 
+@@ -769,7 +769,7 @@
+     p->BuiltinNames = BuiltinNames;
+     p->DefaultProtocol = DefaultProtocol;
+     p->CheckProtocol = CheckProtocol;
+-#if defined(__FreeBSD__) && defined(MOUSE_PROTO_SYSMOUSE)
++#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(MOUSE_PROTO_SYSMOUSE)
+     p->SetupAuto = SetupAuto;
+     p->SetPS2Res = SetSysMouseRes;
+     p->SetBMRes = SetSysMouseRes;
+@@ -779,7 +779,7 @@
+     p->SetupAuto = SetupAuto;
+     p->SetMiscRes = SetMouseRes;
+ #endif
+-#if defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+     p->FindDevice = FindDevice;
+ #endif
+     p->PreInit = bsdMousePreInit;
+Index: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile.orig	2005-05-08 23:21:29.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -14,7 +14,7 @@
+ MTRR_DEFINES = -DHAS_MTRR_SUPPORT
+ #endif
+ 
+-#if defined(FreeBSDArchitecture)
++#if defined(KFreeBSDArchitecture)
+ COMPATSRC = xf86drmCompat.c
+ COMPATOBJ = xf86drmCompat.o
+ OS_SUBDIR = freebsd
+Index: xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c.orig	2005-05-08 23:21:31.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c	2005-07-30 17:19:00.000000000 -0400
+@@ -30,6 +30,9 @@
+ #include "xf86.h"
+ #include "xf86Priv.h"
+ 
++#include <errno.h>
++#include <sys/mman.h>
++
+ #ifdef HAS_MTRR_SUPPORT
+ #ifndef __NetBSD__
+ #include <sys/types.h>
+Index: xc/programs/Xserver/hw/xfree86/os-support/bus/Imakefile
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/bus/Imakefile.orig	2005-07-30 17:13:23.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bus/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -81,7 +81,7 @@
+ PCIDRVRSRC = ix86Pci.c linuxPci.c
+ PCIDRVROBJ = ix86Pci.o linuxPci.o
+ 
+-#elif defined(FreeBSDArchitecture) && \
++#elif defined(KFreeBSDArchitecture) && \
+ 	(defined(AlphaArchitecture) || defined(AMD64Architecture))
+ 
+ XCOMM generic FreeBSD PCI driver (using /dev/pci)
+@@ -89,7 +89,7 @@
+ PCIDRVRSRC = freebsdPci.c
+ PCIDRVROBJ = freebsdPci.o
+ 
+-#elif defined(FreeBSDArchitecture) && defined(Sparc64Architecture)
++#elif defined(KFreeBSDArchitecture) && defined(Sparc64Architecture)
+ 
+ XCOMM Sparc SBUS & PCI drivers
+ 
+Index: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c.orig	2005-05-08 23:21:21.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c	2005-07-30 17:19:00.000000000 -0400
+@@ -86,7 +86,7 @@
+ 
+ #include "xf86drm.h"
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define DRM_MAJOR 145
+ #endif
+ 
+Index: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c.orig	2005-05-08 23:21:21.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c	2005-07-30 17:19:00.000000000 -0400
+@@ -78,7 +78,7 @@
+ #include "r128_drm.h"
+ #include <inttypes.h>		/* for int64_t & friends */
+ #include "radeon_drm.h"
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+ #include "sis_drm.h"
+ #include "i810_drm.h"
+ #include "i830_drm.h"
+@@ -89,7 +89,7 @@
+  * extensions used before XFree86 4.3.
+  */
+ 
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+ /* I810 */
+ 
+ Bool drmI810CleanupDma(int driSubFD)
+@@ -134,7 +134,7 @@
+    }
+    return 1; /* TRUE */
+ }
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD_kernel__ */
+ 
+ /* Mga */
+ 
+@@ -1013,7 +1013,7 @@
+    }
+ }
+ 
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+ /* SiS */
+ 
+ Bool drmSiSAgpInit(int driSubFD, int offset, int size)
+@@ -1072,7 +1072,7 @@
+    }
+    return 1; /* TRUE */
+ }
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD_kernel__ */
+ 
+ /* WARNING: Do not change, or add, anything to this file.  It is only provided
+  * for binary backwards compatability with the old driver specific DRM
+Index: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c.orig	2005-05-08 23:21:22.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c	2005-07-30 17:19:00.000000000 -0400
+@@ -18,7 +18,7 @@
+ #if defined(linux)
+ #include <asm/ioctl.h>
+ #include <linux/agpgart.h>
+-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#elif defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <sys/ioctl.h>
+ #include <sys/agpio.h>
+ #endif
+Index: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h
+===================================================================
+--- xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h.orig	2005-05-08 23:21:32.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h	2005-07-30 17:19:00.000000000 -0400
+@@ -335,12 +335,24 @@
+ #endif /* DGUX && SVR4 */
+ 
+ /**************************************************************************/
+-/* Linux                                                                  */
++/* Linux or Glibc-based system                                            */
+ /**************************************************************************/
+-#if defined(linux)
++#if defined(__linux__) || defined(__GLIBC__)
+ # include <sys/ioctl.h>
+ # include <signal.h>
+-# include <termio.h>
++# include <stdlib.h>
++# include <sys/types.h>
++# include <assert.h>
++
++#ifdef __GNU__ /* GNU/Hurd */
++# define USE_OSMOUSE
++#endif
++
++# ifdef __linux__
++#  include <termio.h>
++# else /* __GLIBC__ */
++#  include <termios.h>
++# endif
+ # ifdef __sparc__
+ #  include <sys/param.h>
+ # endif
+@@ -349,20 +361,21 @@
+ 
+ # include <sys/stat.h>
+ 
+-# define HAS_USL_VTS
+ # include <sys/mman.h>
+-# include <sys/kd.h>
+-# include <sys/vt.h>
+-# define LDGMAP GIO_SCRNMAP
+-# define LDSMAP PIO_SCRNMAP
+-# define LDNMAP LDSMAP
+-
+-# define CLEARDTR_SUPPORT
+-# define USE_VT_SYSREQ
++# ifdef __linux__
++#  define HAS_USL_VTS
++#  include <sys/kd.h>
++#  include <sys/vt.h>
++#  define LDGMAP GIO_SCRNMAP
++#  define LDSMAP PIO_SCRNMAP
++#  define LDNMAP LDSMAP
++#  define CLEARDTR_SUPPORT
++#  define USE_VT_SYSREQ
++# endif
+ 
+ # define POSIX_TTY
+ 
+-#endif /* linux */
++#endif /* __linux__ || __GLIBC__ */
+ 
+ /**************************************************************************/
+ /* LynxOS AT                                                              */
+@@ -422,6 +435,30 @@
+ 
+ # include <errno.h>
+ 
++# include <sys/types.h>
++# include <sys/mman.h>
++# include <sys/stat.h>
++
++# if defined(__bsdi__)
++#  include <sys/param.h>
++# if (_BSDI_VERSION < 199510)
++#  include <i386/isa/vgaioctl.h>
++# endif
++# endif /* __bsdi__ */
++
++#endif /* CSRG_BASED */
++
++/**************************************************************************/
++/* Kernel of *BSD                                                         */
++/**************************************************************************/
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
++ defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
++
++# include <sys/param.h>
++# if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
++#  define __FreeBSD_kernel_version __FreeBSD_version
++# endif
++
+ # if !defined(LINKKIT)
+   /* Don't need this stuff for the Link Kit */
+ #  if defined(__bsdi__)
+@@ -443,9 +480,8 @@
+ #    if defined(__NetBSD__) || defined(__OpenBSD__)
+ #     include <machine/console.h>
+ #    else
+-#     if defined(__FreeBSD__)
+-#        include <osreldate.h>
+-#        if __FreeBSD_version >= 410000
++#     if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++#        if (__FreeBSD_kernel_version >= 410000)
+ #          include <sys/consio.h>
+ #          include <sys/kbio.h>
+ #        else
+@@ -459,7 +495,7 @@
+ #   if defined(PCVT_SUPPORT)
+ #    if !defined(SYSCONS_SUPPORT)
+       /* no syscons, so include pcvt specific header file */
+-#     if defined(__FreeBSD__)
++#     if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #      include <machine/pcvt_ioctl.h>
+ #     else
+ #      if defined(__NetBSD__) || defined(__OpenBSD__)
+@@ -469,7 +505,7 @@
+ #      else
+ #       include <sys/pcvt_ioctl.h>
+ #      endif /* __NetBSD__ */
+-#     endif /* __FreeBSD__ || __OpenBSD__ */
++#     endif /* __FreeBSD_kernel__ || __OpenBSD__ */
+ #    else /* pcvt and syscons: hard-code the ID magic */
+ #     define VGAPCVTID _IOWR('V',113, struct pcvtid)
+       struct pcvtid {
+@@ -482,9 +518,8 @@
+ #    include <dev/wscons/wsconsio.h>
+ #    include <dev/wscons/wsdisplay_usl_io.h>
+ #   endif /* WSCONS_SUPPORT */
+-#   if defined(__FreeBSD__)
+-#    include <osreldate.h>
+-#    if __FreeBSD_version >= 500013
++#   if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++#    if (__FreeBSD_kernel_version >= 500013)
+ #     include <sys/mouse.h>
+ #    else
+ #     undef MOUSE_GETINFO
+@@ -523,17 +558,6 @@
+ #  endif /* __bsdi__ */
+ # endif /* !LINKKIT */
+ 
+-# include <sys/types.h>
+-# include <sys/mman.h>
+-# include <sys/stat.h>
+-
+-# if defined(__bsdi__)
+-#  include <sys/param.h>
+-# if (_BSDI_VERSION < 199510)
+-#  include <i386/isa/vgaioctl.h>
+-# endif
+-# endif /* __bsdi__ */
+-
+ #if defined(USE_I386_IOPL) || defined(USE_AMD64_IOPL)
+ #include <machine/sysarch.h>
+ #endif
+@@ -544,7 +568,8 @@
+ #  define USE_VT_SYSREQ
+ # endif
+ 
+-#endif /* CSRG_BASED */
++#endif
++/* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ || __bsdi__ */
+ 
+ /**************************************************************************/
+ /* OS/2                                                                   */
+@@ -654,25 +679,6 @@
+ #endif
+ 
+ /**************************************************************************/
+-/* GNU/Hurd								  */
+-/**************************************************************************/
+-#if defined(__GNU__)
+-
+-#include <stdlib.h>
+-#include <sys/types.h>
+-#include <errno.h>
+-#include <signal.h>
+-#include <sys/ioctl.h>
+-#include <termios.h>
+-#include <sys/stat.h>
+-#include <assert.h>
+-
+-#define POSIX_TTY
+-#define USE_OSMOUSE
+-
+-#endif /* __GNU__ */
+-
+-/**************************************************************************/
+ /* IRIX                                                                   */
+ /**************************************************************************/
+ #if defined(sgi)
+Index: xc/programs/xdm/config/Imakefile
+===================================================================
+--- xc/programs/xdm/config/Imakefile.orig	2005-07-30 17:13:08.000000000 -0400
++++ xc/programs/xdm/config/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -10,7 +10,7 @@
+ 
+ all:: Xservers.ws xdm-config Xservers Xresources
+ 
+-#if (defined(i386Architecture) || defined(AMD64Architecture)) && (defined(KNetBSDArchitecture) || defined(KOpenBSDArchitecture))
++#if (defined(i386Architecture) || defined(AMD64Architecture)) && (defined(NetBSDArchitecture) || defined(OpenBSDArchitecture))
+ DEFAULTVT=vt05
+ #endif
+ 
+Index: xc/programs/xload/get_load.c
+===================================================================
+--- xc/programs/xload/get_load.c.orig	2005-05-08 23:29:19.000000000 -0400
++++ xc/programs/xload/get_load.c	2005-07-30 17:19:00.000000000 -0400
+@@ -406,7 +406,7 @@
+ }
+ #else /* not KVM_ROUTINES */
+ 
+-#ifdef linux
++#if defined(linux) || defined(__FreeBSD_kernel__)
+ 
+ void InitLoadPoint()
+ {
+Index: xc/util/memleak/Imakefile
+===================================================================
+--- xc/util/memleak/Imakefile.orig	2005-05-08 23:41:31.000000000 -0400
++++ xc/util/memleak/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -42,7 +42,7 @@
+ GRA_SRCS = getreti386.c stackbottom.c
+ #endif
+ 
+-#ifdef LinuxArchitecture
++#if defined(LinuxArchitecture) || defined(__GLIBC__)
+ #ifdef i386Architecture
+ #define HasGetReturnAddress	YES
+ #define TopOfStack 0xbffff800
+Index: xc/programs/Xserver/Xprint/etc/init.d/Imakefile
+===================================================================
+--- xc/programs/Xserver/Xprint/etc/init.d/Imakefile.orig	2005-05-08 23:19:55.000000000 -0400
++++ xc/programs/Xserver/Xprint/etc/init.d/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -55,7 +55,7 @@
+ #endif /* defined(SunArchitecture) && (OSMajorVersion > 4) */
+ 
+ XCOMM Create startup/shutdown links in /etc/init.d/ for Linux
+-#if defined(LinuxArchitecture)
++#if defined(LinuxArchitecture) || (LinuxDistribution == LinuxDebian)
+ # if (LinuxDistribution == LinuxSuSE) || \
+      (LinuxDistribution == LinuxDebian) || \
+      (LinuxDistribution == LinuxUnknown)
+Index: xc/programs/Xserver/Xprint/etc/Xsession.d/Imakefile
+===================================================================
+--- xc/programs/Xserver/Xprint/etc/Xsession.d/Imakefile.orig	2005-05-08 23:19:55.000000000 -0400
++++ xc/programs/Xserver/Xprint/etc/Xsession.d/Imakefile	2005-07-30 17:19:00.000000000 -0400
+@@ -18,7 +18,7 @@
+ XCOMM Install xdm startup glue for Xprint on Linux. Note that not all Linux
+ XCOMM platforms have /etc/X11/Xsession.d/ and/or /etc/X11/xinit/xinitrc.d
+ XCOMM (see http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=182)
+-#if defined(LinuxArchitecture)
++#if defined(LinuxArchitecture) || (LinuxDistribution == LinuxDebian)
+ InstallNamedProg(cde_xsessiond_xprint.sh,92xprint-xpserverlist.sh,$(ETCDIR)/X11/Xsession.d)
+ InstallNamedProg(cde_xsessiond_xprint.sh,92xprint-xpserverlist.sh,$(ETCDIR)/X11/xinit/xinitrc.d)
+ #endif

Added: trunk/debian/patches/freebsd/002_gnu-kbsd_wacom.diff
===================================================================
--- trunk/debian/patches/freebsd/002_gnu-kbsd_wacom.diff	2005-07-30 21:09:00 UTC (rev 438)
+++ trunk/debian/patches/freebsd/002_gnu-kbsd_wacom.diff	2005-07-30 21:28:37 UTC (rev 439)
@@ -0,0 +1,28 @@
+diff -ur xc.old/programs/Xserver/hw/xfree86/input/wacom/wcmCommon.c xc/programs/Xserver/hw/xfree86/input/wacom/wcmCommon.c
+--- xc.old/programs/Xserver/hw/xfree86/input/wacom/wcmCommon.c	2005-07-18 21:14:56.000000000 +0200
++++ xc/programs/Xserver/hw/xfree86/input/wacom/wcmCommon.c	2005-07-18 21:21:35.000000000 +0200
+@@ -825,7 +825,11 @@
+ 	if (pChannel->nSamples < 4) ++pChannel->nSamples;
+ 
+ 	/* don't send the first sample due to the first USB package issue*/
+-	if ( (pChannel->nSamples != 1) || (common->wcmDevCls != &gWacomUSBDevice) )
++	if ( (pChannel->nSamples != 1)
++#ifdef LINUX_INPUT
++             || (common->wcmDevCls != &gWacomUSBDevice)
++#endif
++           )
+ 	{
+ 		commonDispatchDevice(common,channel,pChannel);
+ 		resetSampleCounter(pChannel);
+diff -ur xc.old/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.h xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.h
+--- xc.old/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.h	2005-07-18 21:14:56.000000000 +0200
++++ xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.h	2005-07-18 21:21:35.000000000 +0200
+@@ -453,7 +453,7 @@
+ 	int bufpos;                        /* position with buffer */
+ 	unsigned char buffer[BUFFER_SIZE]; /* data read from device */
+ 
+-#if LINUX_INPUT
++#ifdef LINUX_INPUT
+ 	int wcmEventCnt;
+ 	struct input_event wcmEvents[MAX_USB_EVENTS];  /* events for current change */
+ #endif

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2005-07-30 21:09:00 UTC (rev 438)
+++ trunk/debian/patches/series	2005-07-30 21:28:37 UTC (rev 439)
@@ -133,6 +133,8 @@
 netbsd/842_netbsd_NetBSD.cf_fixes.diff -p0
 netbsd/843_netbsd_no_shared_OldX_lib.diff -p0
 netbsd/844_netbsd_no_kbd_mode_command.diff -p0
+freebsd/001_gnu-kbsd.diff -p0
+freebsd/002_gnu-kbsd_wacom.diff -p0
 debian/900_debian_config.diff -p0
 debian/902_debian_startx_manpage.diff -p0
 debian/903_debian_system.twmrc.diff -p0



Reply to: