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