diff --git a/aconfigure b/aconfigure index abf55078a..be4cd0fea 100755 --- a/aconfigure +++ b/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 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 diff --git a/aconfigure.ac b/aconfigure.ac index b17f56818..781b01bc6 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -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 ]], + [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