Skip to content

Commit 434ffb7

Browse files
authored
bpo-46973: Add regen-configure make target (GH-31792)
1 parent a0eb69c commit 434ffb7

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ jobs:
7474
grep "aclocal 1.16.3" aclocal.m4
7575
grep -q "runstatedir" configure
7676
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
77-
- name: Regenerate autoconf files
78-
run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269
79-
- name: Build CPython
77+
- name: Configure CPython
8078
run: |
8179
# Build Python with the libpython dynamic library
8280
./configure --with-pydebug --enable-shared
81+
- name: Regenerate autoconf files with container image
82+
run: make regen-configure
83+
- name: Build CPython
84+
run: |
8385
make -j4 regen-all
8486
make regen-stdlib-module-names
8587
- name: Check for changes

Makefile.pre.in

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ regen-all: regen-opcode regen-opcode-targets regen-typeslots \
11961196
regen-pegen-metaparser regen-pegen regen-test-frozenmain \
11971197
regen-global-objects
11981198
@echo
1199-
@echo "Note: make regen-stdlib-module-names and make autoconf should be run manually"
1199+
@echo "Note: make regen-stdlib-module-names and make regen-configure should be run manually"
12001200

12011201
############################################################################
12021202
# Special rules for object files
@@ -2294,10 +2294,16 @@ recheck:
22942294
# Regenerate configure and pyconfig.h.in
22952295
.PHONY: autoconf
22962296
autoconf:
2297-
# Regenerate the configure script from configure.ac using autoconf
2298-
(cd $(srcdir); autoconf -Wall)
2299-
# Regenerate pyconfig.h.in from configure.ac using autoheader
2300-
(cd $(srcdir); autoheader -Wall)
2297+
(cd $(srcdir); autoreconf -ivf -Werror)
2298+
2299+
.PHONY: regen-configure
2300+
regen-configure:
2301+
@if command -v podman >/dev/null; then RUNTIME="podman"; else RUNTIME="docker"; fi; \
2302+
if ! command -v $$RUNTIME; then echo "$@ needs either Podman or Docker container runtime." >&2; exit 1; fi; \
2303+
if command -v selinuxenabled >/dev/null && selinuxenabled; then OPT=":Z"; fi; \
2304+
CMD="$$RUNTIME run --rm --pull=always -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf:269"; \
2305+
echo $$CMD; \
2306+
$$CMD || exit $?
23012307

23022308
# Create a tags file for vi
23032309
tags::
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add ``regen-configure`` make target to regenerate configure script with
2+
Christian's container image ``quay.io/tiran/cpython_autoconf:269``.

0 commit comments

Comments
 (0)