diff mbox series

[nfs-utils,2/2] configure: check for rpc/rpc.h presence

Message ID 20210525112729.29062-2-rhi@pengutronix.de (mailing list archive)
State New
Headers show
Series [nfs-utils,1/2] README: update git repository URL | expand

Commit Message

Roland Hieber May 25, 2021, 11:27 a.m. UTC
Recent versions of glibc (since 2.26?) no longer supply rpc/rpc.h, and
in previous versions, RPC was optional. Detect such cases and prompt the
user to build with libtirpc instead.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Steve Dickson May 25, 2021, 6:08 p.m. UTC | #1
On 5/25/21 7:27 AM, Roland Hieber wrote:
> Recent versions of glibc (since 2.26?) no longer supply rpc/rpc.h, and
> in previous versions, RPC was optional. Detect such cases and prompt the
> user to build with libtirpc instead.
> 
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Committed... (tag: nfs-utils-2-5-4-rc5)

steved.
> ---
>  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
>
diff mbox series

Patch

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