summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-04-18 13:36:23 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-04-18 13:39:35 +0200
commit64179b62d866b7ce189f7a66845e6bc099455e7c (patch)
tree91eb918f1359135b04b64d2873a80606310c16d5
parent33cfcfd9f0378625d3bddbd2c8ac5aad4b646f26 (diff)
downloadcurl-bagder/configure-openssl-ldl.tar.gz
configure: fix the -ldl check for openssl, add -lpthread checkbagder/configure-openssl-ldl
The check for if -ldl is needed to build with (a statically built) openssl was broken. This repairs the check, and adds a check for -lpthread as well since OpenSSL 1.1.0+ does in fact require -lpthread so only adding -ldl for a static openssl build is no longer enough. Reported-by: Jay Satiro Fixes #1426
-rw-r--r--configure.ac86
1 files changed, 42 insertions, 44 deletions
diff --git a/configure.ac b/configure.ac
index b492a29a5..4a64e53d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -1517,52 +1517,50 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
AC_CHECK_LIB(crypto, HMAC_Init_ex,[
HAVECRYPTO="yes"
LIBS="-lcrypto $LIBS"], [
- LDFLAGS="$CLEANLDFLAGS"
- CPPFLAGS="$CLEANCPPFLAGS"
- LIBS="$CLEANLIBS"
- ])
- ])
-
- if test X"$HAVECRYPTO" = X"yes"; then
- AC_MSG_CHECKING([OpenSSL linking without -ldl])
- saved_libs=$LIBS
- AC_TRY_LINK(
- [
- #include <openssl/evp.h>
- ],
- [
- SSLeay_add_all_algorithms();
- ],
- [
- AC_MSG_RESULT(yes)
- LIBS="$saved_libs"
- ],
- [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([OpenSSL linking with -ldl])
- LIBS="-ldl $LIBS"
- AC_TRY_LINK(
- [
- #include <openssl/evp.h>
- ],
- [
- SSLeay_add_all_algorithms();
- ],
- [
- AC_MSG_RESULT(yes)
- LIBS="$saved_libs -ldl"
- ],
- [
- AC_MSG_RESULT(no)
- LIBS="$saved_libs"
- ]
- )
+ dnl still no, but what about with -ldl?
+ AC_MSG_CHECKING([OpenSSL linking with -ldl])
+ LIBS="-ldl $LIBS"
+ AC_TRY_LINK(
+ [
+ #include <openssl/err.h>
+ ],
+ [
+ ERR_clear_error();
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ HAVECRYPTO="yes"
+ ],
+ [
+ AC_MSG_RESULT(no)
+ dnl ok, so what about bouth -ldl and -lpthread?
+
+ AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
+ LIBS="-lpthread $LIBS"
+ AC_TRY_LINK(
+ [
+ #include <openssl/err.h>
+ ],
+ [
+ ERR_clear_error();
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ HAVECRYPTO="yes"
+ ],
+ [
+ AC_MSG_RESULT(no)
+ LDFLAGS="$CLEANLDFLAGS"
+ CPPFLAGS="$CLEANCPPFLAGS"
+ LIBS="$CLEANLIBS"
+
+ ])
- ]
- )
+ ])
- fi
+ ])
+ ])
if test X"$HAVECRYPTO" = X"yes"; then
dnl This is only reasonable to do if crypto actually is there: check for