]> mj.ucw.cz Git - pciutils.git/commitdiff
Extended the fbsd-device backend to run on Dragonfly BSD.
authorMartin Mares <mj@ucw.cz>
Wed, 12 Sep 2007 19:26:56 +0000 (21:26 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 12 Sep 2007 19:26:56 +0000 (21:26 +0200)
ChangeLog
lib/configure
lib/fbsd-device.c
lspci.c

index 181074a95c96fa05e9528a15cfceaa65832e1cf9..69ea70f69b8b72a7536f2ba16910077c10c098d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-12  Hasso Tepper <hasso@estpak.ee>
+
+       * Extended the fbsd-device backend to run on Dragonfly BSD.
+
+       * lspci.c: alloca() is declared in <stdlib.h> on BSD's, not <alloca.h>.
+
 2007-09-03  Martin Mares <mj@ucw.cz>
 
        * Resurrected the Windows port, including cross-compilation by MinGW.
index 91bd03e35609b3ad5be816cda238da95b6967444..7c25c4210647491a5c87693ea54f2a69f8bba349 100755 (executable)
@@ -22,7 +22,7 @@ then
 else
        cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/'`
 fi
-if [ "$sys" = "GNU/kFreeBSD" ]
+if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ]
 then
        sys=freebsd
 fi
index 46fa7a2d15719d6a0b31f3fb7d481d1dba763fa9..b770c58a220ed5ba1e7237c38e81dde98b16745a 100644 (file)
 #  endif
 #endif
 
-#if __FreeBSD_version < 500000
+#if defined(__DragonFly__)
+#  include <bus/pci/pcivar.h>
+#elif __FreeBSD_version < 500000
 #  include <pci/pcivar.h>
 #else
 #  include <dev/pci/pcivar.h>
 #endif
 
-#if __FreeBSD_version < 430000
+#if __FreeBSD_version < 430000 && !defined(__DragonFly__)
 #  include <pci/pci_ioctl.h>
 #else
 #  include <sys/pciio.h>
diff --git a/lspci.c b/lspci.c
index 9ec1056d9e98d5c24f7066464a50aaa9e120a3d5..d29da87e9b0254f313e7ddec8c2fa450b8985bff 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -58,8 +58,9 @@ static struct pci_access *pacc;
  *  This increases our memory footprint, but only slightly since we don't
  *  use alloca() much.
  */
-
-#if defined(__GNUC__) && !defined(PCI_OS_WINDOWS)
+#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__DragonFly__)
+/* alloca() is defined in stdlib.h */
+#elif defined(__GNUC__) && !defined(PCI_OS_WINDOWS)
 #include <alloca.h>
 #else
 #undef alloca