-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.
+if test "x$enable_libusb" != "xno"; then
+ 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.
+ have_libusb1_0="yes"
+ ;;
+ *)
+ PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.16],
+ [have_libusb1_0="yes"; LIB_CFLAGS="$LIB_CFLAGS $libusb_CFLAGS";
+ LIBS="$LIBS $libusb_LIBS";
+ SR_PKGLIBS="$SR_PKGLIBS libusb-1.0"],
+ [have_libusb1_0="no"])
+ if test "x$enable_libusb$have_libusb1_0" = "xyesno"; then
+ AC_MSG_ERROR([libusb support requested, but it was not found])
+ fi
+ ;;
+ esac
+else
+ have_libusb1_0="no"
+fi
+
+# Define HAVE_LIBUSB_1_0 in config.h if we found libusb-1.0.
+if test "x$have_libusb1_0" = "xno"; then
+ HW_BRYMEN_BM86X="no"; HW_FX2LAFW="no";
+ HW_HANTEK_DSO="no"; HW_IKALOGIC_SCANALOGIC2="no";
+ HW_KECHENG_KC_330B="no"; HW_LASCAR_EL_USB="no";
+ HW_SYSCLK_LWLA="no"; HW_TESTO="no"; HW_UNI_T_DMM="no";
+ HW_UNI_T_UT32X="no"; HW_VICTOR_DMM="no";
+ HW_ZEROPLUS_LOGIC_CUBE="no"; HW_SALEAE_LOGIC16="no";
+else