Skip to contentSkip to conversation

Let the configure script find getrpcbynumber in libtirpc

PATCH In review Petr Vorel 2 participants 2 messages Nov 22, 2019 – Dec 11, 2019

Subsystems (2)
lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 Let the configure script find getrpcbynumber in libtirpc

From: Thomas Petazzoni <[email protected]>

The getrpcbynumber() function may not be available in the C library, but only in the libtirpc library. Take this into account when checking for the existence of getrpcbynumber() and getrpcbynumber_r().

[ pvorel: patch taken from Buildroot distribution ]
---
 configure.ac | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
configure.ac +13 -1
index 949ff9fc..e9699752 100644
@@ -534,11 +534,23 @@ AC_FUNC_STAT
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \
                gethostbyaddr gethostbyname gethostname getmntent \
-               getnameinfo getrpcbyname getrpcbynumber getrpcbynumber_r getifaddrs \
+               getnameinfo getrpcbyname getifaddrs \
                gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \
                ppoll realpath rmdir select socket strcasecmp strchr strdup \
                strerror strrchr strtol strtoul sigprocmask name_to_handle_at])
 
+save_CFLAGS=$CFLAGS
+save_LIBS=$LIBS
+CFLAGS="$CFLAGS $AM_CPPFLAGS"
+LIBS="$LIBS $LIBTIRPC"
+AC_CHECK_FUNCS([getrpcbynumber getrpcbynumber_r])
+CFLAGS=$save_CFLAGS
+LIBS=$save_LIBS
+
+if test "$ac_cv_func_getrpcbynumber_r" != "yes" -a "$ac_cv_func_getrpcbynumber" != "yes"; then
+   AC_MSG_ERROR([Neither getrpcbynumber_r nor getrpcbynumber are available])
+fi
+
 dnl *************************************************************
 dnl Check for data sizes
 dnl *************************************************************
Signature · 1 line
2.24.0
#1 lore raw
Quoted 10 lines · Petr Vorel

From: Thomas Petazzoni <[email protected]>

The getrpcbynumber() function may not be available in the C library, but only in the libtirpc library. Take this into account when checking for the existence of getrpcbynumber() and getrpcbynumber_r().

[ pvorel: patch taken from Buildroot distribution ]

Committed... (tag: nfs-utils-2-4-3-rc3)

steved.

Quoted 34 lines
---
 configure.ac | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
configure.ac +13 -1
index 949ff9fc..e9699752 100644
@@ -534,11 +534,23 @@ AC_FUNC_STAT
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \
                gethostbyaddr gethostbyname gethostname getmntent \
-               getnameinfo getrpcbyname getrpcbynumber getrpcbynumber_r getifaddrs \
+               getnameinfo getrpcbyname getifaddrs \
                gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \
                ppoll realpath rmdir select socket strcasecmp strchr strdup \
                strerror strrchr strtol strtoul sigprocmask name_to_handle_at])
 
+save_CFLAGS=$CFLAGS
+save_LIBS=$LIBS
+CFLAGS="$CFLAGS $AM_CPPFLAGS"
+LIBS="$LIBS $LIBTIRPC"
+AC_CHECK_FUNCS([getrpcbynumber getrpcbynumber_r])
+CFLAGS=$save_CFLAGS
+LIBS=$save_LIBS
+
+if test "$ac_cv_func_getrpcbynumber_r" != "yes" -a "$ac_cv_func_getrpcbynumber" != "yes"; then
+   AC_MSG_ERROR([Neither getrpcbynumber_r nor getrpcbynumber are available])
+fi
+
 dnl *************************************************************
 dnl Check for data sizes
 dnl *************************************************************