]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38443: Check that the specified universal architectures work (GH-22910)
authorRonald Oussoren <ronaldoussoren@mac.com>
Sun, 22 Nov 2020 01:13:11 +0000 (02:13 +0100)
committerGitHub <noreply@github.com>
Sun, 22 Nov 2020 01:13:11 +0000 (17:13 -0800)
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.

Misc/NEWS.d/next/macOS/2020-10-23-10-26-53.bpo-38443.vu64tl.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/macOS/2020-10-23-10-26-53.bpo-38443.vu64tl.rst b/Misc/NEWS.d/next/macOS/2020-10-23-10-26-53.bpo-38443.vu64tl.rst
new file mode 100644 (file)
index 0000000..008c972
--- /dev/null
@@ -0,0 +1,2 @@
+The ``--enable-universalsdk`` and ``--with-universal-archs`` options for the
+configure script now check that the specified architectures can be used.
index e665d135e67b27247ba3b68c608aeec350b2f884..9ee750b70f4a19312d8d6c14a4b11e7ee4db1a1a 100755 (executable)
--- a/configure
+++ b/configure
@@ -7611,6 +7611,31 @@ $as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; }
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5
 $as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; }
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5
+$as_echo_n "checking if specified universal architectures work... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+printf("%d", 42);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+             as_fn_error $? "check config.log and use the '--with-universal-archs' option" "$LINENO" 5
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
         # end of Darwin* tests
         ;;
     esac
index 668715cdf8f15adb6cb08c84a14a973230a64974..7f7dfa588a814444ff0e6911db2ee6591455479f 100644 (file)
@@ -1978,6 +1978,13 @@ yes)
         EXPORT_MACOSX_DEPLOYMENT_TARGET=''
         AC_MSG_RESULT($MACOSX_DEPLOYMENT_TARGET)
 
+        AC_MSG_CHECKING(if specified universal architectures work)
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("%d", 42);]])],
+            [AC_MSG_RESULT(yes)],
+            [AC_MSG_RESULT(no)
+             AC_MSG_ERROR(check config.log and use the '--with-universal-archs' option)
+        ])
+
         # end of Darwin* tests
         ;;
     esac