Mailinglist Archive: radeonhd (529 mails)

< Previous Next >
[radeonhd] [PATCH 1/2] Let pkg-config look for PCIUTILS/libpci
  • From: Hans Ulrich Niedermann <hun@xxxxxxxxxxxxxxxx>
  • Date: Mon, 3 Dec 2007 19:15:43 +0100
  • Message-id: <1196705744-10704-1-git-send-email-hun@xxxxxxxxxxxxxxxx>
From: Coleman Kane <cokane@xxxxxxxxxx>

Coleman Kane reports that on FreeBSD, libpci is installed at
/usr/local, and so we'd need a -L/usr/local/lib. This switches
the responsibility for detecting the libpci location to the
libpci.pc file.
---
configure.ac | 11 +++++++++++
utils/conntest/Makefile.am | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2eb7cba..d2ea67f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,12 +48,21 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Header files checks.
AC_HEADER_STDC

+PKG_CHECK_MODULES(PCIUTILS, libpci,,
+ [AC_MSG_WARN([libpci not registered in pkgconfig])])
+
+SAVED_CPPFLAGS="$CPPFLAGS"
+SAVED_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $PCIUTILS_CFLAGS"
+CPPFLAGS="$CPPFLAGS $PCIUTILS_CFLAGS"
AC_CHECK_HEADER([pci/pci.h],
[AC_DEFINE([HAVE_PCI_PCI_H], [1],
[Define to 1 if you have <pci/pci.h>.])
have_pci_pci_h=yes],
[AC_MSG_WARN([Caution: Will not compile rhd_conntest without
pciutils headers.])])
AM_CONDITIONAL([HAVE_PCI_PCI_H], [test "x$have_pci_pci_h" = "xyes"])
+CFLAGS="$SAVED_CFLAGS"
+CPPFLAGS="$SAVED_CPPFLAGS"

SAVED_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $XORG_CFLAGS"
@@ -180,6 +189,8 @@ esac

# Substitute

+AC_SUBST([PCIUTILS_CFLAGS])
+AC_SUBST([PCIUTILS_LIBS])
AC_SUBST([XORG_CFLAGS])
AC_SUBST([WARN_CFLAGS])
AC_SUBST([PEDANTIC_CFLAGS])
diff --git a/utils/conntest/Makefile.am b/utils/conntest/Makefile.am
index 4a858aa..9f1ddcc 100644
--- a/utils/conntest/Makefile.am
+++ b/utils/conntest/Makefile.am
@@ -19,9 +19,9 @@ all-local:
fi

# Including config.h requires xorg-config.h, so we need the XORG_CFLAGS here
-AM_CFLAGS = @XORG_CFLAGS@ @WARN_CFLAGS@
+AM_CFLAGS = @XORG_CFLAGS@ @WARN_CFLAGS@ @PCIUTILS_CFLAGS@
AM_CPPFLAGS = -I$(top_srcdir)/src/AtomBios/includes

rhd_conntest_SOURCES = rhd_conntest.c
nodist_rhd_conntest_SOURCES = git_version.h
-rhd_conntest_LDADD = -lz -lpci
+rhd_conntest_LDADD = -lz @PCIUTILS_LIBS@ -lpci
--
1.5.3.4

--
To unsubscribe, e-mail: radeonhd+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: radeonhd+help@xxxxxxxxxxxx

< Previous Next >
References