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.
This commit is contained in:
parent
76576c87b0
commit
6447f80c17
|
@ -1110,7 +1110,7 @@ if test "x$SHA1_LIB" = "x" ; then
|
||||||
[Define to use libmd SHA1 functions instead of OpenSSL libcrypto])])
|
[Define to use libmd SHA1 functions instead of OpenSSL libcrypto])])
|
||||||
fi
|
fi
|
||||||
if test "x$SHA1_LIB" = "x" ; then
|
if test "x$SHA1_LIB" = "x" ; then
|
||||||
PKG_CHECK_EXISTS([openssl],
|
AC_CHECK_LIB([crypto], [SHA1_Init], [],
|
||||||
[PKG_CHECK_MODULES([OPENSSL], [openssl],
|
[PKG_CHECK_MODULES([OPENSSL], [openssl],
|
||||||
[OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])])
|
[OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])])
|
||||||
SHA1_LIB="$OPENSSL_LIB_FLAGS -lcrypto"
|
SHA1_LIB="$OPENSSL_LIB_FLAGS -lcrypto"
|
||||||
|
|
Loading…
Reference in New Issue