From d6d5f0d856fd6638cadb0bc42929d2539e5c95ac Mon Sep 17 00:00:00 2001 From: Vasiliy Kiryanov Date: Mon, 23 Nov 2026 19:03:31 -0500 Subject: [PATCH] gh-57449: Define USE_COMPUTED_GOTOS in configure by default When the compiler supports computed gotos and no --with(out)-computed-gotos option is given, define USE_COMPUTED_GOTOS to 1 in pyconfig.h so that sysconfig matches what ceval_macros.h already does. --- .../Build/2026-11-23-19-03-12.gh-issue-57449.bi88kA.rst | 3 +++ configure | 6 ++++++ configure.ac | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2026-11-23-19-03-12.gh-issue-57449.bi88kA.rst diff --git a/Misc/NEWS.d/next/Build/2026-11-23-19-03-12.gh-issue-57449.bi88kA.rst b/Misc/NEWS.d/next/Build/2026-11-23-19-03-12.gh-issue-57449.bi88kA.rst new file mode 100644 index 00000000000000..2f4f477fb3ca55 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-11-23-19-03-12.gh-issue-57449.bi88kA.rst @@ -0,0 +1,3 @@ +:program:`configure` now defines ``USE_COMPUTED_GOTOS`` to ``1`` by default +when the compiler supports computed gotos, so :mod:`sysconfig` no longer +reports it as ``0``. diff --git a/configure b/configure index b33ea2fb0c9bce..aac517c0cb0910 100755 --- a/configure +++ b/configure @@ -34889,6 +34889,12 @@ case "$ac_cv_computed_gotos" in yes*) printf "%s\n" "#define HAVE_COMPUTED_GOTOS 1" >>confdefs.h + + if test "${with_computed_gotos+set}" != set; then + +printf "%s\n" "#define USE_COMPUTED_GOTOS 1" >>confdefs.h + + fi esac # Check for --with-tail-call-interp diff --git a/configure.ac b/configure.ac index b0368ae4b94e95..193516b35d3bda 100644 --- a/configure.ac +++ b/configure.ac @@ -7901,6 +7901,11 @@ LABEL2: case "$ac_cv_computed_gotos" in yes*) AC_DEFINE([HAVE_COMPUTED_GOTOS], [1], [Define if the C compiler supports computed gotos.]) + + if test "${with_computed_gotos+set}" != set; then + AC_DEFINE([USE_COMPUTED_GOTOS], [1], + [Define if you want to use computed gotos in ceval.c.]) + fi esac # Check for --with-tail-call-interp