--- /dev/null
+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
--- /dev/null
+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
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
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