diff --git a/m4/check_ssl.m4 b/m4/check_ssl.m4 index 0dc1f3bf00..49b64c3f9f 100644 --- a/m4/check_ssl.m4 +++ b/m4/check_ssl.m4 @@ -46,7 +46,11 @@ if test "x${SSL_LIBS}" = "x" ; then SSLDIR="${ssldir}" SSL_CFLAGS="-I$ssldir/include -I$ssldir/include/openssl"; SSL_CXXFLAGS="-I$ssldir/include -I$ssldir/include/openssl"; - SSL_LIBS="-L$ssldir -L$ssldir/lib -lssl -lcrypto -ldl -lz" + SSL_LIBS="-L$ssldir -L$ssldir/lib -lssl -lcrypto" + AC_CHECK_LIB([dl], [dlopen], + [SSL_LIBS="${SSL_LIBS} ${sah_lib_last}"]) + AC_CHECK_LIB([z], [gzopen], + [SSL_LIBS="${SSL_LIBS} ${sah_lib_last}"]) break; fi if test -f "$dir/include/ssl.h"; then @@ -55,6 +59,10 @@ if test "x${SSL_LIBS}" = "x" ; then SSL_CFLAGS="-I$ssldir/include/" SSL_CXXFLAGS="-I$ssldir/include/" SSL_LIBS="-L$ssldir -L$ssldir/lib -lssl -lcrypto" + AC_CHECK_LIB([dl], [dlopen], + [SSL_LIBS="${SSL_LIBS} ${sah_lib_last}"]) + AC_CHECK_LIB([z], [gzopen], + [SSL_LIBS="${SSL_LIBS} ${sah_lib_last}"]) break; fi done