From 43593319b31e6b0175b8eec4433bac744959822d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 7 Dec 2013 23:43:23 -0800 Subject: [PATCH] md5, sha1, sha256, sha512: add gl_SET_CRYPTO_CHECK_DEFAULT MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 . * m4/gl-openssl.m4(gl_SET_CRYPTO_CHECK_DEFAULT): New macro. (gl_CRYPTO_CHECK): Use it. Mention the default in --help output. --- ChangeLog | 9 +++++++++ m4/gl-openssl.m4 | 13 ++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d935ad2e..9688c32d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2013-12-07 Paul Eggert + 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 + . + * 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 diff --git a/m4/gl-openssl.m4 b/m4/gl-openssl.m4 index a14408dd5..c8f9dd95e 100644 --- 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]) -- 2.11.0