Skip to content

Commit 748d38b

Browse files
[3.9] bpo-38443: Check that the specified universal architectures work (pythonGH-22910) (pythonGH-23451)
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 <ronaldoussoren@mac.com>
1 parent 89d74d0 commit 748d38b

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
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

+25
Original file line numberDiff line numberDiff line change
@@ -7571,6 +7571,31 @@ $as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; }
75717571
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5
75727572
$as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; }
75737573

7574+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5
7575+
$as_echo_n "checking if specified universal architectures work... " >&6; }
7576+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7577+
/* end confdefs.h. */
7578+
#include <stdio.h>
7579+
int
7580+
main ()
7581+
{
7582+
printf("%d", 42);
7583+
;
7584+
return 0;
7585+
}
7586+
_ACEOF
7587+
if ac_fn_c_try_link "$LINENO"; then :
7588+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7589+
$as_echo "yes" >&6; }
7590+
else
7591+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7592+
$as_echo "no" >&6; }
7593+
as_fn_error $? "check config.log and use the '--with-universal-archs' option" "$LINENO" 5
7594+
7595+
fi
7596+
rm -f core conftest.err conftest.$ac_objext \
7597+
conftest$ac_exeext conftest.$ac_ext
7598+
75747599
# end of Darwin* tests
75757600
;;
75767601
esac

configure.ac

+7
Original file line numberDiff line numberDiff line change
@@ -1976,6 +1976,13 @@ yes)
19761976
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
19771977
AC_MSG_RESULT($MACOSX_DEPLOYMENT_TARGET)
19781978

1979+
AC_MSG_CHECKING(if specified universal architectures work)
1980+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("%d", 42);]])],
1981+
[AC_MSG_RESULT(yes)],
1982+
[AC_MSG_RESULT(no)
1983+
AC_MSG_ERROR(check config.log and use the '--with-universal-archs' option)
1984+
])
1985+
19791986
# end of Darwin* tests
19801987
;;
19811988
esac

0 commit comments

Comments
 (0)