From 6447f80c17077f924b2d58e07b38d32429edcb9b Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 30 Jun 2008 13:16:49 -0700 Subject: [PATCH] Use AC_CHECK_LIB before PKG_CHECK_MODULES for openssl Previously, the code was using PKG_CHECK_EXISTS before PKG_CHECK_MODULES, (to cater to OpenBSD systems that include openssl by default but without a .pc file). But this meant that systems that didn't have openssl installed at all would not get any error message at configure time. Now, if the SHA1_Init function is found in -lcrypto without any additional flags, then that's used. Otherwise, pkg-config is used to find the right flags to link against libcrypto. And if that fails, a nice error message is now generated. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8abc9a91f..d7a3d6893 100644 --- a/configure.ac +++ b/configure.ac @@ -1110,7 +1110,7 @@ if test "x$SHA1_LIB" = "x" ; then [Define to use libmd SHA1 functions instead of OpenSSL libcrypto])]) fi if test "x$SHA1_LIB" = "x" ; then - PKG_CHECK_EXISTS([openssl], + AC_CHECK_LIB([crypto], [SHA1_Init], [], [PKG_CHECK_MODULES([OPENSSL], [openssl], [OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])]) SHA1_LIB="$OPENSSL_LIB_FLAGS -lcrypto"