summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2014-08-19 02:18:07 +0000
committerLiong Sauw Ming <ming@teluu.com>2014-08-19 02:18:07 +0000
commitb3f49ebccc60d39c32988296722a2ecdbc82adf6 (patch)
tree82a3442dafc715058b2e14df14051cf0a865bcd0
parentd536d4dffae8895d80a4c4865c548699e32a6ed4 (diff)
Re #1751 (misc): Fixed compilation error due to the lack of the SSLv2 methods.
The fix will autodetect this and define OPENSSL_NO_SSL2 if necessary. Related to #1321. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4892 74dad513-b988-da41-8d7b-12977e46ad98
-rwxr-xr-xaconfigure43
-rw-r--r--aconfigure.ac4
2 files changed, 47 insertions, 0 deletions
diff --git a/aconfigure b/aconfigure
index 2ab34658..ba0e6d25 100755
--- a/aconfigure
+++ b/aconfigure
@@ -7717,6 +7717,49 @@ $as_echo "OpenSSL library found, SSL support enabled" >&6; }
#AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1)
$as_echo "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSLv2_method in -lssl" >&5
+$as_echo_n "checking for SSLv2_method in -lssl... " >&6; }
+if ${ac_cv_lib_ssl_SSLv2_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SSLv2_method ();
+int
+main ()
+{
+return SSLv2_method ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ssl_SSLv2_method=yes
+else
+ ac_cv_lib_ssl_SSLv2_method=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSLv2_method" >&5
+$as_echo "$ac_cv_lib_ssl_SSLv2_method" >&6; }
+if test "x$ac_cv_lib_ssl_SSLv2_method" = xyes; then :
+ libssl_no_ssl2=1
+fi
+
+ if test "x$libssl_no_ssl2" != "x1"; then
+ CFLAGS="$CFLAGS -DOPENSSL_NO_SSL2=1"
+ fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ** OpenSSL libraries not found, disabling SSL support **" >&5
$as_echo "** OpenSSL libraries not found, disabling SSL support **" >&6; }
diff --git a/aconfigure.ac b/aconfigure.ac
index 25a6c9bc..b7bf92e0 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -1521,6 +1521,10 @@ AC_ARG_ENABLE(ssl,
# PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK
#AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1)
AC_DEFINE(PJ_HAS_SSL_SOCK, 1)
+ AC_CHECK_LIB(ssl,SSLv2_method,[libssl_no_ssl2=1])
+ if test "x$libssl_no_ssl2" != "x1"; then
+ CFLAGS="$CFLAGS -DOPENSSL_NO_SSL2=1"
+ fi
else
AC_MSG_RESULT([** OpenSSL libraries not found, disabling SSL support **])
fi