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.
This commit is contained in:
Vadim Zeitlin
2020-07-05 18:21:58 +02:00
parent bbf1953051
commit 101a693bc2
2 changed files with 23 additions and 3 deletions

10
configure vendored
View File

@@ -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 <Availability.h>
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

View File

@@ -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 <Availability.h>
],
[
#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