]> sigrok.org Git - libsigrok.git/commitdiff
configure: Add optional TI-RPC dependency, unbreak VXI communication.
authorSoeren Apel <redacted>
Sun, 26 Jul 2020 15:11:37 +0000 (17:11 +0200)
committerGerhard Sittig <redacted>
Fri, 9 Oct 2020 16:50:58 +0000 (18:50 +0200)
Recent glibc-2.26 no longer provides support for SunRPC, and libsigrok's
build support failed to detect the presence of libtirpc in that case.

  https://wiki.gentoo.org/wiki/Glibc_2.26_porting_notes/RPC_implementation

Extend the check, use either SunRPC or TI-RPC. Which re-enables VXI on
recent setups. This resolves bug #1473.

Makefile.am
README
configure.ac

index 88bf1eb988d53dd26dadabe0dbf8b390e4bfb238..bdd3c61b17f628a0b193795d824ba2ebf5ddcfac 100644 (file)
@@ -27,7 +27,7 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-python
 
 FIRMWARE_DIR = $(datadir)/sigrok-firmware
 
-local_includes = -Iinclude -I$(srcdir)/include -I$(srcdir)/src -I.
+local_includes = -Iinclude -I$(srcdir)/include -I$(srcdir)/src -I. @RPC_CFLAGS@
 if BINDINGS_CXX
 local_includes += -Ibindings/cxx/include -I$(srcdir)/bindings/cxx/include -Ibindings/cxx
 endif
diff --git a/README b/README
index c8141dc1ac196c2cde30992da91fda93f17ab6d4..5ab36116c1b646843356def9eeffea0c0679030c 100644 (file)
--- a/README
+++ b/README
@@ -38,6 +38,7 @@ Requirements for the C library:
  - pkg-config >= 0.22
  - libglib >= 2.32.0
  - libzip >= 0.10
+ - libtirpc (optional, used by VXI, fallback when glibc >= 2.26)
  - libserialport >= 0.1.1 (optional, used by some drivers)
  - librevisa >= 0.0.20130412 (optional, used by some drivers)
  - libusb-1.0 >= 1.0.16 (optional, used by some drivers)
index ee3481c4457aa2f572107b1cf2dbf0b0c06829d0..2f8c2c36faa49070730fa0fb90f365ad579124d8 100644 (file)
@@ -188,13 +188,25 @@ AS_CASE([$host_os], [mingw*], [SR_PREPEND([SR_EXTRA_LIBS], [-lws2_32])])
 SR_SEARCH_LIBS([SR_EXTRA_LIBS], [pow], [m])
 
 # RPC is only needed for VXI support.
-AC_CACHE_CHECK([for RPC support], [sr_cv_have_rpc],
+AC_CACHE_CHECK([for SunRPC support], [sr_cv_have_sunrpc],
        [AC_LINK_IFELSE([AC_LANG_PROGRAM(
                        [[#include <rpc/rpc.h>]m4_newline[CLIENT *rpc_test(void);]],
                        [[(void) clnt_create("", 0, 0, "");]])],
-               [sr_cv_have_rpc=yes], [sr_cv_have_rpc=no])])
+               [RPC_CFLAGS=""; RPC_LIBS=""; sr_cv_have_sunrpc=yes],
+               [sr_cv_have_sunrpc=no])])
+PKG_CHECK_MODULES([TIRPC],
+       [libtirpc],
+       [RPC_CFLAGS=$TIRPC_CFLAGS; SR_PREPEND([SR_EXTRA_LIBS], [$TIRPC_LIBS]); sr_cv_have_tirpc=yes],
+       [sr_cv_have_tirpc=no])
+AS_IF([test "x$sr_cv_have_sunrpc" = xyes -o "x$sr_cv_have_tirpc" = xyes],
+       [sr_cv_have_rpc=yes], [sr_cv_have_rpc=no])
+
+AC_SUBST(RPC_CFLAGS)
+AC_SUBST(RPC_LIBS)
+
 AS_IF([test "x$sr_cv_have_rpc" = xyes],
-       [AC_DEFINE([HAVE_RPC], [1], [Specifies whether we have RPC support.])])
+       [AC_DEFINE([HAVE_RPC], [1], [Specifies whether we have RPC support (either by SunRPC or libtirpc).])])
+
 # VXI support is only compiled if RPC support was found.
 AM_CONDITIONAL([NEED_RPC], [test "x$sr_cv_have_rpc" = xyes])
 
@@ -643,6 +655,8 @@ Enabled serial communication transports:
 
 Enabled SCPI backends:
  - TCP............................. yes
+ - SunRPC ......................... $sr_cv_have_sunrpc
+ - TI-RPC ......................... $sr_cv_have_tirpc
  - RPC............................. $sr_cv_have_rpc
  - serial.......................... $sr_have_serial_comm
  - VISA............................ $sr_have_librevisa