X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=configure.ac;h=98ce84b82dd56fa84bea548ef7e19c81e89fd800;hb=c90beca7801b16e46ffd4d74c9dd21b02a045ab5;hp=c1ca46fe67ed7621ca61aa8f8d95ec1373bc64d6;hpb=2379783d85a90bc2930f7eaff348c91b2d60d015;p=libsigrok.git diff --git a/configure.ac b/configure.ac index c1ca46fe..98ce84b8 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ AH_BOTTOM([#endif /* SR_CONFIG_H */]) # Enable more compiler warnings via -Wall and -Wextra. Add -fvisibility=hidden # and enforce use of SR_API to explicitly mark all public API functions. -CFLAGS="$CFLAGS -Wall -Wextra -fvisibility=hidden" +CFLAGS="$CFLAGS -Wall -Wextra -Wmissing-prototypes -fvisibility=hidden" # Checks for programs. AC_PROG_CC @@ -271,7 +271,7 @@ SR_PKGLIBS="" # libm (the standard math library) is always needed. AC_SEARCH_LIBS([pow], [m]) -# RPC is only needed for VXI support +# RPC is only needed for VXI support. AC_MSG_CHECKING([for RPC support]) AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [CLIENT *rpc_test(void)], @@ -279,9 +279,9 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [AC_MSG_RESULT([yes]); have_rpc=1], [AC_MSG_RESULT([no]); have_rpc=0]) # Define HAVE_RPC in config.h if we found RPC support. -AC_DEFINE_UNQUOTED(HAVE_RPC, [$have_rpc],[Specifies whether we have RPC support.]) +AC_DEFINE_UNQUOTED(HAVE_RPC, [$have_rpc], [Specifies whether we have RPC support.]) # VXI support is only compiled if RPC support was found. -AM_CONDITIONAL(NEED_RPC, test "x$have_rpc" != x0) +AM_CONDITIONAL(NEED_RPC, test "x$have_rpc" != "x0") # libglib-2.0 is always needed. Abort if it's not found. # Note: glib-2.0 is part of the libsigrok API (hard pkg-config requirement). @@ -316,6 +316,21 @@ fi # Serial port helper code is only compiled in if libserialport was found. AM_CONDITIONAL(NEED_SERIAL, test "x$have_libserialport" != xno) +PKG_CHECK_MODULES([librevisa], [librevisa >= 0.0.20130812], + [have_librevisa="yes"; CFLAGS="$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. +if test "x$have_librevisa" != "xno"; then + AC_DEFINE_UNQUOTED(HAVE_LIBREVISA, [1], + [Specifies whether we have librevisa.]) +fi + # libusb-1.0 is only needed for some hardware drivers. Disable the respective # drivers if it is not found. case "$host" in @@ -557,23 +572,9 @@ 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]) # Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN -AC_C_INLINE -AC_TYPE_INT8_T -AC_TYPE_INT16_T -AC_TYPE_INT32_T -AC_TYPE_INT64_T -AC_TYPE_UINT8_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T -AC_TYPE_SIZE_T - -# Checks for library functions. -AC_CHECK_FUNCS([gettimeofday memset strchr strcspn strdup strerror strncasecmp strstr strtol strtoul strtoull]) AC_SUBST(FIRMWARE_DIR, "$datadir/sigrok-firmware") AC_SUBST(MAKEFLAGS, '--no-print-directory') @@ -649,7 +650,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" "libserialport >= 0.1.0" "libusb-1.0 >= 1.0.16" "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" "librevisa >= 0.0.20130812" "libusb-1.0 >= 1.0.16" "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)"