summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2008-03-16 18:46:11 +0100
committerMatthieu Herrb <matthieu@reactor.herrb.net>2008-03-16 18:46:11 +0100
commitdb248ffb840a0c113b6eb508a0fa1e74e752474d (patch)
tree60e2e3f7197b748d10a008267f6be67f0001d6b9
parentaa231f28d56402d7daea6cbd3002fbf760f79497 (diff)
test for the presence of pci_system_init_dev_mem() before calling it.
This avoids creating a dependency on -current libpciaccess for BSD systems other than OpenBSD (which don't otherwise need it).
-rw-r--r--configure.ac7
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c2
-rw-r--r--include/xorg-config.h.in3
3 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 5417bbbda..49f2395fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1308,6 +1308,13 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then
XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XPSTUBS_LIB $SELINUX_LIB"
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+ SAVE_LIBS=$LIBS
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS=$PCIACCESS_CFLAGS
+ LIBS=$PCIACCESS_LIBS
+ AC_CHECK_FUNCS([pci_system_init_dev_mem])
+ LIBS=$SAVE_LIBS
+ CFLAGS=$SAVE_CFLAGS
XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS"
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 7e4a4d2a3..1ebac678d 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -212,8 +212,10 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
pVidMem->mapMem = mapVidMem;
pVidMem->unmapMem = unmapVidMem;
+#if HAVE_PCI_SYSTEM_INIT_DEV_MEM
if (useDevMem)
pci_system_init_dev_mem(devMemFd);
+#endif
#ifdef HAS_MTRR_SUPPORT
if (useDevMem) {
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index 0603eab67..5587c0a8d 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -115,6 +115,9 @@
/* Have execinfo.h */
#undef HAVE_EXECINFO_H
+/* Have pci_system_init_dev_mem() */
+#undef HAVE_PCI_SYSTEM_INIT_DEV_MEM
+
/* Path to text files containing PCI IDs */
#undef PCI_TXT_IDS_PATH