summaryrefslogtreecommitdiffstats
path: root/patches/nfs-utils-2.5.3/0002-configure-check-for-rpc-rpc.h-presence.patch
blob: 27519121c67c6dad9b5bd9b9e1d0163ef21cd06a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Roland Hieber <rhi@pengutronix.de>
Date: Tue, 25 May 2021 01:08:07 +0200
Subject: [PATCH] configure: check for rpc/rpc.h presence

Recent versions of glibc (since 2.26?) no longer supply rpc/rpc.h.
Detect such cases and prompt the user to build with libtirpc instead.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
Origin: upstream, http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=be7365239abf8556773b063730621967b9971708
---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index f2e1bd30d0f2..25e988dfa33c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -335,6 +335,13 @@ AC_CHECK_HEADERS([sched.h], [], [])
 AC_CHECK_FUNCS([unshare fstatat statx], [] , [])
 AC_LIBPTHREAD([])
 
+# rpc/rpc.h can come from the glibc or from libtirpc
+nfsutils_save_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${CPPFLAGS} ${TIRPC_CFLAGS}"
+AC_CHECK_HEADER(rpc/rpc.h, ,
+                AC_MSG_ERROR([Header file rpc/rpc.h not found - maybe try building with --enable-tirpc]))
+CPPFLAGS="${nfsutils_save_CPPFLAGS}"
+
 if test "$enable_nfsv4" = yes; then
   dnl check for libevent libraries and headers
   AC_LIBEVENT