From 092e35cdb39fd12d16e5db27d53947f4d85f95c5 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Wed, 3 Dec 2014 04:16:24 +0000 Subject: Misc (re #1782): Fixed OpenSSL detection in configure script due to incomplete dependencies and bad library order, which causes OpenSSL detection failure on some platform such as Android mips and arm64. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4966 74dad513-b988-da41-8d7b-12977e46ad98 --- aconfigure | 6 +++--- aconfigure.ac | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aconfigure b/aconfigure index 18bbc56f..0c01a785 100755 --- a/aconfigure +++ b/aconfigure @@ -7675,7 +7675,7 @@ if ${ac_cv_lib_crypto_ERR_load_BIO_strings+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" +LIBS="-lcrypto -ldl -lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7706,7 +7706,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_load_BIO_strings" >&5 $as_echo "$ac_cv_lib_crypto_ERR_load_BIO_strings" >&6; } if test "x$ac_cv_lib_crypto_ERR_load_BIO_strings" = xyes; then : - libcrypto_present=1 && LIBS="$LIBS -lcrypto" + libcrypto_present=1 && LIBS="-lcrypto -ldl -lz $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5 @@ -7746,7 +7746,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5 $as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; } if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then : - libssl_present=1 && LIBS="$LIBS -lssl" + libssl_present=1 && LIBS="-lssl $LIBS" fi if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then diff --git a/aconfigure.ac b/aconfigure.ac index 8a5dd2c6..fd23234d 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -1532,8 +1532,8 @@ AC_ARG_ENABLE(ssl, AC_SUBST(libssl_present) AC_SUBST(libcrypto_present) AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1]) - AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="$LIBS -lcrypto"]) - AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="$LIBS -lssl"]) + AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="-lcrypto -ldl -lz $LIBS"],,-ldl -lz) + AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="-lssl $LIBS"]) if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then AC_MSG_RESULT([OpenSSL library found, SSL support enabled]) # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK -- cgit v1.2.3