Unneeded libusb linking within libhal

Marcel Holtmann marcel at holtmann.org
Thu Feb 21 22:45:46 PST 2008


Hi David,

I did some dependency review and I realized that when libusb is found,
we link libhal against libusb. This is totally unneeded and drags in
additional dependencies for applications using libhal.

The reason for it is a broken AC_CHECK_LIB usage. The attached patch
fixes it.

Regards

Marcel

-------------- next part --------------
avoid unneeded libusb linking

The AC_CHECK_LIB will add -lusb to LDFLAGS if the third parameter is
omitted. This results in that everything will be linked against libusb
and that is not an intented behavior. Fill in this parameter and the
extra linking goes away.

---
commit e1b748675ed1a544c914dc7eba6199592528b29c
tree 8e7029734cc01c8a2ef54e43ccd76bcd406f6768
parent 75a9042c1e31da76b7c448dc921d6dc744ca9a86
author Marcel Holtmann <marcel at holtmann.org> Fri, 22 Feb 2008 07:43:34 +0100
committer Marcel Holtmann <marcel at holtmann.org> Fri, 22 Feb 2008 07:43:34 +0100

 configure.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index d9efb89..44bffb8 100644
--- a/configure.in
+++ b/configure.in
@@ -390,7 +390,7 @@ AC_ARG_ENABLE([usb],
 if test "x$use_usb" = "xyes" ; then
 	AC_CHECK_HEADERS([usb.h], [USE_LIBUSB=yes], [USE_LIBUSB=no])
 	if test "x$USE_LIBUSB" = "xyes"; then
-		AC_CHECK_LIB([usb], [usb_find_devices], [], [USE_LIBUSB=no])
+		AC_CHECK_LIB([usb], [usb_find_devices], [USE_LIBUSB=yes], [USE_LIBUSB=no])
 	fi
 else
     	USE_LIBUSB=no


More information about the hal mailing list