]> sigrok.org Git - libsigrok.git/blobdiff - configure.ac
autotools: Don't use "foreign" option.
[libsigrok.git] / configure.ac
index 32efdea55ec0f60c536f3e380f34e6270ef72494..2d30811de06eb762e33d24160f1487f6b9950186 100644 (file)
@@ -34,7 +34,7 @@ AC_CONFIG_MACRO_DIR([autostuff])
 AC_CONFIG_AUX_DIR([autostuff])
 
 # We require at least automake 1.11 (needed for 'silent rules').
-AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign std-options])
+AM_INIT_AUTOMAKE([1.11 -Wall -Werror std-options check-news])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 
@@ -52,6 +52,9 @@ AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_LN_S
 
+# Required for per-target flags or subdir-objects with C sources.
+AM_PROG_CC_C_O
+
 # Initialize libtool.
 LT_INIT
 
@@ -108,6 +111,15 @@ if test "x$LA_ASIX_SIGMA" = "xyes"; then
        AC_DEFINE(HAVE_LA_ASIX_SIGMA, 1, [ASIX SIGMA/SIGMA2 support])
 fi
 
+AC_ARG_ENABLE(brymen-dmm, AC_HELP_STRING([--enable-brymen-dmm],
+       [enable Brymen DMM support [default=yes]]),
+       [HW_BRYMEN_DMM="$enableval"],
+       [HW_BRYMEN_DMM=yes])
+AM_CONDITIONAL(HW_BRYMEN_DMM, test x$HW_BRYMEN_DMM = xyes)
+if test "x$HW_BRYMEN_DMM" = "xyes"; then
+       AC_DEFINE(HAVE_HW_BRYMEN_DMM, 1, [brymen-dmm support])
+fi
+
 AC_ARG_ENABLE(chronovu-la8, AC_HELP_STRING([--enable-chronovu-la8],
        [enable ChronoVu LA8 support [default=yes]]),
        [LA_CHRONOVU_LA8="$enableval"],
@@ -328,6 +340,12 @@ if test "x$HW_ALSA" != xno; then
                SR_PKGLIBS="$SR_PKGLIBS alsa"])
 fi
 
+# The Check unit testing framework is optional.
+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")
+
 # EZUSB FX2 firmware helper code is only needed for some hardware drivers.
 AM_CONDITIONAL(NEED_EZUSB, \
        test "x$LA_FX2LAFW" != xno \
@@ -384,6 +402,7 @@ AC_CONFIG_FILES([Makefile version.h hardware/Makefile
                 hardware/agilent-dmm/Makefile
                 hardware/alsa/Makefile
                 hardware/asix-sigma/Makefile
+                hardware/brymen-dmm/Makefile
                 hardware/chronovu-la8/Makefile
                 hardware/colead-slm/Makefile
                 hardware/common/Makefile
@@ -408,6 +427,7 @@ AC_CONFIG_FILES([Makefile version.h hardware/Makefile
                 output/text/Makefile
                 libsigrok.pc
                 contrib/Makefile
+                tests/Makefile
                ])
 
 AC_OUTPUT
@@ -423,7 +443,7 @@ echo "Detected libraries:"
 echo
 
 # Note: This only works for libs with pkg-config integration.
-for lib in "glib-2.0" "libusb-1.0" "libzip" "libftdi" "libudev" "alsa"; do
+for lib in "glib-2.0" "libusb-1.0" "libzip" "libftdi" "libudev" "alsa" "check"; do
        if `$PKG_CONFIG --exists $lib`; then
                ver=`$PKG_CONFIG --modversion $lib`
                answer="yes ($ver)"
@@ -437,6 +457,7 @@ echo -e "\nEnabled hardware drivers:\n"
 echo "  - Agilent DMM..................... $HW_AGILENT_DMM"
 echo "  - ALSA............................ $HW_ALSA"
 echo "  - ASIX SIGMA/SIGMA2............... $LA_ASIX_SIGMA"
+echo "  - Brymen DMM...................... $HW_BRYMEN_DMM"
 echo "  - ChronoVu LA8.................... $LA_CHRONOVU_LA8"
 echo "  - Colead SLM...................... $HW_COLEAD_SLM"
 echo "  - Demo driver..................... $LA_DEMO"