Skip to content

Commit 6e66542

Browse files
bpo-38443: Check that the specified universal architectures work (GH-22910)
As [bpo-38443]() says the error message from configure when specifying --enable-universalsdk with a set of architectures that is not supported by the compiler is not very helpful. This PR explicitly checks if the compiler works and bails out if it doesn't. (cherry picked from commit 0f20bd9) Co-authored-by: Ronald Oussoren <[email protected]>
1 parent 7e9bf4e commit 6e66542

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The ``--enable-universalsdk`` and ``--with-universal-archs`` options for the
2+
configure script now check that the specified architectures can be used.

configure

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7493,6 +7493,31 @@ $as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; }
74937493
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5
74947494
$as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; }
74957495

7496+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5
7497+
$as_echo_n "checking if specified universal architectures work... " >&6; }
7498+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7499+
/* end confdefs.h. */
7500+
#include <stdio.h>
7501+
int
7502+
main ()
7503+
{
7504+
printf("%d", 42);
7505+
;
7506+
return 0;
7507+
}
7508+
_ACEOF
7509+
if ac_fn_c_try_link "$LINENO"; then :
7510+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7511+
$as_echo "yes" >&6; }
7512+
else
7513+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7514+
$as_echo "no" >&6; }
7515+
as_fn_error $? "check config.log and use the '--with-universal-archs' option" "$LINENO" 5
7516+
7517+
fi
7518+
rm -f core conftest.err conftest.$ac_objext \
7519+
conftest$ac_exeext conftest.$ac_ext
7520+
74967521
# end of Darwin* tests
74977522
;;
74987523
esac

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,6 +1931,13 @@ yes)
19311931
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
19321932
AC_MSG_RESULT($MACOSX_DEPLOYMENT_TARGET)
19331933

1934+
AC_MSG_CHECKING(if specified universal architectures work)
1935+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("%d", 42);]])],
1936+
[AC_MSG_RESULT(yes)],
1937+
[AC_MSG_RESULT(no)
1938+
AC_MSG_ERROR(check config.log and use the '--with-universal-archs' option)
1939+
])
1940+
19341941
# end of Darwin* tests
19351942
;;
19361943
esac

0 commit comments

Comments
 (0)