Skip to content

bpo-46973: Add regen-configure make target (GH-31792) #31792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ jobs:
grep "aclocal 1.16.3" aclocal.m4
grep -q "runstatedir" configure
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
- name: Regenerate autoconf files
run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269
- name: Build CPython
- name: Configure CPython
run: |
# Build Python with the libpython dynamic library
./configure --with-pydebug --enable-shared
- name: Regenerate autoconf files with container image
run: make regen-configure
- name: Build CPython
run: |
make -j4 regen-all
make regen-stdlib-module-names
- name: Check for changes
Expand Down
16 changes: 11 additions & 5 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ regen-all: regen-opcode regen-opcode-targets regen-typeslots \
regen-pegen-metaparser regen-pegen regen-test-frozenmain \
regen-global-objects
@echo
@echo "Note: make regen-stdlib-module-names and make autoconf should be run manually"
@echo "Note: make regen-stdlib-module-names and make regen-configure should be run manually"

############################################################################
# Special rules for object files
Expand Down Expand Up @@ -2294,10 +2294,16 @@ recheck:
# Regenerate configure and pyconfig.h.in
.PHONY: autoconf
autoconf:
# Regenerate the configure script from configure.ac using autoconf
(cd $(srcdir); autoconf -Wall)
# Regenerate pyconfig.h.in from configure.ac using autoheader
(cd $(srcdir); autoheader -Wall)
(cd $(srcdir); autoreconf -ivf -Werror)

.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; \
CMD="$$RUNTIME run --rm --pull=always -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf:269"; \
echo $$CMD; \
$$CMD || exit $?

# Create a tags file for vi
tags::
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add ``regen-configure`` make target to regenerate configure script with
Christian's container image ``quay.io/tiran/cpython_autoconf:269``.