+ fi
+ ;;
+esac
+
+# USB + FX2 firmware helper code is only compiled in if libusb-1.0 was found.
+AM_CONDITIONAL(NEED_USB, test "x$have_libusb1_0" != xno)
+
+# libftdi is only needed for some hardware drivers. Disable them if not found.
+PKG_CHECK_MODULES([libftdi], [libftdi >= 0.16],
+ [CFLAGS="$CFLAGS $libftdi_CFLAGS";
+ LIBS="$LIBS $libftdi_LIBS";
+ SR_PKGLIBS="$SR_PKGLIBS libftdi"],
+ [HW_ASIX_SIGMA="no"; HW_CHRONOVU_LA8="no"])
+
+# libudev is only needed for some hardware drivers. Disable them if not found.
+PKG_CHECK_MODULES([libudev], [libudev >= 151],
+ [CFLAGS="$CFLAGS $libudev_CFLAGS"; LIBS="$LIBS $libudev_LIBS";
+ SR_PKGLIBS="$SR_PKGLIBS libudev"],
+ [HW_LINK_MSO19="no"])
+
+# ALSA is only needed for some hardware drivers. Disable them if not found.
+PKG_CHECK_MODULES([alsa], [alsa >= 1.0],
+ [CFLAGS="$CFLAGS $alsa_CFLAGS"; LIBS="$LIBS $alsa_LIBS";
+ SR_PKGLIBS="$SR_PKGLIBS alsa"],
+ [HW_ALSA="no"])
+
+# The Check unit testing framework is optional. Disable if not found.
+PKG_CHECK_MODULES([check], [check >= 0.9.4],
+ [have_check="yes"; CFLAGS="$CFLAGS $check_CFLAGS";
+ LIBS="$LIBS $check_LIBS"], [have_check="no"])
+AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
+
+# The Rigol DS1xx2 driver currently uses the Linux kernel usbtmc module
+# (though it is planned to rewrite the driver to be portable later).
+# Thus, it will be disabled for non-Linux builds for now.
+case "$host" in
+*linux*)
+ # Do nothing. Whether the driver is enabled is determined by the
+ # previous --enable-all-drivers/--disable-all-drivers and/or any
+ # --enable-rigol-ds1xx2/--disable-rigol-ds1xx2 options.
+ ;;
+*)
+ # Disable the driver for builds that don't target Linux.
+ HW_RIGOL_DS1XX2="no"
+ ;;
+esac
+
+AC_SUBST(SR_PKGLIBS)
+
+# Now set AM_CONDITIONALs and AC_DEFINEs for the enabled/disabled drivers.
+
+AM_CONDITIONAL(HW_AGILENT_DMM, test x$HW_AGILENT_DMM = xyes)
+if test "x$HW_AGILENT_DMM" = "xyes"; then
+ AC_DEFINE(HAVE_HW_AGILENT_DMM, 1, [Agilent DMM support])