-AC_ARG_ENABLE(saleae-logic, AC_HELP_STRING([--enable-saleae-logic],
- [enable Saleae Logic support [default=yes]]),
- [LA_SALEAE_LOGIC="$enableval"],
- [LA_SALEAE_LOGIC=yes])
-AM_CONDITIONAL(LA_SALEAE_LOGIC, test x$LA_SALEAE_LOGIC = xyes)
-if test "x$LA_SALEAE_LOGIC" = "xyes"; then
- AC_DEFINE(HAVE_LA_SALEAE_LOGIC, 1, [Saleae Logic support])
-fi
+# Serial port helper code is only compiled in if libserialport was found.
+AM_CONDITIONAL(NEED_SERIAL, test "x$have_libserialport" != xno)
+
+# libusb-1.0 is only needed for some hardware drivers. Disable the respective
+# drivers if it is not found.
+case "$host" in
+*freebsd*)
+ # FreeBSD comes with an "integrated" libusb-1.0-style USB API.
+ # This means libusb-1.0 is always available, no need to check for it,
+ # and no need to (potentially) disable any drivers if it's not found.
+ AC_DEFINE_UNQUOTED(HAVE_LIBUSB_1_0, [1],
+ [Specifies whether we have a libusb.h header.])
+ ;;
+*)
+ PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9],
+ [have_libusb1_0="yes"; CFLAGS="$CFLAGS $libusb_CFLAGS";
+ LIBS="$LIBS $libusb_LIBS";
+ SR_PKGLIBS="$SR_PKGLIBS libusb-1.0"],
+ [have_libusb1_0="no"])
+
+ # Define HAVE_LIBUSB_1_0 in config.h if we found libusb-1.0.
+ if test "x$have_libusb1_0" != "xno"; then
+ AC_DEFINE_UNQUOTED(HAVE_LIBUSB_1_0, [1],
+ [Specifies whether we have a libusb.h header.])
+ fi
+ ;;
+esac