summaryrefslogtreecommitdiff
path: root/util/msrtool/configure
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2008-11-25 02:03:16 +0000
committerPeter Stuge <peter@stuge.se>2008-11-25 02:03:16 +0000
commit0924dee124acfd1f8ae96685720c7a4af068e843 (patch)
tree00321ecd5b104f533af8b1d170c79761b6f7cdf3 /util/msrtool/configure
parentef8ea01c8c6638e4cf3a9ed32857e14c3f6e7cbc (diff)
msrtool: Use libpci to let system and target probes find PCI devices.
And some more notes in TODO. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3770 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/msrtool/configure')
-rwxr-xr-xutil/msrtool/configure19
1 files changed, 19 insertions, 0 deletions
diff --git a/util/msrtool/configure b/util/msrtool/configure
index f627a6541f..53bf6c4b94 100755
--- a/util/msrtool/configure
+++ b/util/msrtool/configure
@@ -135,6 +135,25 @@ INSTALL=$(findprog "install" "${INSTALL}" install ginstall) || exit
test -n "$DEBUG" && myCFLAGS="-O2 -g" || myCFLAGS="-Os"
CFLAGS="${CFLAGS} ${myCFLAGS} -Wall -Werror"
+cat > .config.c << EOF
+#include <pci/pci.h>
+struct pci_access *pacc;
+int main(int argc, char *argv[])
+{ pacc = pci_alloc(); return 0; }
+EOF
+
+pc_CFLAGS="$(pkg-config libpci --cflags 2>/dev/null)"
+pc_LDFLAGS="$(pkg-config libpci --libs 2>/dev/null)"
+CFLAGS=$(trycompile "libpci (from pciutils)" "${pc_CFLAGS}" "-I/usr/local/include") || {
+ rm -f .config.c
+ exit 1
+}
+LDFLAGS=$(trylink "libpci (from pciutils)" "${pc_LDFLAGS}" "-lpci -lz" "-L/usr/local/lib -lpci -lz") || {
+ rm -f .config.c .config.o
+ exit 1
+}
+rm -f .config.c .config.o .config
+
PREFIX="${PREFIX:-/usr/local}"
OS_ARCH=$(uname)