bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] md5sum, sha*sum: use libcrypto where available


From: Pádraig Brady
Subject: Re: [PATCH] md5sum, sha*sum: use libcrypto where available
Date: Sun, 08 Dec 2013 12:46:04 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 12/08/2013 07:45 AM, Paul Eggert wrote:
> Pádraig Brady wrote:
> 
>> If that was further adjusted to document the default,
>> then we could adjust coreutils to using this mechanism.
> 
> I pushed the following into gnulib to try to support that.
> This is tested with GNU Emacs, but not with coreutils.
> 
> ---
>  ChangeLog        |  9 +++++++++
>  m4/gl-openssl.m4 | 13 ++++++++++---
>  2 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 5d935ad..9688c32 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,5 +1,14 @@
>  2013-12-07  Paul Eggert  <address@hidden>
>  
> +     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
> diff --git a/m4/gl-openssl.m4 b/m4/gl-openssl.m4
> index a14408d..c8f9dd9 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])

Looks great. I see the emacs usage here:
http://git.sv.gnu.org/gitweb/?p=emacs.git;a=commit;h=c46c5796

thanks!
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]