Skip to content

Commit 0f20bd9

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.
1 parent 68f68fa commit 0f20bd9

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
@@ -7611,6 +7611,31 @@ $as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; }
76117611
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5
76127612
$as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; }
76137613

7614+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5
7615+
$as_echo_n "checking if specified universal architectures work... " >&6; }
7616+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7617+
/* end confdefs.h. */
7618+
#include <stdio.h>
7619+
int
7620+
main ()
7621+
{
7622+
printf("%d", 42);
7623+
;
7624+
return 0;
7625+
}
7626+
_ACEOF
7627+
if ac_fn_c_try_link "$LINENO"; then :
7628+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7629+
$as_echo "yes" >&6; }
7630+
else
7631+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7632+
$as_echo "no" >&6; }
7633+
as_fn_error $? "check config.log and use the '--with-universal-archs' option" "$LINENO" 5
7634+
7635+
fi
7636+
rm -f core conftest.err conftest.$ac_objext \
7637+
conftest$ac_exeext conftest.$ac_ext
7638+
76147639
# end of Darwin* tests
76157640
;;
76167641
esac

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,6 +1978,13 @@ yes)
19781978
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
19791979
AC_MSG_RESULT($MACOSX_DEPLOYMENT_TARGET)
19801980

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

0 commit comments

Comments
 (0)