md5, sha1, sha256, sha512: add gl_SET_CRYPTO_CHECK_DEFAULT
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 8 Dec 2013 07:43:23 +0000 (23:43 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 8 Dec 2013 07:43:48 +0000 (23:43 -0800)
This provides a new way to specify the default for
gl_CRYPTO_CHECK, one that is reflected in the --help message.
Emacs uses this, as well as the old way.
This attempts to implement a suggestion by Pádraig Brady in
<http://lists.gnu.org/archive/html/coreutils/2013-12/msg00080.html>.
* m4/gl-openssl.m4(gl_SET_CRYPTO_CHECK_DEFAULT): New macro.
(gl_CRYPTO_CHECK): Use it.  Mention the default in --help output.

ChangeLog
m4/gl-openssl.m4

index 5d935ad..9688c32 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2013-12-07  Paul Eggert  <eggert@cs.ucla.edu>
 
 2013-12-07  Paul Eggert  <eggert@cs.ucla.edu>
 
+       md5, sha1, sha256, sha512: add gl_SET_CRYPTO_CHECK_DEFAULT
+       This provides a new way to specify the default for
+       gl_CRYPTO_CHECK, one that is reflected in the --help message.
+       Emacs uses this, as well as the old way.
+       This attempts to implement a suggestion by Pádraig Brady in
+       <http://lists.gnu.org/archive/html/coreutils/2013-12/msg00080.html>.
+       * m4/gl-openssl.m4(gl_SET_CRYPTO_CHECK_DEFAULT): New macro.
+       (gl_CRYPTO_CHECK): Use it.  Mention the default in --help output.
+
        md5, sha1, sha256, sha512: add 'auto', and a way to specify default
        * m4/gl-openssl.m4 (gl_CRYPTO_CHECK):
        Add support for a new option, --with-openssl=auto, which causes
        md5, sha1, sha256, sha512: add 'auto', and a way to specify default
        * m4/gl-openssl.m4 (gl_CRYPTO_CHECK):
        Add support for a new option, --with-openssl=auto, which causes
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.
 
 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],
 [
 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,
 
   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])
 
     [],
     [with_openssl=$with_openssl_default])