summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@gmx.at>2012-10-12 10:36:49 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2012-10-19 19:32:24 +0200
commitfba86bfaa8a308ed6ca3daa66e27f1c10dd4c016 (patch)
treea064f686f24450b631549959d5d5dd44637e167e
parent1a00cf063273d2f19afbc848dd1a204b7687578e (diff)
downloadcoreboot-fba86bfaa8a308ed6ca3daa66e27f1c10dd4c016.tar.xz
inteltool: improve the libpci test in the Makefile
Use the verbatim variable method to define and export test code and the actual libpci test from flashrom. This improves readability and will work with stricter compiler (settings). Change-Id: Iace7d53b0b992c4fde596ce1d606ad715d6dfc2a Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at> Reviewed-on: http://review.coreboot.org/1575 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--util/inteltool/Makefile20
1 files changed, 16 insertions, 4 deletions
diff --git a/util/inteltool/Makefile b/util/inteltool/Makefile
index af79b1edec..6c94460314 100644
--- a/util/inteltool/Makefile
+++ b/util/inteltool/Makefile
@@ -53,12 +53,24 @@ distclean: clean
dep:
@$(CC) $(CFLAGS) -MM *.c > .dependencies
+define LIBPCI_TEST
+/* Avoid a failing test due to libpci header symbol shadowing breakage */
+#define index shadow_workaround_index
+#include <pci/pci.h>
+struct pci_access *pacc;
+int main(int argc, char **argv)
+{
+ (void) argc;
+ (void) argv;
+ pacc = pci_alloc();
+ return 0;
+}
+endef
+export LIBPCI_TEST
+
pciutils:
@printf "\nChecking for pciutils and zlib... "
- @$(shell ( printf "#include <pci/pci.h>\n"; \
- printf "struct pci_access *pacc;\n"; \
- printf "int main(int argc, char **argv)\n"; \
- printf "{ pacc = pci_alloc(); return 0; }\n"; ) > .test.c )
+ @echo "$$LIBPCI_TEST" > .test.c
@$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >/dev/null 2>&1 && \
printf "found.\n" || ( printf "not found.\n\n"; \
printf "Please install pciutils-devel and zlib-devel.\n"; \