From 0924dee124acfd1f8ae96685720c7a4af068e843 Mon Sep 17 00:00:00 2001 From: Peter Stuge Date: Tue, 25 Nov 2008 02:03:16 +0000 Subject: msrtool: Use libpci to let system and target probes find PCI devices. And some more notes in TODO. Signed-off-by: Peter Stuge Acked-by: Carl-Daniel Hailfinger git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3770 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/msrtool/configure | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'util/msrtool/configure') diff --git a/util/msrtool/configure b/util/msrtool/configure index f627a6541f29..53bf6c4b9400 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 +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) -- cgit v1.2.3