summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-12-03 03:51:52 +0000
committerPádraig Brady <P@draigBrady.com>2013-12-04 13:18:56 +0000
commitb53b0fd940382497e58a9e912f1262c2084fe534 (patch)
tree7b5fde00794f059d22b685f05794b754a4aa513e /configure.ac
parent2091f44993c4d0ad16cbe272c247bb452ae74216 (diff)
downloadcoreutils-b53b0fd940382497e58a9e912f1262c2084fe534.tar.xz
md5sum, sha*sum: use libcrypto where available
libcrypto is generally available and has well optimized crypto hash routines particular to various systems. For example, testing sha1sum with openssl-1.0.0j on an i3-2310M, gives a performance boost of about 40%: $ time sha1sum.old --tag ~/test.iso SHA1 (/home/padraig/test.iso) = 3c27f7ed01965fd2b89e22128fd62dc51a3bef30 real 0m4.692s user 0m4.499s sys 0m0.162s $ time sha1sum.new --tag ~/test.iso SHA1 (/home/padraig/test.iso) = 3c27f7ed01965fd2b89e22128fd62dc51a3bef30 real 0m2.685s user 0m2.512s sys 0m0.170s * configure.ac: By default, enable use of libcrypto if available. * src/local.mk: Link with libcrypto. * NEWS: Mention the md5sum and sha*sum improvements.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8a3ac48a0..16b6c35b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,17 @@ m4_syscmd([test "${GNULIB_POSIXCHECK+set}" = set])
m4_if(m4_sysval, [0], [], [dnl
gl_ASSERT_NO_GNULIB_POSIXCHECK])
+dnl Enable use of libcrypto if available.
+dnl Note we could do this as follows:
+dnl AS_VAR_SET_IF([with_openssl], [], [with_openssl=optional])
+dnl However that would not document the coreutils adjusted default,
+dnl so we add another --with-openssl description just to document that
+AC_ARG_WITH([openssl],
+ [AC_HELP_STRING([--with-openssl],
+ [The coreutils default is: --with-openssl=optional])],
+ [],
+ [with_openssl=optional])
+
AC_PROG_CC_STDC
AM_PROG_CC_C_O
AC_PROG_CPP