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>
This commit is contained in:
Yaakov Selkowitz 2010-04-13 13:32:51 -05:00
parent 65a2c09549
commit 0d8fe2fe5c

View File

@ -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],