]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl-openssl.m4: modify library order for openssl linking
authorMichael Afanasiev <mafanasiev@gmail.com>
Thu, 7 Oct 2021 18:23:21 +0000 (14:23 -0400)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 8 Oct 2021 08:50:57 +0000 (10:50 +0200)
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

m4/curl-openssl.m4

index e008c45133bc118a0540a9cd32ffd6f6361b557a..5309f33d2e3c23d0c8f4b7e951f88940597ed186 100644 (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>