]> sigrok.org Git - libsigrok.git/blobdiff - configure.ac
rigol-ds: replace some magic numbers by appropriate constant or variable
[libsigrok.git] / configure.ac
index a60450cd1cc2c599d4e6389364bdd3ff3534f1da..7e109fde6baf34fa3ff5d2bd5d97483875b7ed28 100644 (file)
@@ -132,6 +132,7 @@ DRIVER([OpenBench Logic Sniffer], [openbench-logic-sniffer])
 DRIVER([Pipistrello-OLS], [pipistrello-ols])
 DRIVER([Rigol DS], [rigol-ds])
 DRIVER([Saleae Logic16], [saleae-logic16])
+DRIVER([SCPI PPS], [scpi-pps])
 DRIVER([serial DMM], [serial-dmm])
 DRIVER([Sysclk LWLA], [sysclk-lwla])
 DRIVER([Teleinfo], [teleinfo])
@@ -301,13 +302,12 @@ fi
 # Serial port helper code is only compiled in if libserialport was found.
 AM_CONDITIONAL(NEED_SERIAL, test "x$have_libserialport" != xno)
 
+# VISA SCPI backend is only compiled in if librevisa was found.
 PKG_CHECK_MODULES([librevisa], [librevisa >= 0.0.20130812],
        [have_librevisa="yes"; LIB_CFLAGS="$LIB_CFLAGS $librevisa_CFLAGS";
        LIBS="$LIBS $librevisa_LIBS";
        SR_PKGLIBS="$SR_PKGLIBS librevisa"],
        [have_librevisa="no"])
-
-# VISA SCPI backend is only compiled in if librevisa was found.
 AM_CONDITIONAL(NEED_VISA, test "x$have_librevisa" != xno)
 
 # Define HAVE_LIBREVISA in config.h if we found librevisa.
@@ -316,6 +316,20 @@ if test "x$have_librevisa" != "xno"; then
                [Specifies whether we have librevisa.])
 fi
 
+# GPIB backend is only compiled in if libgpib headers found.
+PKG_CHECK_MODULES([libgpib], [libgpib],
+       [have_libgpib="yes"; LIB_CFLAGS="$LIB_CFLAGS $libgpib_CFLAGS";
+       LIBS="$LIBS $libgpib_LIBS";
+       SR_PKGLIBS="$SR_PKGLIBS libgpib"],
+       [have_libgpib="no"])
+AM_CONDITIONAL(NEED_GPIB, test "x$have_libgpib" != xno)
+
+# Define HAVE_LIBGPIB in config.h if we found libgpib.
+if test "x$have_libgpib" != "xno"; then
+       AC_DEFINE_UNQUOTED(HAVE_LIBGPIB, [1],
+               [Specifies whether we have libgpib.])
+fi
+
 # libusb-1.0 is only needed for some hardware drivers. Disable the respective
 # drivers if it is not found.
 if test "x$enable_libusb" != "xno"; then
@@ -386,6 +400,19 @@ PKG_CHECK_MODULES([glibmm], [glibmm-2.4 >= 2.32.0],
        CXXLIBS="$CXXLIBS $glibmm_LIBS"],
        [BINDINGS_CXX="no"; cxx_msg="glibmm required"])
 
+# C++ bindings want stoi and stod
+if test "x$BINDINGS_CXX" == "xyes"; then
+       AC_LANG_PUSH([C++])
+       AC_MSG_CHECKING([for stoi and stod])
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <string>],
+                                          [{ return std::stoi("1")+std::stod("1.0"); }])],
+              [AC_MSG_RESULT([yes]);
+               AC_DEFINE_UNQUOTED(HAVE_STOI_STOD, [1],
+               [Specifies whether we have the stoi and stod functions.])],
+              [AC_MSG_RESULT([no])])
+       AC_LANG_POP([C++])
+fi
+
 # PyGObject is needed for the Python bindings.
 PKG_CHECK_MODULES([pygobject], [pygobject-3.0 >= 3.0.0],
         [CXXFLAGS="$CXXFLAGS $pygobject_CFLAGS";
@@ -599,6 +626,11 @@ if test "x$HW_SALEAE_LOGIC16" = "xyes"; then
        AC_DEFINE(HAVE_HW_SALEAE_LOGIC16, 1, [Saleae Logic16 support])
 fi
 
+AM_CONDITIONAL(HW_SCPI_PPS, test x$HW_SCPI_PPS = xyes)
+if test "x$HW_SCPI_PPS" = "xyes"; then
+       AC_DEFINE(HAVE_HW_SCPI_PPS, 1, [SCPI PPS 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])
@@ -694,7 +726,11 @@ 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" "libserialport >= 0.2.0" "librevisa >= 0.0.20130812" "libusb-1.0 >= 1.0.16" "libftdi >= 0.16" "libftdi1 >= 1.0" "glibmm-2.4 >= 2.32.0" "pygobject-3.0 >= 3.0.0" "check >= 0.9.4"; do
+for lib in "glib-2.0 >= 2.32.0" "libzip >= 0.10" "libserialport >= 0.2.0" \
+       "librevisa >= 0.0.20130812" "libusb-1.0 >= 1.0.16" "libftdi >= 0.16" \
+       "libftdi1 >= 1.0" "glibmm-2.4 >= 2.32.0" "pygobject-3.0 >= 3.0.0" \
+       "check >= 0.9.4" "libgpib"
+do
        optional="OPTIONAL"
        if test "x$lib" = "xglib-2.0 >= 2.32.0"; then optional="REQUIRED"; fi
        if test "x$lib" = "xlibzip >= 0.10"; then optional="REQUIRED"; fi