[openib-general] [patch] tvflash configure checks for libpci

Bernhard Fischer rep.nop at aon.at
Mon Feb 27 07:40:27 PST 2006


Hi,

tvflash does check if pci/pci.h is installed but does not error out if
it is not found.
This leads to build-errors later on as the include is not found.

Attached patch would
- check for pci/pci.h and bail out if it is not found.
- check for needed functions provided by libpci

Signed-off-by: Bernhard Fischer <rep.nop at aon.at>

Please consider applying something to this effect.
Thank you

-------------- next part --------------
Index: configure.in
===================================================================
--- configure.in	(revision 5203)
+++ configure.in	(working copy)
@@ -11,16 +11,25 @@
 # Checks for programs.
 AC_PROG_CC
 
-# Checks for libraries.
-AC_CHECK_LIB(pci, pci_alloc)
-
 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h limits.h stdlib.h string.h unistd.h pci/pci.h)
+AC_CHECK_HEADERS(fcntl.h limits.h stdlib.h string.h unistd.h)
 
+AC_CHECK_HEADER([pci/pci.h], [],
+    AC_MSG_ERROR([<pci/pci.h> not found.]))
+
 # Checks for typedefs, structures, and compiler characteristics.
 
 # Checks for library functions.
 AC_FUNC_MALLOC
 AC_CHECK_FUNCS(memset strchr strtoul)
+AC_CHECK_LIB(pci, pci_init, [],
+    AC_MSG_ERROR([libpci not found.
+]))
+AC_CHECK_FUNCS(pci_init pci_scan_bus pci_alloc \
+		pci_cleanup pci_fill_info pci_write_long pci_read_long \
+		pci_read_word, [],
+    AC_MSG_ERROR([libpci functions not found.
+]))
+
 AC_OUTPUT(Makefile tvflash.spec)


More information about the general mailing list