changeset 17576:637757226041

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.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 07 Dec 2013 23:43:23 -0800
parents 27a601c7d9d8
children 5309e7f8551d
files ChangeLog m4/gl-openssl.m4
diffstat 2 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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
--- a/m4/gl-openssl.m4
+++ b/m4/gl-openssl.m4
@@ -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])