Re #2185: Modified the autodetection in configure script to try to compile a sample code instead.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@6018 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
2ba08831e3
commit
62fae52a43
14
aconfigure
14
aconfigure
|
@ -7955,22 +7955,24 @@ else
|
|||
*darwin*)
|
||||
SAVED_LIBS="$LIBS"
|
||||
LIBS="-framework Security"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <Security/SecureTransport.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
if (__builtin_available(macOS 10.3, iOS 11.3, *)) {
|
||||
SSLContextRef ssl_ctx;
|
||||
SSLReHandshake(ssl_ctx);
|
||||
}
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_ssl_backend=darwin
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
LIBS="$SAVED_LIBS"
|
||||
if test "x$ac_ssl_backend" = "xdarwin"; then
|
||||
$as_echo "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h
|
||||
|
|
|
@ -1578,16 +1578,20 @@ AC_ARG_ENABLE(darwin-ssl,
|
|||
*darwin*)
|
||||
SAVED_LIBS="$LIBS"
|
||||
LIBS="-framework Security"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],
|
||||
[ac_ssl_backend=darwin],)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Security/SecureTransport.h>]],
|
||||
[if (__builtin_available(macOS 10.12, iOS 10.0, *)) {
|
||||
SSLContextRef ssl_ctx;
|
||||
SSLReHandshake(ssl_ctx);
|
||||
}])],
|
||||
[ac_ssl_backend=darwin],)
|
||||
LIBS="$SAVED_LIBS"
|
||||
if test "x$ac_ssl_backend" = "xdarwin"; then
|
||||
AC_DEFINE(PJ_HAS_SSL_SOCK, 1)
|
||||
AC_DEFINE(PJ_SSL_SOCK_IMP, PJ_SSL_SOCK_IMP_DARWIN)
|
||||
LIBS="$LIBS -framework Security"
|
||||
AC_MSG_RESULT([Checking if Security framework for Darwin SSL is available... yes])
|
||||
AC_MSG_RESULT([Checking if Darwin SSL is available... yes])
|
||||
else
|
||||
AC_MSG_RESULT([Checking if Security framework for Darwin SSL is available... no])
|
||||
AC_MSG_RESULT([Checking if Darwin SSL is available... no])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue