xref: /aosp_15_r20/external/ltp/m4/ltp-tirpc.m4 (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Workerdnl SPDX-License-Identifier: GPL-2.0-or-later
2*49cdfc7eSAndroid Build Coastguard Workerdnl Copyright (c) 2020 Petr Vorel <[email protected]>
3*49cdfc7eSAndroid Build Coastguard Workerdnl Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
4*49cdfc7eSAndroid Build Coastguard Worker
5*49cdfc7eSAndroid Build Coastguard WorkerAC_DEFUN([LTP_CHECK_TIRPC], [
6*49cdfc7eSAndroid Build Coastguard Worker	dnl libtirpc library and headers
7*49cdfc7eSAndroid Build Coastguard Worker	PKG_CHECK_MODULES([LIBTIRPC], [libtirpc >= 0.2.4], [
8*49cdfc7eSAndroid Build Coastguard Worker		have_libtirpc=yes
9*49cdfc7eSAndroid Build Coastguard Worker	], [have_libtirpc=no])
10*49cdfc7eSAndroid Build Coastguard Worker
11*49cdfc7eSAndroid Build Coastguard Worker	dnl TI-RPC headers (in glibc, since 2.26 installed only when configured
12*49cdfc7eSAndroid Build Coastguard Worker	dnl with --enable-obsolete-rpc)
13*49cdfc7eSAndroid Build Coastguard Worker	dnl NOTE: To port tests for ntirpc would require use non-deprecated
14*49cdfc7eSAndroid Build Coastguard Worker	dnl functions as it does not have the deprecated ones any more (e.g. use
15*49cdfc7eSAndroid Build Coastguard Worker	dnl rpc_broadcast() instead of clnt_broadcast()), but glibc implementation
16*49cdfc7eSAndroid Build Coastguard Worker	dnl does not have the new ones. We could either provide the deprecated
17*49cdfc7eSAndroid Build Coastguard Worker	dnl functions (copy from libtirpc src/rpc_soc.c) or drop glibc tests.
18*49cdfc7eSAndroid Build Coastguard Worker	AC_CHECK_FUNCS([xdr_char clnttcp_create], [have_rpc_glibc=yes])
19*49cdfc7eSAndroid Build Coastguard Worker
20*49cdfc7eSAndroid Build Coastguard Worker	if test "x$have_libtirpc" = "xyes" -o "x$have_rpc_glibc" = "xyes"; then
21*49cdfc7eSAndroid Build Coastguard Worker		AC_SUBST(HAVE_RPC, 1)
22*49cdfc7eSAndroid Build Coastguard Worker	fi
23*49cdfc7eSAndroid Build Coastguard Worker])
24