void-packages/templates/libpciaccess-netbsd-support.diff
Juan RP b2dee1f637 Added NetBSD support to libpciaccess.
While fixing this, I had to make autoconf, automake and m4
templates (latest versions).

xorg-server-1.5.1 now fully works on NetBSD with these patches!

--HG--
extra : convert_revision : a80bb709a48a3cd144c596170d24fdfc7f7feede
2008-10-06 21:11:03 +02:00

73 lines
2.2 KiB
Diff

--- src/common_init.c.orig 2008-10-06 18:22:05.000000000 +0200
+++ src/common_init.c 2008-10-06 18:22:30.000000000 +0200
@@ -56,6 +56,8 @@
err = pci_system_linux_sysfs_create();
#elif defined(__FreeBSD__) || defined(__DragonFly__)
err = pci_system_freebsd_create();
+#elif defined(__NetBSD__)
+ err = pci_system_netbsd_create();
#elif defined(__OpenBSD__)
err = pci_system_openbsd_create();
#elif defined(__sun)
--- src/common_interface.c.orig 2008-10-06 18:22:55.000000000 +0200
+++ src/common_interface.c 2008-10-06 18:23:15.000000000 +0200
@@ -64,7 +64,7 @@
#define HTOLE_16(x) htole16(x)
#define HTOLE_32(x) htole32(x)
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
#define LETOH_16(x) le16toh(x)
#define LETOH_32(x) le32toh(x)
#else
--- src/Makefile.am.orig 2008-10-06 18:23:58.000000000 +0200
+++ src/Makefile.am 2008-10-06 18:24:44.000000000 +0200
@@ -33,6 +33,10 @@
OS_SUPPORT = freebsd_pci.c
endif
+if NETBSD
+OS_SUPPORT = netbsd_pci.c
+endif
+
if OPENBSD
OS_SUPPORT = openbsd_pci.c
endif
--- src/pciaccess_private.h.orig 2008-10-06 18:31:23.000000000 +0200
+++ src/pciaccess_private.h 2008-10-06 18:31:42.000000000 +0200
@@ -136,6 +136,7 @@ extern struct pci_system * pci_sys;
extern int pci_system_linux_sysfs_create( void );
extern int pci_system_freebsd_create( void );
+extern int pci_system_netbsd_create( void );
extern int pci_system_openbsd_create( void );
extern void pci_system_openbsd_init_dev_mem( int );
extern int pci_system_solx_devfs_create( void );
--- configure.ac.orig 2008-06-10 21:24:44.000000000 +0200
+++ configure.ac 2008-10-06 18:44:45.000000000 +0200
@@ -77,6 +77,17 @@ case $host_os in
*linux*)
linux=yes
;;
+ *netbsd*)
+ case $host in
+ *i386*)
+ PCIACCESS_LIBS="-li386"
+ ;;
+ *x86_64*|*amd64*)
+ PCIACCESS_LIBS="-lx86_64"
+ ;;
+ esac
+ netbsd=yes
+ ;;
*openbsd*)
openbsd=yes
;;
@@ -88,6 +99,7 @@ esac
AM_CONDITIONAL(LINUX, [test "x$linux" = xyes])
AM_CONDITIONAL(FREEBSD, [test "x$freebsd" = xyes])
+AM_CONDITIONAL(NETBSD, [test "x$netbsd" = xyes])
AM_CONDITIONAL(OPENBSD, [test "x$openbsd" = xyes])
AM_CONDITIONAL(SOLARIS, [test "x$solaris" = xyes])