[3.9] gh-112160: Add 'regen-configure' make target (#112164)

Add 'regen-configure' make target
This commit is contained in:
Seth Michael Larson 2023-12-06 17:26:24 -06:00 committed by GitHub
parent 08b640e157
commit 300d3155af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -93,8 +93,12 @@ jobs:
grep "aclocal 1.16.3" aclocal.m4
grep -q "runstatedir" configure
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
- name: Configure CPython
run: |
# Build Python with the libpython dynamic library
./configure --config-cache --with-pydebug --enable-shared
- name: Regenerate autoconf files
run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269
run: make regen-configure
- name: Build CPython
run: |
./configure --with-pydebug

View file

@ -1815,6 +1815,18 @@ autoconf:
# Regenerate pyconfig.h.in from configure.ac using autoheader
(cd $(srcdir); autoheader -Wall)
# See https://github.com/tiran/cpython_autoconf container
.PHONY: regen-configure
regen-configure:
@if command -v podman >/dev/null; then RUNTIME="podman"; else RUNTIME="docker"; fi; \
if ! command -v $$RUNTIME; then echo "$@ needs either Podman or Docker container runtime." >&2; exit 1; fi; \
if command -v selinuxenabled >/dev/null && selinuxenabled; then OPT=":Z"; fi; \
# Manifest corresponds with tag '269' \
CPYTHON_AUTOCONF_MANIFEST="sha256:f370fee95eefa3d57b00488bce4911635411fa83e2d293ced8cf8a3674ead939" \
CMD="$$RUNTIME run --rm --pull=missing -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf@$$CPYTHON_AUTOCONF_MANIFEST"; \
echo $$CMD; \
$$CMD || exit $?
# Create a tags file for vi
tags::
ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h