Skip to content

Commit 575c99a

Browse files
authored
[3.8] gh-112160: Add 'regen-configure' make target (#112167)
1 parent c1c6bed commit 575c99a

File tree

5 files changed

+42
-5
lines changed

5 files changed

+42
-5
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ jobs:
7676
- uses: actions/setup-python@v4
7777
- name: Install Dependencies
7878
run: sudo ./.github/workflows/posix-deps-apt.sh
79+
- name: Check Autoconf version 2.69 and aclocal 1.16.3
80+
run: |
81+
grep "Generated by GNU Autoconf 2.69" configure
82+
grep "aclocal 1.16.3" aclocal.m4
83+
grep -q "runstatedir" configure
84+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
85+
- name: Configure CPython
86+
run: |
87+
# Build Python with the libpython dynamic library
88+
./configure --config-cache --with-pydebug --enable-shared
89+
- name: Regenerate autoconf files
90+
run: |
91+
make regen-configure
7992
- name: Build CPython
8093
run: |
8194
./configure --with-pydebug

Makefile.pre.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,18 @@ autoconf:
17421742
# Regenerate pyconfig.h.in from configure.ac using autoheader
17431743
(cd $(srcdir); autoheader -Wall)
17441744

1745+
# See https://github.com/tiran/cpython_autoconf container
1746+
.PHONY: regen-configure
1747+
regen-configure:
1748+
@if command -v podman >/dev/null; then RUNTIME="podman"; else RUNTIME="docker"; fi; \
1749+
if ! command -v $$RUNTIME; then echo "$@ needs either Podman or Docker container runtime." >&2; exit 1; fi; \
1750+
if command -v selinuxenabled >/dev/null && selinuxenabled; then OPT=":Z"; fi; \
1751+
# Manifest corresponds with tag '269' \
1752+
CPYTHON_AUTOCONF_MANIFEST="sha256:f370fee95eefa3d57b00488bce4911635411fa83e2d293ced8cf8a3674ead939" \
1753+
CMD="$$RUNTIME run --rm --pull=missing -v $(abs_srcdir):/src$$OPT quay.io/tiran/cpython_autoconf@$$CPYTHON_AUTOCONF_MANIFEST"; \
1754+
echo $$CMD; \
1755+
$$CMD || exit $?
1756+
17451757
# Create a tags file for vi
17461758
tags::
17471759
ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h

aclocal.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
1+
# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
22

33
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
44

configure

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ infodir
783783
docdir
784784
oldincludedir
785785
includedir
786+
runstatedir
786787
localstatedir
787788
sharedstatedir
788789
sysconfdir
@@ -897,6 +898,7 @@ datadir='${datarootdir}'
897898
sysconfdir='${prefix}/etc'
898899
sharedstatedir='${prefix}/com'
899900
localstatedir='${prefix}/var'
901+
runstatedir='${localstatedir}/run'
900902
includedir='${prefix}/include'
901903
oldincludedir='/usr/include'
902904
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1149,6 +1151,15 @@ do
11491151
| -silent | --silent | --silen | --sile | --sil)
11501152
silent=yes ;;
11511153

1154+
-runstatedir | --runstatedir | --runstatedi | --runstated \
1155+
| --runstate | --runstat | --runsta | --runst | --runs \
1156+
| --run | --ru | --r)
1157+
ac_prev=runstatedir ;;
1158+
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1159+
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1160+
| --run=* | --ru=* | --r=*)
1161+
runstatedir=$ac_optarg ;;
1162+
11521163
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11531164
ac_prev=sbindir ;;
11541165
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1286,7 +1297,7 @@ fi
12861297
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12871298
datadir sysconfdir sharedstatedir localstatedir includedir \
12881299
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1289-
libdir localedir mandir
1300+
libdir localedir mandir runstatedir
12901301
do
12911302
eval ac_val=\$$ac_var
12921303
# Remove trailing slashes.
@@ -1439,6 +1450,7 @@ Fine tuning of the installation directories:
14391450
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14401451
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14411452
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1453+
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14421454
--libdir=DIR object code libraries [EPREFIX/lib]
14431455
--includedir=DIR C header files [PREFIX/include]
14441456
--oldincludedir=DIR C header files for non-gcc [/usr/include]

pyconfig.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@
281281
/* Define to 1 if you have the `dup3' function. */
282282
#undef HAVE_DUP3
283283

284+
/* Define if you have the '_dyld_shared_cache_contains_path' function. */
285+
#undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH
286+
284287
/* Defined when any dynamic module loading is enabled. */
285288
#undef HAVE_DYNAMIC_LOADING
286289

@@ -772,9 +775,6 @@
772775
/* Define if you have the 'prlimit' functions. */
773776
#undef HAVE_PRLIMIT
774777

775-
/* Define if you have the '_dyld_shared_cache_contains_path' function. */
776-
#undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH
777-
778778
/* Define to 1 if you have the <process.h> header file. */
779779
#undef HAVE_PROCESS_H
780780

0 commit comments

Comments
 (0)