[Top][All Lists]

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

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

From: Paul Eggert
Subject: Re: [PATCH] md5sum, sha*sum: use libcrypto where available
Date: Sat, 07 Dec 2013 23:45:10 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

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
+       <>.
+       * 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.
+  m4_define([gl_CRYPTO_CHECK_DEFAULT], [$1])
-  m4_divert_text([DEFAULTS], [with_openssl_default=no])
+  m4_divert_once([DEFAULTS], [with_openssl_default='gl_CRYPTO_CHECK_DEFAULT'])
       [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['])],

reply via email to

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