Use pkg-config to find OpenSSL bind-9.14.4 appears to have introduced a new test for finding SSL libraries, and it uses hard-coded paths ending in /lib. On systems where /usr/lib contains 32-bit libraries and /usr/lib64 contains 64-bit libraries, it finds the incorrect 32-bit libraries. It then adds a -L flag to the 32-bit library directory, which produces warnings about finding the wrong library format. If linking with libdb, libtool replaces -ldb with a full path to the library, using the 32-bit directory specified with the -L flag, which causes linking to fail. Fix by letting pkg-config find the OpenSSL library if it can. This skips adding the incorrect -L flag. Leave the hard-coded (possibly incorrect) paths alone. Also fix both the existing pkg-config OpenSSL check, and the copy being added here. Apparently the test needs to search for libcrypto, not crypto. diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4 index 0000000..0000000 100644 --- a/m4/ax_check_openssl.m4 +++ b/m4/ax_check_openssl.m4 @@ -41,16 +41,26 @@ AC_DEFUN([AX_CHECK_OPENSSL], [ [AS_HELP_STRING([--with-openssl=DIR], [root of the OpenSSL directory])], [ - AS_CASE([$with_openssl], - [""|y|ye|yes],[ssldirs="$default_ssldirs"], - [n|no],[AC_MSG_ERROR([Invalid --with-openssl value])], - [*],[ssldirs="$withval"], - [ssldirs="$default_ssldirs"] - ) + AS_CASE([$with_openssl], + [""|y|ye|yes],[ + # if pkg-config is installed and openssl has installed + # a .pc file, then use that information and don't + # search ssldirs + PKG_CHECK_MODULES([OPENSSL], [libcrypto], + [ + found=true + ssldirs="" + ], + [ssldirs="$default_ssldirs"]) + ], + [n|no],[AC_MSG_ERROR([Invalid --with-openssl value])], + [*],[ssldirs="$withval"], + [ssldirs="$default_ssldirs"] + ) ], [ # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs - PKG_CHECK_MODULES([OPENSSL], [crypto], + PKG_CHECK_MODULES([OPENSSL], [libcrypto], [found=true], [ssldirs="$default_ssldirs"])