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.
This commit is contained in:
Vadim Zeitlin
2020-07-05 19:29:26 +02:00
parent 9b02dbf8b2
commit a4f9e207dc
2 changed files with 24 additions and 10 deletions

20
configure vendored
View File

@@ -18721,13 +18721,17 @@ fi
if test "x$retest_macosx_linking" = "xyes"; then if test "x$retest_macosx_linking" = "xyes"; then
if test "x$macosx_sdk_specified" = "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 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 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 fi
error_message="building C++ programs doesn't work, $error_message"
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 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 "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; } $as_echo "yes" >&6; }
else 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 fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext 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 "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; } $as_echo "yes" >&6; }
else 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 fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \

View File

@@ -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. dnl of the remaining tests would fail.
if test "x$retest_macosx_linking" = "xyes"; then if test "x$retest_macosx_linking" = "xyes"; then
if test "x$macosx_sdk_specified" = "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 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 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 fi
error_message="building C++ programs doesn't work, $error_message"
AC_LANG_PUSH(C) AC_LANG_PUSH(C)
AC_MSG_CHECKING([if C compiler ($CC) works with SDK/version options]) 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_POP()
AC_LANG_PUSH(C++) AC_LANG_PUSH(C++)
@@ -1371,7 +1375,7 @@ if test "x$retest_macosx_linking" = "xyes"; then
#endif #endif
], ],
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([$error_message])] [AC_MSG_FAILURE([$error_message])]
) )
AC_LANG_POP() AC_LANG_POP()
fi fi