From a4f9e207dc7bdf5525481423a26a3284fd11cb34 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 5 Jul 2020 19:29:26 +0200 Subject: [PATCH] Make macOS configure error messages even more precise Mention the configure options to use to correct the problem explicitly. Also restore the use AC_MSG_FAILURE() instead of AC_MSG_ERROR(), this was originally correct and just the calls to exit() were unnecessary. --- configure | 20 +++++++++++++++----- configure.in | 14 +++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/configure b/configure index b34c6d5ffd..38aee0cbe3 100755 --- a/configure +++ b/configure @@ -18721,13 +18721,17 @@ fi if test "x$retest_macosx_linking" = "xyes"; then if test "x$macosx_sdk_specified" = "xyes"; then - error_message="no, try using a different SDK or using the default one." + error_message="try using --with-macosx-sdk with a different SDK or \ +omitting it entirely to use the default one." elif test "x$macosx_minver_specified" = "xyes"; then - error_message="no, try using a different min OS version or omitting it." + error_message="try using --with-macosx-version-min with a different OS \ +version or omitting it entirely." else - error_message="no, check that command line tools from Xcode 7.2.1 or later are installed." + error_message="check that command line tools from Xcode 7.2.1 or later are installed." fi + error_message="building C++ programs doesn't work, $error_message" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -18751,7 +18755,10 @@ if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - as_fn_error $? "$error_message" "$LINENO" 5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "$error_message +See \`config.log' for more details" "$LINENO" 5; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -18792,7 +18799,10 @@ if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - as_fn_error $? "$error_message" "$LINENO" 5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "$error_message +See \`config.log' for more details" "$LINENO" 5; } fi rm -f core conftest.err conftest.$ac_objext \ diff --git a/configure.in b/configure.in index bbc744e4fb..e4034af723 100644 --- a/configure.in +++ b/configure.in @@ -1346,16 +1346,20 @@ dnl still compile and link both C and C++. If we didn't do this, then most dnl of the remaining tests would fail. if test "x$retest_macosx_linking" = "xyes"; then if test "x$macosx_sdk_specified" = "xyes"; then - error_message="no, try using a different SDK or using the default one." + error_message="try using --with-macosx-sdk with a different SDK or \ +omitting it entirely to use the default one." elif test "x$macosx_minver_specified" = "xyes"; then - error_message="no, try using a different min OS version or omitting it." + error_message="try using --with-macosx-version-min with a different OS \ +version or omitting it entirely." else - error_message="no, check that command line tools from Xcode 7.2.1 or later are installed." + error_message="check that command line tools from Xcode 7.2.1 or later are installed." fi + error_message="building C++ programs doesn't work, $error_message" + AC_LANG_PUSH(C) AC_MSG_CHECKING([if C compiler ($CC) works with SDK/version options]) - AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([$error_message])]) + AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([$error_message])]) AC_LANG_POP() AC_LANG_PUSH(C++) @@ -1371,7 +1375,7 @@ if test "x$retest_macosx_linking" = "xyes"; then #endif ], [AC_MSG_RESULT([yes])], - [AC_MSG_ERROR([$error_message])] + [AC_MSG_FAILURE([$error_message])] ) AC_LANG_POP() fi