]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
configure: Move rpcsecgss checking into aclocal
authorChuck Lever <chuck.lever@oracle.com>
Mon, 16 Mar 2009 17:31:27 +0000 (13:31 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 16 Mar 2009 17:31:27 +0000 (13:31 -0400)
Clean up: Introduce two more aclocal scripts for handling rpcsecgss
dependency checking.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Makefile.am
aclocal/librpcsecgss.m4 [new file with mode: 0644]
aclocal/rpcsec_vers.m4 [new file with mode: 0644]
configure.ac

index 6541fb7eaed3c14cfce8f293c97812b55e920e07..098446bf781a5522197814906106a990086064c8 100644 (file)
@@ -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 (file)
index 0000000..a81819e
--- /dev/null
@@ -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 (file)
index 0000000..df7cfb9
--- /dev/null
@@ -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
index 0d5f5a6054ba715a4e8a214c9878b7e3e027e9b6..7d25384912feaf4146d7328071665e0e4ab07203 100644 (file)
@@ -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