Files
pkgsrc-ng/sysutils/libpciaccess/patches/patch-configure.ac
2013-09-26 17:14:40 +02:00

52 lines
1.3 KiB
Plaintext

$NetBSD: patch-configure.ac,v 1.1 2013/05/15 03:20:15 richard Exp $
configure: Remove AM_MAINTAINER_MODE
Check for libpci and mtrr headers on NetBSD.
--- configure.ac.orig 2012-04-09 17:04:39.000000000 +0000
+++ configure.ac
@@ -30,7 +30,6 @@ AC_CONFIG_HEADERS([config.h])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
AC_USE_SYSTEM_EXTENSIONS
# Initialize libtool
@@ -77,11 +77,11 @@ case $host_os in
;;
*netbsd*)
case $host in
- *i386*)
- PCIACCESS_LIBS="-li386"
+ *i[[3-9]]86*)
+ PCIACCESS_LIBS="-li386 $PCIACCESS_LIBS"
;;
*x86_64*|*amd64*)
- PCIACCESS_LIBS="-lx86_64"
+ PCIACCESS_LIBS="-lx86_64 $PCIACCESS_LIBS"
;;
esac
netbsd=yes
@@ -109,7 +109,20 @@ AC_SYS_LARGEFILE
AC_CHECK_HEADERS([err.h])
+if test "x$netbsd" = xyes; then
+AC_CHECK_LIB([pci], [pcibus_conf_read],
+ [PCIACCESS_LIBS="-lpci $PCIACCESS_LIBS"],
+ [AC_MSG_ERROR(check for libpci failed.)])
+AC_CHECK_HEADERS([machine/sysarch.h])
+AC_CHECK_HEADERS([machine/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"],
+[#ifdef HAVE_MACHINE_SYSARCH_H
+#include <sys/types.h>
+#include <machine/sysarch.h>
+#endif
+])
+else
AC_CHECK_HEADER([asm/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"])
+fi
if test "x$have_mtrr_h" = xyes; then
AC_DEFINE(HAVE_MTRR, 1, [Use MTRRs on mappings])