From 101a693bc231979546571d056e67555f1df07a93 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 5 Jul 2020 18:21:58 +0200 Subject: [PATCH] Add check for 10.11 SDK to configure Verify that we're using a supported version of SDK and further improve the error message if building a test program fails to mention that Xcode 7.3 or later is required. --- configure | 10 +++++++++- configure.in | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c14085a4af..ac05aba5bf 100755 --- a/configure +++ b/configure @@ -18725,7 +18725,7 @@ if test "x$retest_macosx_linking" = "xyes"; then elif test "x$macosx_minver_specified" = "xyes"; then error_message="no, try using a different min OS version or omitting it." else - error_message="no, check that Xcode command line tools are installed." + error_message="no, check that command line tools from Xcode 7.3 or later are installed." fi ac_ext=c @@ -18773,10 +18773,17 @@ $as_echo_n "checking if C++ compiler ($CXX) works with SDK/version options... " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include + int main () { + #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100 + #else + #error macOS SDK version is too low, 10.11 or later is required. + #endif + ; return 0; } @@ -18786,6 +18793,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "yes" >&6; } else as_fn_error $? "$error_message" "$LINENO" 5 + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext diff --git a/configure.in b/configure.in index b8da4f823f..bac103241f 100644 --- a/configure.in +++ b/configure.in @@ -1350,7 +1350,7 @@ if test "x$retest_macosx_linking" = "xyes"; then elif test "x$macosx_minver_specified" = "xyes"; then error_message="no, try using a different min OS version or omitting it." else - error_message="no, check that Xcode command line tools are installed." + error_message="no, check that command line tools from Xcode 7.3 or later are installed." fi AC_LANG_PUSH(C) @@ -1360,7 +1360,19 @@ if test "x$retest_macosx_linking" = "xyes"; then AC_LANG_PUSH(C++) AC_MSG_CHECKING([if C++ compiler ($CXX) works with SDK/version options]) - AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([$error_message])]) + AC_TRY_LINK( + [ + #include + ], + [ + #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100 + #else + #error macOS SDK version is too low, 10.11 or later is required. + #endif + ], + [AC_MSG_RESULT([yes])], + [AC_MSG_ERROR([$error_message])] + ) AC_LANG_POP() fi