summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--aclocal/librpcsecgss.m416
-rw-r--r--aclocal/rpcsec_vers.m49
-rw-r--r--configure.ac23
4 files changed, 35 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am
index 6541fb7..098446b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,7 +43,8 @@ EXTRA_DIST = \
aclocal/tcp-wrappers.m4 \
aclocal/libtirpc.m4 \
aclocal/libevent.m4 \
- aclocal/libnfsidmap.m4
+ aclocal/libnfsidmap.m4 \
+ aclocal/rpcsec_vers.m4
ACLOCAL_AMFLAGS = -I aclocal
diff --git a/aclocal/librpcsecgss.m4 b/aclocal/librpcsecgss.m4
new file mode 100644
index 0000000..a81819e
--- /dev/null
+++ b/aclocal/librpcsecgss.m4
@@ -0,0 +1,16 @@
+dnl Checks for rpcsecgss library and headers
+dnl KRB5LIBS must be set before this function is invoked.
+dnl
+AC_DEFUN([AC_LIBRPCSECGSS], [
+
+ dnl Check for library, but do not add -lrpcsecgss to LIBS
+ AC_CHECK_LIB([rpcsecgss], [authgss_create_default], [librpcsecgss=1],
+ [AC_MSG_ERROR([librpcsecgss not found.])],
+ [-lgssglue -ldl])
+
+ AC_CHECK_LIB([rpcsecgss], [authgss_set_debug_level],
+ [AC_DEFINE([HAVE_AUTHGSS_SET_DEBUG_LEVEL], 1,
+ [Define to 1 if you have the `authgss_set_debug_level' function.])],,
+ [-lgssglue -ldl])
+
+])dnl
diff --git a/aclocal/rpcsec_vers.m4 b/aclocal/rpcsec_vers.m4
new file mode 100644
index 0000000..df7cfb9
--- /dev/null
+++ b/aclocal/rpcsec_vers.m4
@@ -0,0 +1,9 @@
+dnl Checks librpcsec version
+AC_DEFUN([AC_RPCSEC_VERSION], [
+
+ PKG_CHECK_MODULES([RPCSECGSS], [librpcsecgss >= 0.16], ,
+ [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss. If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])])
+
+ PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1])
+
+])dnl
diff --git a/configure.ac b/configure.ac
index 0d5f5a6..7d25384 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,17 +203,13 @@ if test "$enable_nfsv4" = yes; then
dnl check for nfsidmap libraries and headers
AC_LIBNFSIDMAP
- dnl librpcsecgss already has a dependency on libgssapi,
- dnl but we need to make sure we get the right version
- if test "$enable_gss" = yes; then
- PKG_CHECK_MODULES(RPCSECGSS, librpcsecgss >= 0.16, ,
- [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss. If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])
- ]
- )
- PKG_CHECK_MODULES(GSSGLUE, libgssglue >= 0.1)
- fi
-
+ dnl librpcsecgss already has a dependency on libgssapi,
+ dnl but we need to make sure we get the right version
+ if test "$enable_gss" = yes; then
+ AC_RPCSEC_VERSION
+ fi
fi
+
if test "$knfsd_cv_glibc2" = no; then
AC_CHECK_LIB(bsd, daemon, [LIBBSD="-lbsd"])
fi
@@ -249,11 +245,8 @@ if test "$enable_gss" = yes; then
dnl Check for Kerberos V5
AC_KERBEROS_V5
- dnl This is not done until here because we need to have KRBLIBS set
- dnl ("librpcsecgss=1" is so that it doesn't get added to LIBS)
- AC_CHECK_LIB(rpcsecgss, authgss_create_default, [librpcsecgss=1], AC_MSG_ERROR([librpcsecgss needed for nfsv4 support]), -lgssglue -ldl)
- AC_CHECK_LIB(rpcsecgss, authgss_set_debug_level,
- AC_DEFINE(HAVE_AUTHGSS_SET_DEBUG_LEVEL, 1, [Define this if the rpcsec_gss library has the function authgss_set_debug_level]),, -lgssglue -ldl)
+ dnl Invoked after AC_KERBEROS_V5; AC_LIBRPCSECGSS needs to have KRBLIBS set
+ AC_LIBRPCSECGSS
fi