]> granicus.if.org Git - curl/commitdiff
configure: Add dependent libraries after crypto
authorMax Dymond <cmeister2@gmail.com>
Tue, 26 Jun 2018 08:29:48 +0000 (09:29 +0100)
committerMax Dymond <cmeister2@gmail.com>
Wed, 27 Jun 2018 07:56:23 +0000 (08:56 +0100)
The linker is pretty dumb and processes things left to right, keeping a
tally of symbols it hasn't resolved yet. So, we need -ldl to appear
after -lcrypto otherwise the linker won't find the dl functions.

Closes #2684

configure.ac

index f38e1c0ce5cf40348b84848a8c4ad99c81612f36..d23be37c6d2ce9764b38f0964f16b1e7895a4dcc 100755 (executable)
@@ -1657,7 +1657,7 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
 
        dnl still no, but what about with -ldl?
        AC_MSG_CHECKING([OpenSSL linking with -ldl])
-       LIBS="$LIBS -ldl -lcrypto"
+       LIBS="$CLEANLIBS -lcrypto -ldl"
        AC_TRY_LINK(
        [
          #include <openssl/err.h>
@@ -1671,10 +1671,10 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
        ],
        [
          AC_MSG_RESULT(no)
-         dnl ok, so what about bouth -ldl and -lpthread?
+         dnl ok, so what about both -ldl and -lpthread?
 
          AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
-         LIBS="$CLEANLIBS -ldl -lpthread -lcrypto"
+         LIBS="$CLEANLIBS -lcrypto -ldl -lpthread"
          AC_TRY_LINK(
          [
            #include <openssl/err.h>