Improve error messages if configure build test fails under macOS

Telling people to try using a different SDK was rather confusing if they
didn't specify any SDK in the first place and not very helpful if the
problem was due to specifying an incompatible minimum OS version, so fix
both problems at once by using the appropriate error message depending
on the configure options actually used.
This commit is contained in:
Vadim Zeitlin
2020-07-05 18:16:00 +02:00
parent 01ac922431
commit bbf1953051
2 changed files with 29 additions and 23 deletions

36
configure vendored
View File

@@ -1028,7 +1028,6 @@ infodir
docdir docdir
oldincludedir oldincludedir
includedir includedir
runstatedir
localstatedir localstatedir
sharedstatedir sharedstatedir
sysconfdir sysconfdir
@@ -1455,7 +1454,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc' sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com' sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var' localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include' includedir='${prefix}/include'
oldincludedir='/usr/include' oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1708,15 +1706,6 @@ do
| -silent | --silent | --silen | --sile | --sil) | -silent | --silent | --silen | --sile | --sil)
silent=yes ;; silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;; ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1854,7 +1843,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \ datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir libdir localedir mandir
do do
eval ac_val=\$$ac_var eval ac_val=\$$ac_var
# Remove trailing slashes. # Remove trailing slashes.
@@ -2007,7 +1996,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var] --localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib] --libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include] --includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include] --oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -18650,6 +18638,8 @@ if test "x$wxUSE_MACOSX_SDK" = "xno"; then
wxUSE_MACOSX_SDK= wxUSE_MACOSX_SDK=
elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then
wxUSE_MACOSX_SDK="`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" wxUSE_MACOSX_SDK="`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
elif test "x$wxUSE_MACOSX_SDK" != "x"; then
macosx_sdk_specified=yes
fi fi
@@ -18700,6 +18690,8 @@ $as_echo "$as_me: WARNING: Could not determine deployment target from SDKSetting
fi fi
elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then
wxUSE_MACOSX_VERSION_MIN=10.10 wxUSE_MACOSX_VERSION_MIN=10.10
else
macosx_minver_specified=yes
fi fi
if test "x$MACOSX_SDK_OPTS" != "x"; then if test "x$MACOSX_SDK_OPTS" != "x"; then
@@ -18728,6 +18720,14 @@ if test "$HAVE_CXX11" = "1" ; then
fi 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
error_message="no, try using a different SDK or using the default one."
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."
fi
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,10 +18751,7 @@ 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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 as_fn_error $? "$error_message" "$LINENO" 5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no. Try a different SDK
See \`config.log' for more details" "$LINENO" 5; }; exit 1
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
@@ -18788,10 +18785,7 @@ 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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 as_fn_error $? "$error_message" "$LINENO" 5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no. Try a different SDK
See \`config.log' for more details" "$LINENO" 5; }; exit 1
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

View File

@@ -1253,6 +1253,8 @@ if test "x$wxUSE_MACOSX_SDK" = "xno"; then
elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then
dnl Try to use the default SDK. dnl Try to use the default SDK.
wxUSE_MACOSX_SDK="`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" wxUSE_MACOSX_SDK="`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
elif test "x$wxUSE_MACOSX_SDK" != "x"; then
macosx_sdk_specified=yes
fi fi
@@ -1305,6 +1307,8 @@ dnl We need to quote the next line where we don't need macros and do need [] in
fi fi
elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then
wxUSE_MACOSX_VERSION_MIN=10.10 wxUSE_MACOSX_VERSION_MIN=10.10
else
macosx_minver_specified=yes
fi fi
if test "x$MACOSX_SDK_OPTS" != "x"; then if test "x$MACOSX_SDK_OPTS" != "x"; then
@@ -1341,14 +1345,22 @@ dnl If either an SDK or a version option was added, make sure that we can
dnl still compile and link both C and C++. If we didn't do this, then most 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
error_message="no, try using a different SDK or using the default one."
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."
fi
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_FAILURE([no. Try a different SDK]); exit 1]) AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([$error_message])])
AC_LANG_POP() AC_LANG_POP()
AC_LANG_PUSH(C++) AC_LANG_PUSH(C++)
AC_MSG_CHECKING([if C++ compiler ($CXX) works with SDK/version options]) AC_MSG_CHECKING([if C++ compiler ($CXX) works with SDK/version options])
AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1]) AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([$error_message])])
AC_LANG_POP() AC_LANG_POP()
fi fi