]> sigrok.org Git - libsigrok.git/blobdiff - configure.ac
Update to 3-digit libserialport package version format.
[libsigrok.git] / configure.ac
index 50d81239371c985ae30f300682d0b1a4f503b215..77f17ddfcb0247d582f10aefd31b23b39f2ce16c 100644 (file)
@@ -24,7 +24,7 @@ AC_PREREQ([2.63])
 # libsigrok package version number (NOT the same as shared lib version!).
 m4_define([sr_package_version_major], [0])
 m4_define([sr_package_version_minor], [2])
-m4_define([sr_package_version_micro], [1])
+m4_define([sr_package_version_micro], [2])
 m4_define([sr_package_version], [sr_package_version_major.sr_package_version_minor.sr_package_version_micro])
 
 AC_INIT([libsigrok], [sr_package_version], [sigrok-devel@lists.sourceforge.net],
@@ -67,7 +67,7 @@ PKG_PROG_PKG_CONFIG([0.22])
 # The algorithm for determining which number to change (and how) is nontrivial!
 # http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
 SR_LIB_VERSION_CURRENT=1
-SR_LIB_VERSION_REVISION=1
+SR_LIB_VERSION_REVISION=2
 SR_LIB_VERSION_AGE=0
 SR_LIB_VERSION="$SR_LIB_VERSION_CURRENT:$SR_LIB_VERSION_REVISION:$SR_LIB_VERSION_AGE"
 SR_LIB_LDFLAGS="-version-info $SR_LIB_VERSION"
@@ -139,6 +139,11 @@ AC_ARG_ENABLE(fx2lafw, AC_HELP_STRING([--enable-fx2lafw],
        [HW_FX2LAFW="$enableval"],
        [HW_FX2LAFW=$HW_ENABLED_DEFAULT])
 
+AC_ARG_ENABLE(gmc-mh-1x-2x, AC_HELP_STRING([--enable-gmc-mh-1x-2x],
+       [enable gmc-mh-1x-2x support [default=yes]]),
+       [HW_GMC_MH_1X_2X="$enableval"],
+       [HW_GMC_MH_1X_2X=$HW_ENABLED_DEFAULT])
+
 AC_ARG_ENABLE(hantek-dso, AC_HELP_STRING([--enable-hantek-dso],
        [enable Hantek DSO support [default=yes]]),
        [HW_HANTEK_DSO="$enableval"],
@@ -203,10 +208,6 @@ AC_ARG_ENABLE(teleinfo, AC_HELP_STRING([--enable-teleinfo],
        [enable Teleinfo support [default=yes]]),
        [HW_TELEINFO="$enableval"],
        [HW_TELEINFO=$HW_ENABLED_DEFAULT])
-AM_CONDITIONAL(HW_TELEINFO, test x$HW_TELEINFO = xyes)
-if test "x$HW_TELEINFO" = "xyes"; then
-       AC_DEFINE(HAVE_HW_TELEINFO, 1, [Teleinfo support])
-fi
 
 AC_ARG_ENABLE(tondaj-sl-814, AC_HELP_STRING([--enable-tondaj-sl-814],
        [enable Tondaj SL-814 support [default=yes]]),
@@ -255,6 +256,27 @@ PKG_CHECK_MODULES([libzip], [libzip >= 0.10],
        [CFLAGS="$CFLAGS $libzip_CFLAGS"; LIBS="$LIBS $libzip_LIBS";
        SR_PKGLIBS="$SR_PKGLIBS libzip"])
 
+# libserialport is only needed for some hardware drivers. Disable the
+# respective drivers if it is not found.
+PKG_CHECK_MODULES([libserialport], [libserialport >= 0.1.0],
+       [have_libserialport="yes"; CFLAGS="$CFLAGS $libserialport_CFLAGS";
+       LIBS="$LIBS $libserialport_LIBS";
+       SR_PKGLIBS="$SR_PKGLIBS libserialport"],
+       [have_libserialport="no"; HW_AGILENT_DMM="no"; HW_BRYMEN_DMM="no";
+       HW_CEM_DT_885X="no"; HW_CENTER_3XX="no"; HW_COLEAD_SLM="no";
+       HW_FLUKE_DMM="no"; HW_LINK_MSO19="no"; HW_MIC_985XX="no";
+       HW_NORMA_DMM="no"; HW_OLS="no"; HW_RIGOL_DS1XX2="no";
+       HW_SERIAL_DMM="no"; HW_TELEINFO="no"; HW_TONDAJ_SL_814="no"])
+
+# Define HAVE_LIBSERIALPORT in config.h if we found libserialport.
+if test "x$have_libserialport" != "xno"; then
+       AC_DEFINE_UNQUOTED(HAVE_LIBSERIALPORT, [1],
+               [Specifies whether we have libserialport.])
+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
@@ -386,6 +408,11 @@ if test "x$HW_FX2LAFW" = "xyes"; then
        AC_DEFINE(HAVE_HW_FX2LAFW, 1, [fx2lafw support])
 fi
 
+AM_CONDITIONAL(HW_GMC_MH_1X_2X, test x$HW_GMC_MH_1X_2X = xyes)
+if test "x$HW_GMC_MH_1X_2X" = "xyes"; then
+       AC_DEFINE(HAVE_HW_GMC_MH_1X_2X, 1, [gmc-mh-1x-2x support])
+fi
+
 AM_CONDITIONAL(HW_HANTEK_DSO, test x$HW_HANTEK_DSO = xyes)
 if test "x$HW_HANTEK_DSO" = "xyes"; then
        AC_DEFINE(HAVE_HW_HANTEK_DSO, 1, [Hantek DSO support])
@@ -423,7 +450,7 @@ fi
 
 AM_CONDITIONAL(HW_NORMA_DMM, test x$HW_NORMA_DMM = xyes)
 if test "x$HW_NORMA_DMM" = "xyes"; then
-       AC_DEFINE(HAVE_HW_NORMA_DMM, 1, [norma-dmm support])
+       AC_DEFINE(HAVE_HW_NORMA_DMM, 1, [Norma DMM support])
 fi
 
 AM_CONDITIONAL(HW_OLS, test x$HW_OLS = xyes)
@@ -436,11 +463,21 @@ if test "x$HW_RIGOL_DS1XX2" = "xyes"; then
        AC_DEFINE(HAVE_HW_RIGOL_DS1XX2, 1, [Rigol DS1xx2 support])
 fi
 
+AM_CONDITIONAL(HW_SALEAE_LOGIC16, test x$HW_SALEAE_LOGIC16 = xyes)
+if test "x$HW_SALEAE_LOGIC16" = "xyes"; then
+       AC_DEFINE(HAVE_HW_SALEAE_LOGIC16, 1, [Saleae Logic16 support])
+fi
+
 AM_CONDITIONAL(HW_SERIAL_DMM, test x$HW_SERIAL_DMM = xyes)
 if test "x$HW_SERIAL_DMM" = "xyes"; then
        AC_DEFINE(HAVE_HW_SERIAL_DMM, 1, [Serial DMM support])
 fi
 
+AM_CONDITIONAL(HW_TELEINFO, test x$HW_TELEINFO = xyes)
+if test "x$HW_TELEINFO" = "xyes"; then
+       AC_DEFINE(HAVE_HW_TELEINFO, 1, [Teleinfo support])
+fi
+
 AM_CONDITIONAL(HW_TONDAJ_SL_814, test x$HW_TONDAJ_SL_814 = xyes)
 if test "x$HW_TONDAJ_SL_814" = "xyes"; then
        AC_DEFINE(HAVE_HW_TONDAJ_SL_814, 1, [Tondaj SL-814 support])
@@ -466,11 +503,6 @@ if test "x$HW_ZEROPLUS_LOGIC_CUBE" = "xyes"; then
        AC_DEFINE(HAVE_HW_ZEROPLUS_LOGIC_CUBE, 1, [ZEROPLUS Logic Cube support])
 fi
 
-AM_CONDITIONAL(HW_SALEAE_LOGIC16, test x$HW_SALEAE_LOGIC16 = xyes)
-if test "x$HW_SALEAE_LOGIC16" = "xyes"; then
-       AC_DEFINE(HAVE_HW_SALEAE_LOGIC16, 1, [Saleae Logic16 support])
-fi
-
 # Checks for header files.
 # These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h.
 AC_CHECK_HEADERS([fcntl.h sys/time.h termios.h])
@@ -515,6 +547,7 @@ AC_CONFIG_FILES([Makefile version.h hardware/Makefile
                 hardware/chronovu-la8/Makefile
                 hardware/colead-slm/Makefile
                 hardware/common/Makefile
+                hardware/gmc-mh-1x-2x/Makefile
                 hardware/ikalogic-scanalogic2/Makefile
                 hardware/ikalogic-scanaplus/Makefile
                 hardware/kecheng-kc-330b/Makefile
@@ -560,7 +593,7 @@ echo "Detected libraries:"
 echo
 
 # Note: This only works for libs with pkg-config integration.
-for lib in "glib-2.0 >= 2.32.0" "libzip >= 0.10" "libusb-1.0 >= 1.0.9" "libftdi >= 0.16" "libudev >= 151" "alsa >= 1.0" "check >= 0.9.4"; do
+for lib in "glib-2.0 >= 2.32.0" "libzip >= 0.10" "libserialport >= 0.1.0" "libusb-1.0 >= 1.0.9" "libftdi >= 0.16" "libudev >= 151" "alsa >= 1.0" "check >= 0.9.4"; do
        if `$PKG_CONFIG --exists $lib`; then
                ver=`$PKG_CONFIG --modversion $lib`
                answer="yes ($ver)"
@@ -582,6 +615,7 @@ echo "  - colead-slm...................... $HW_COLEAD_SLM"
 echo "  - demo............................ $HW_DEMO"
 echo "  - fluke-dmm....................... $HW_FLUKE_DMM"
 echo "  - fx2lafw......................... $HW_FX2LAFW"
+echo "  - gmc-mh-1x-2x.................... $HW_GMC_MH_1X_2X"
 echo "  - hantek-dso...................... $HW_HANTEK_DSO"
 echo "  - ikalogic-scanalogic2............ $HW_IKALOGIC_SCANALOGIC2"
 echo "  - ikalogic-scanaplus.............. $HW_IKALOGIC_SCANAPLUS"