md5, sha1, sha256, sha512: add gl_SET_CRYPTO_CHECK_DEFAULT
[gnulib.git] / m4 / gl-openssl.m4
index a14408d..c8f9dd9 100644 (file)
@@ -1,18 +1,25 @@
-# gl-openssl.m4 serial 2
+# gl-openssl.m4 serial 3
 dnl Copyright (C) 2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+AC_DEFUN([gl_SET_CRYPTO_CHECK_DEFAULT],
+[
+  m4_define([gl_CRYPTO_CHECK_DEFAULT], [$1])
+])
+gl_SET_CRYPTO_CHECK_DEFAULT([no])
+
 AC_DEFUN([gl_CRYPTO_CHECK],
 [
-  m4_divert_text([DEFAULTS], [with_openssl_default=no])
+  m4_divert_once([DEFAULTS], [with_openssl_default='gl_CRYPTO_CHECK_DEFAULT'])
 
   AC_ARG_WITH([openssl],
     [AS_HELP_STRING([--with-openssl],
       [use libcrypto hash routines. Valid ARGs are:
        'yes', 'no', 'auto' => use if available,
-       'optional' => use if available and warn if not available])],
+       'optional' => use if available and warn if not available;
+       default is ']gl_CRYPTO_CHECK_DEFAULT['])],
     [],
     [with_openssl=$with_openssl_default])