-AC_DEFUN([LC_PAGE_CONSTANT],
-[AC_MSG_CHECKING([if kernel have PageConstant defined])
-LB_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- #include <linux/page-flags.h>
-],[
- #ifndef PG_constant
- #error "Have no raid5 zcopy patch"
- #endif
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_PAGE_CONSTANT, 1, [kernel have PageConstant supported])
-],[
- AC_MSG_RESULT(no);
-])
-])
-
-# 2.6.24
-
-# 2.6.24 has bio_endio with 2 args
-AC_DEFUN([LC_BIO_ENDIO_2ARG],
-[AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
-LB_LINUX_TRY_COMPILE([
- #include <linux/bio.h>
-],[
- bio_endio(NULL, 0);
-], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_BIO_ENDIO_2ARG, 1,
- [kernel has bio_endio with 2 args])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-# 2.6.24 removes long aged procfs entry -> deleted member
-AC_DEFUN([LC_PROCFS_DELETED],
-[AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct])
-LB_LINUX_TRY_COMPILE([
- #include <linux/proc_fs.h>
-],[
- struct proc_dir_entry pde;
+AC_DEFUN([LC_CONFIG_GSS], [
+AC_MSG_CHECKING([whether to enable gss/krb5 support])
+AC_ARG_ENABLE([gss],
+ [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
+ [], [enable_gss="auto"])
+AC_MSG_RESULT([$enable_gss])
+
+AS_IF([test "x$enable_gss" != xno], [
+ LC_CONFIG_GSS_KEYRING
+ sunrpc_required=$enable_gss
+ LC_CONFIG_SUNRPC
+ sunrpc_required="no"
+
+ LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
+ [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
+ LB_CHECK_CONFIG_IM([CRYPTO_SHA1], [],
+ [AC_MSG_WARN([kernel SHA1 support is recommended by using GSS.])])
+ LB_CHECK_CONFIG_IM([CRYPTO_SHA256], [],
+ [AC_MSG_WARN([kernel SHA256 support is recommended by using GSS.])])
+ LB_CHECK_CONFIG_IM([CRYPTO_SHA512], [],
+ [AC_MSG_WARN([kernel SHA512 support is recommended by using GSS.])])
+
+ require_krb5=$enable_gss
+ AC_KERBEROS_V5
+ require_krb5="no"
+
+ AS_IF([test -n "$KRBDIR"], [
+ AC_CHECK_LIB([gssapi], [gss_export_lucid_sec_context], [
+ GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi"
+ gss_conf_test="success"
+ ], [
+ AC_CHECK_LIB([gssglue], [gss_export_lucid_sec_context], [
+ GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssglue"
+ gss_conf_test="success"
+ ], [
+ AS_IF([test "x$enable_gss" = xyes], [
+ AC_MSG_ERROR([
+
+libgssapi or libgssglue is not found, which is required by GSS.
+])
+ ], [
+ AC_MSG_WARN([
+
+libgssapi or libgssglue is not found, which is required by GSS.
+])
+ ])
+ ])
+ ])
+ AC_SUBST(GSSAPI_LIBS)
+ ])