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
This commit is contained in:
Peter Stuge
2008-11-25 02:03:16 +00:00
parent ef8ea01c8c
commit 0924dee124
5 changed files with 53 additions and 1 deletions

View File

@@ -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)