]> granicus.if.org Git - curl/commitdiff
configure.ac: append extra linker flags instead of prepending them.
authorDan Johnson <computerdruid@google.com>
Thu, 28 Dec 2017 18:16:26 +0000 (18:16 +0000)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Sat, 13 Jan 2018 09:46:57 +0000 (10:46 +0100)
Link order should list libraries after the libraries that use them,
so when we're guessing that we might also need to add -ldl in order
to use -lssl, we should add -ldl after -lssl.

Closes https://github.com/curl/curl/pull/2234

configure.ac

index 5292937bb264ca861df63a7abda8b7a6ec3d3cfe..c223a04363598361e41a4b7fea7312b3d7cf929e 100755 (executable)
@@ -1656,7 +1656,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="-ldl $LIBS"
+       LIBS="$LIBS -ldl"
        AC_TRY_LINK(
        [
          #include <openssl/err.h>
@@ -1673,7 +1673,7 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
          dnl ok, so what about bouth -ldl and -lpthread?
 
          AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
-         LIBS="-lpthread $LIBS"
+         LIBS="$LIBS -lpthread"
          AC_TRY_LINK(
          [
            #include <openssl/err.h>