summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-03-22 12:29:45 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-03-22 12:29:45 +0000
commit9979eacd9c3be00517f69a6631209222b8128bba (patch)
tree8b8c49f318d5199b0b6d15510f4360712af4896a
parent4e54de944dd97b7178c3847dfbf419f36c1459e6 (diff)
downloadast2050-flashrom-9979eacd9c3be00517f69a6631209222b8128bba.zip
ast2050-flashrom-9979eacd9c3be00517f69a6631209222b8128bba.tar.gz
Refine compile-time checks for libpci
Idwer Vollering reported problems with the current libpci check on FreeBSD 8.0-RELEASE i386. This is caused by a strict linker. Parsing linker error messages is an exercise in futility, and library detection with $CC --print-file-name is totally useless for libraries outside the standard hardcoded builtin gcc search path (probably the same for other compilers as well). Look for libpciutils instead of libpci on NetBSD during the check. Corresponding to flashrom svn r968. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Idwer Vollering <vidwer@gmail.com>
-rw-r--r--Makefile21
1 files changed, 6 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 1a9c0fd..fa67b73 100644
--- a/Makefile
+++ b/Makefile
@@ -279,26 +279,17 @@ pciutils: compiler
echo "Please install libpci headers (package pciutils-devel)."; \
echo "See README for more information."; echo; \
rm -f .test.c .test.o; exit 1)
- @printf "Checking for libpci... "
- @$(shell ( echo "#include <pci/pci.h>"; \
- echo "int main(int argc, char **argv)"; \
- echo "{ return 0; }"; ) > .test1.c )
- @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .test1.c -o .test1 -lpci $(LIBS) >/dev/null 2>&1 && \
- echo "found." || ( echo "not found."; echo; \
- echo "Please install libpci (package pciutils)."; \
- echo "See README for more information."; echo; \
- rm -f .test1.c .test1; exit 1)
- @printf "Checking if libpci is sufficient... "
+ @printf "Checking if libpci is present and sufficient... "
@printf "" > .libdeps
- @$(CC) $(LDFLAGS) .test.o -o .test -lpci $(LIBS) >/dev/null 2>&1 && \
+ @$(CC) $(LDFLAGS) .test.o -o .test $(LIBS) >/dev/null 2>&1 && \
echo "yes." || ( echo "no."; \
- printf "Checking if libz is present and supplies all needed symbols..."; \
- $(CC) $(LDFLAGS) .test.o -o .test -lpci -lz $(LIBS) >/dev/null 2>&1 && \
+ printf "Checking if libz+libpci are present and sufficient..."; \
+ $(CC) $(LDFLAGS) .test.o -o .test $(LIBS) -lz >/dev/null 2>&1 && \
( echo "yes."; echo "NEEDLIBZ := yes" > .libdeps ) || ( echo "no."; echo; \
- echo "Please install libz."; \
+ echo "Please install libpci (package pciutils) and/or libz."; \
echo "See README for more information."; echo; \
rm -f .test.c .test.o .test; exit 1) )
- @rm -f .test.c .test.o .test .test1.c .test1
+ @rm -f .test.c .test.o .test
else
pciutils: compiler
@printf "" > .libdeps
OpenPOWER on IntegriCloud