Skip to content

Commit

Permalink
configure: check if OpenSSL linking wants -ldl
Browse files Browse the repository at this point in the history
To make it easier to link with static versions of OpenSSL, the configure
script now checks if -ldl is needed for linking.

Help-by: TJ Saunders
  • Loading branch information
bagder committed Jul 25, 2015
1 parent c5d060c commit a284b0e
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions configure.ac
Expand Up @@ -1509,6 +1509,46 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
])


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"
]
)
]
)

fi

if test X"$HAVECRYPTO" = X"yes"; then
dnl This is only reasonable to do if crypto actually is there: check for
dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
Expand Down

0 comments on commit a284b0e

Please sign in to comment.