1dnl SPDX-License-Identifier: GPL-2.0-or-later 2dnl Copyright (c) 2020 Petr Vorel <pvorel@suse.cz> 3dnl Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved. 4 5AC_DEFUN([LTP_CHECK_TIRPC], [ 6 dnl libtirpc library and headers 7 PKG_CHECK_MODULES([LIBTIRPC], [libtirpc >= 0.2.4], [ 8 have_libtirpc=yes 9 TIRPC_CFLAGS=$LIBTIRPC_CFLAGS 10 TIRPC_LIBS=$LIBTIRPC_LIBS 11 ], [have_libtirpc=no]) 12 13 dnl TI-RPC headers (in glibc, since 2.26 installed only when configured 14 dnl with --enable-obsolete-rpc) 15 dnl NOTE: To port tests for ntirpc would require use non-deprecated 16 dnl functions as it does not have the deprecated ones any more (e.g. use 17 dnl rpc_broadcast() instead of clnt_broadcast()), but glibc implementation 18 dnl does not have the new ones. We could either provide the deprecated 19 dnl functions (copy from libtirpc src/rpc_soc.c) or drop glibc tests. 20 AC_CHECK_FUNCS([xdr_char clnttcp_create], [have_rpc_glibc=yes]) 21 22 if test "x$have_libtirpc" = "xyes" -o "x$have_rpc_glibc" = "xyes"; then 23 AC_SUBST(HAVE_RPC, 1) 24 fi 25 26 dnl fix for old pkg-config (< 0.24) 27 dnl https://autotools.io/pkgconfig/pkg_check_modules.html 28 AC_SUBST(TIRPC_CFLAGS) 29 AC_SUBST(TIRPC_LIBS) 30]) 31