X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=configure.ac;h=7e109fde6baf34fa3ff5d2bd5d97483875b7ed28;hb=effb9dd1c22dd10e1f276544bdadf4d3acf7dcc3;hp=38e021a49dde514e004b556f537ff3395c1f33ff;hpb=33c84e81975c75b73002b038a0076f384ca13d63;p=libsigrok.git diff --git a/configure.ac b/configure.ac index 38e021a4..7e109fde 100644 --- a/configure.ac +++ b/configure.ac @@ -129,8 +129,10 @@ DRIVER([MIC 985xx], [mic-985xx]) DRIVER([Motech LPS 30x], [motech-lps-30x]) DRIVER([Norma DMM], [norma-dmm]) 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]) @@ -139,6 +141,7 @@ DRIVER([Tondaj SL-814], [tondaj-sl-814]) DRIVER([UNI-T DMM], [uni-t-dmm]) DRIVER([UNI-T UT32x], [uni-t-ut32x]) DRIVER([Victor DMM], [victor-dmm]) +DRIVER([Yokogawa DL/DLM], [yokogawa-dlm]) DRIVER([ZEROPLUS Logic Cube], [zeroplus-logic-cube]) AC_ARG_ENABLE(libserialport, @@ -175,6 +178,11 @@ AC_ARG_ENABLE(java, [build Java bindings [default=yes]]), [BINDINGS_JAVA="$enableval"], [BINDINGS_JAVA=$BINDINGS_ALL]) +AC_ARG_WITH(jni-include-path, + AC_HELP_STRING([--with-jni-include-path=path], + [specify include path for JNI [default=autodetect]]), + [JNI_INCLUDE_DIRS="$withval"], [JNI_INCLUDE_DIRS=auto]) + # Check if the C++ compiler supports the C++11 standard. m4_ifdef([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX_11(,[optional])], @@ -200,7 +208,10 @@ fi PKG_CHECK_MODULES([python], [python >= 2.7], [CXXFLAGS="$CXXFLAGS $python_CFLAGS"; CXXLIBS="$CXXLIBS $python_LIBS"], - [BINDINGS_PYTHON="no"; python_msg="Python headers required"]) +[PKG_CHECK_MODULES([python27], [python-2.7 >= 2.7], + [CXXFLAGS="$CXXFLAGS $python27_CFLAGS"; + CXXLIBS="$CXXLIBS $python27_LIBS"], + [BINDINGS_PYTHON="no"; python_msg="Python headers required"])]) # The Python bindings need the setuptools Python module. m4_ifdef([AX_PYTHON_MODULE], [AX_PYTHON_MODULE([setuptools])], @@ -262,7 +273,7 @@ PKG_CHECK_MODULES([libzip], [libzip >= 0.10], # libserialport is only needed for some hardware drivers. Disable the # respective drivers if it is not found. if test "x$enable_libserialport" != "xno"; then - PKG_CHECK_MODULES([libserialport], [libserialport >= 0.1.0], + PKG_CHECK_MODULES([libserialport], [libserialport >= 0.2.0], [have_libserialport="yes"; LIB_CFLAGS="$LIB_CFLAGS $libserialport_CFLAGS"; LIBS="$LIBS $libserialport_LIBS"; SR_PKGLIBS="$SR_PKGLIBS libserialport"], @@ -291,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. @@ -306,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 @@ -367,6 +391,7 @@ fi if test "x$have_libftdi" = "xno"; then HW_ASIX_SIGMA="no"; HW_CHRONOVU_LA="no"; HW_IKALOGIC_SCANAPLUS="no"; + HW_PIPISTRELLO_OLS="no"; fi # glibmm-2.4 is needed for the C++ bindings. @@ -375,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 ], + [{ 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"; @@ -413,10 +451,19 @@ AC_CHECK_PROG([HAVE_JAVAC], [javac], [yes], [no]) if test "x$HAVE_JAVAC" = "xyes"; then AX_PROG_JAVAC - AX_JNI_INCLUDE_DIR + if test "x$JNI_INCLUDE_DIRS" = "xauto"; then + if test "x$cross_compiling" = "xyes"; then + JNI_INCLUDE_DIRS= + else + AX_JNI_INCLUDE_DIR + fi + fi for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS; do CXXFLAGS="$CXXFLAGS -I$JNI_INCLUDE_DIR" done + AC_LANG_PUSH([C++]) + AC_CHECK_HEADERS([jni.h], [], [BINDINGS_JAVA="no"; java_msg="Java JNI headers required"]) + AC_LANG_POP([C++]) else BINDINGS_JAVA="no"; java_msg="Java compiler required" fi @@ -564,6 +611,11 @@ if test "x$HW_OPENBENCH_LOGIC_SNIFFER" = "xyes"; then AC_DEFINE(HAVE_HW_OPENBENCH_LOGIC_SNIFFER, 1, [OpenBench Logic Sniffer (OLS) support]) fi +AM_CONDITIONAL(HW_PIPISTRELLO_OLS, test x$HW_PIPISTRELLO_OLS = xyes) +if test "x$HW_PIPISTRELLO_OLS" = "xyes"; then + AC_DEFINE(HAVE_HW_PIPISTRELLO_OLS, 1, [Pipistrello OLS support]) +fi + AM_CONDITIONAL(HW_RIGOL_DS, test x$HW_RIGOL_DS = xyes) if test "x$HW_RIGOL_DS" = "xyes"; then AC_DEFINE(HAVE_HW_RIGOL_DS, 1, [Rigol DS support]) @@ -574,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]) @@ -614,6 +671,11 @@ if test "x$HW_VICTOR_DMM" = "xyes"; then AC_DEFINE(HAVE_HW_VICTOR_DMM, 1, [Victor DMM support]) fi +AM_CONDITIONAL(HW_YOKOGAWA_DLM, test x$HW_YOKOGAWA_DLM = xyes) +if test "x$HW_YOKOGAWA_DLM" = "xyes"; then + AC_DEFINE(HAVE_HW_YOKOGAWA_DLM, 1, [Yokogawa DL/DLM support]) +fi + AM_CONDITIONAL(HW_ZEROPLUS_LOGIC_CUBE, test x$HW_ZEROPLUS_LOGIC_CUBE = xyes) if test "x$HW_ZEROPLUS_LOGIC_CUBE" = "xyes"; then AC_DEFINE(HAVE_HW_ZEROPLUS_LOGIC_CUBE, 1, [ZEROPLUS Logic Cube support]) @@ -664,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.1.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