[3.10] bpo-45405: Prevent ``internal configure error`` when running ``configure`` with recent versions of non-Apple clang. (GH-28845) (GH-28911)
Change the configure logic to function properly on macOS when the compiler
outputs a platform triplet for option --print-multiarch.
Co-authored-by: Ned Deily <nad@python.org>
(cherry picked from commit 9c4766772cda67648184f8ddba546a5fc0167f91)
Co-authored-by: David Bohman <debohman@gmail.com>
Automerge-Triggered-By: GH:ned-deily
diff --git a/configure.ac b/configure.ac
index 41a3679..c4abac6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -717,9 +717,6 @@
fi
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
-AC_SUBST(MULTIARCH)
-
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
cat >> conftest.c <<EOF
#undef bfin
@@ -875,6 +872,11 @@
fi
rm -f conftest.c conftest.out
+if test x$PLATFORM_TRIPLET != xdarwin; then
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+fi
+AC_SUBST(MULTIARCH)
+
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])