From db248ffb840a0c113b6eb508a0fa1e74e752474d Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 16 Mar 2008 18:46:11 +0100 Subject: [PATCH] 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). --- configure.ac | 7 +++++++ hw/xfree86/os-support/bsd/i386_video.c | 2 ++ include/xorg-config.h.in | 3 +++ 3 files changed, 12 insertions(+) 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