Blob Blame History Raw
diff --git a/configure.ac b/configure.ac
index 14fc0b826..0b48807f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -293,6 +293,10 @@ else
         CFLAGS="${CFLAGS} -g -rdynamic"
 fi
 
+AC_ARG_WITH([libtirpc],
+        AS_HELP_STRING([--with-libtirpc], [Use libtirpc as RPC implementation (instead of sunrpc)]),
+        [], [with_libtirpc=no])
+
 AC_ARG_WITH([ipv6-default], AC_HELP_STRING([--with-ipv6-default], [Set IPv6 as default.]))
 if test "x$with_ipv6_default" = "xyes"; then
         IPV6_DEFAULT=yes
@@ -1066,6 +1070,14 @@ AC_SUBST(GF_DISTRIBUTION)
 GF_HOST_OS=""
 GF_LDFLAGS="-rdynamic"
 
+dnl include tirpc for IPv6 builds
+if test "x$with_libtirpc" = "xyes" || test "x$IPV6_DEFAULT" = "xyes" ; then
+    PKG_CHECK_MODULES([TIRPC], [libtirpc],
+       [GF_CFLAGS="$GF_CFLAGS $TIRPC_CFLAGS"; GF_LDFLAGS="$GF_LDFLAGS $TIRPC_LIBS";],
+       [AC_MSG_ERROR([libtirpc requested or needed for IPv6 default but library not found])]
+    )
+fi
+
 dnl include tirpc for IPv6 builds
 if test "x$IPV6_DEFAULT" = "xyes"; then
         AC_CHECK_LIB([tirpc], [xdr_string], , AC_MSG_ERROR([libtirpc is required to build glusterfs with IPv6 default]))