$NetBSD: patch-aa,v 1.3 2009/05/18 19:09:01 hasso Exp $ --- configure.ac.orig 2009-04-25 02:19:43 +0300 +++ configure.ac 2009-05-18 08:34:40 +0300 @@ -66,10 +66,10 @@ case $host_os in *netbsd*) case $host in *i386*) - PCIACCESS_LIBS="-li386" + PCIACCESS_LIBS="-li386 $PCIACCESS_LIBS" ;; *x86_64*|*amd64*) - PCIACCESS_LIBS="-lx86_64" + PCIACCESS_LIBS="-lx86_64 $PCIACCESS_LIBS" ;; esac netbsd=yes @@ -91,7 +91,21 @@ AM_CONDITIONAL(SOLARIS, [test "x$solaris AC_SYS_LARGEFILE +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_MSG_ERROR(sysarch.h not found)]) +AC_CHECK_HEADERS([machine/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"], +[#ifdef HAVE_MACHINE_SYSARCH_H +#include +#include +#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])