curl-openssl.m4: modify library order for openssl linking

lcrypto may depend on lz, and configure corrently fails with when
statically linking as the order is "-lz -lcrypto". This commit switches
the order to "-lcrypto -lz".

Closes #7826
This commit is contained in:
Michael Afanasiev 2021-10-07 14:23:21 -04:00 committed by Daniel Stenberg
parent 94696e1b51
commit 9597d2def7
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -437,7 +437,7 @@ if test "x$OPT_OPENSSL" != xno; then
dnl still no, but what about with -ldl?
AC_MSG_CHECKING([OpenSSL linking with -ldl])
LIBS="$CLEANLIBS -lcrypto -ldl"
LIBS="-lcrypto $CLEANLIBS -ldl"
AC_LINK_IFELSE([ AC_LANG_PROGRAM([[
#include <openssl/err.h>
]], [[
@ -453,7 +453,7 @@ if test "x$OPT_OPENSSL" != xno; then
dnl This may be necessary for static libraries.
AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
LIBS="$CLEANLIBS -lcrypto -ldl -lpthread"
LIBS="-lcrypto $CLEANLIBS -ldl -lpthread"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#include <openssl/err.h>