From: Uwe Hermann Date: Sat, 22 Dec 2012 00:33:03 +0000 (+0100) Subject: configure.ac: Improve check for libusb-1.0. X-Git-Tag: dsupstream~429 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=17dfb2c32c6686630fd95b2f25e554fa01f8ebd1;p=libsigrok.git configure.ac: Improve check for libusb-1.0. PKG_CHECK_MODULES() checks for libusb-1.0 via pkg-config already, no need to use a "manual" additional check via AC_CHECK_LIB() just to set HAVE_LIBUSB_1_0 in config.h. This helps with cross-compiling setups, among other things. --- diff --git a/configure.ac b/configure.ac index 950a6ca3..3cf4f9b7 100644 --- a/configure.ac +++ b/configure.ac @@ -249,7 +249,7 @@ PKG_CHECK_MODULES([gthread], [gthread-2.0 >= 2.22.0], [CFLAGS="$CFLAGS $gthread_CFLAGS"; LIBS="$LIBS $gthread_LIBS"; SR_PKGLIBS="$SR_PKGLIBS gthread-2.0"]) -# libusb is only needed for some hardware drivers. +# libusb-1.0 is only needed for some hardware drivers. if test "x$LA_ASIX_SIGMA" != xno \ -o "x$LA_CHRONOVU_LA8" != xno \ -o "x$LA_FX2LAFW" != xno \ @@ -266,7 +266,11 @@ if test "x$LA_ASIX_SIGMA" != xno \ [CFLAGS="$CFLAGS $libusb_CFLAGS"; LIBS="$LIBS $libusb_LIBS"; SR_PKGLIBS="$SR_PKGLIBS libusb-1.0"]) - AC_CHECK_LIB(usb-1.0, libusb_init) + # Define HAVE_LIBUSB_1_0 in config.h if we found libusb-1.0. + if test "x$libusb_CFLAGS" != "x"; then + AC_DEFINE_UNQUOTED(HAVE_LIBUSB_1_0, [1], + [Specifies whether we have a libusb.h header.]) + fi ;; esac fi