diff options
author | Yaakov Selkowitz <yselkowitz@users.sourceforge.net> | 2010-04-13 13:32:51 -0500 |
---|---|---|
committer | Yaakov Selkowitz <yselkowitz@users.sourceforge.net> | 2010-04-26 11:35:56 -0500 |
commit | 0d8fe2fe5c37659147cbecac793183c62fc6818a (patch) | |
tree | 39c6f67577c3b70e40f888a19bb8b9548aadd8ee | |
parent | 65a2c09549d2372c23b155addff428177708c910 (diff) |
Prefer libsha1 over libgcrypt
When no SHA1 implementation is specified, we should first prefer
system-builtin solutions (libc/libmd/CommonCrypto), then smaller
implementations over the larger ones. libsha1 is much smaller than
libgcrypt, so it should be first.
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Acked-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | configure.ac | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 1dc05f918..7b74820de 100644 --- a/configure.ac +++ b/configure.ac @@ -1382,15 +1382,6 @@ if test "x$with_sha1" = xlibmd; then [Use libmd SHA1 functions]) SHA1_LIBS=-lmd fi -AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes]) -if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then - with_sha1=libgcrypt -fi -if test "x$with_sha1" = xlibgcrypt; then - AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1], - [Use libgcrypt SHA1 functions]) - SHA1_LIBS=-lgcrypt -fi AC_CHECK_LIB([sha1], [sha1_begin], [HAVE_LIBSHA1=yes]) if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then with_sha1=libsha1 @@ -1400,6 +1391,15 @@ if test "x$with_sha1" = xlibsha1; then [Use libsha1 for SHA1]) SHA1_LIBS=-lsha1 fi +AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes]) +if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then + with_sha1=libgcrypt +fi +if test "x$with_sha1" = xlibgcrypt; then + AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1], + [Use libgcrypt SHA1 functions]) + SHA1_LIBS=-lgcrypt +fi # We don't need all of the OpenSSL libraries, just libcrypto AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes]) PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes], |