+# LC_CONFIG_CRYPTO
+#
+# Check whether to enable Lustre client crypto
+#
+AC_DEFUN([LC_CONFIG_CRYPTO], [
+AC_MSG_CHECKING([whether to enable Lustre client crypto])
+AC_ARG_ENABLE([crypto],
+ AC_HELP_STRING([--enable-crypto],
+ [enable Lustre client crypto]),
+ [], [enable_crypto="auto"])
+AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno], [
+ AC_MSG_RESULT(
+ )
+ LC_IS_ENCRYPTED
+ LC_FSCRYPT_SUPPORT])
+AS_IF([test "x$has_fscrypt_support" = xyes], [
+ AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via in-kernel fscrypt])
+ enable_crypto=yes],
+ [AS_IF([test "x$has_is_encrypted" = xyes], [
+ AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via embedded llcrypt])
+ AC_DEFINE(CONFIG_LL_ENCRYPTION, 1, [embedded llcrypt])
+ enable_crypto=yes
+ enable_llcrypt=yes], [
+ AS_IF([test "x$enable_crypto" = xyes],
+ [AC_MSG_ERROR([Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.])])
+ AS_IF([test "x$enable_crypto" != xno -a "x$enable_dist" = xno],
+ [AC_MSG_WARN(Lustre client crypto cannot be enabled because of lack of encryption support in your kernel.)])
+ enable_crypto=no])])
+AS_IF([test "x$enable_dist" != xno], [
+ enable_crypto=yes
+ enable_llcrypt=yes])
+AC_MSG_RESULT([$enable_crypto])
+]) # LC_CONFIG_CRYPTO
+
+#