diff options
author | Christian Heimes <christian@python.org> | 2021-12-13 19:48:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 19:48:46 (GMT) |
commit | eb483c46d62707bdf705491f76cf1fa9642fb47e (patch) | |
tree | 27c95eb873672fd8433962ddad5503c3e193924a /configure.ac | |
parent | a62be77266b1beadd42d4952186332bc0847b7d6 (diff) | |
download | cpython-eb483c46d62707bdf705491f76cf1fa9642fb47e.zip cpython-eb483c46d62707bdf705491f76cf1fa9642fb47e.tar.gz cpython-eb483c46d62707bdf705491f76cf1fa9642fb47e.tar.bz2 |
bpo-45949: Pure Python freeze module for cross builds (GH-29899)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/configure.ac b/configure.ac index fa5e63c..5256a61 100644 --- a/configure.ac +++ b/configure.ac @@ -100,32 +100,6 @@ AS_VAR_IF([cross_compiling], [maybe], # pybuilddir.txt will be created by --generate-posix-vars in the Makefile rm -f pybuilddir.txt -dnl cross-compiling needs a freeze_module binary for build platform -AC_ARG_WITH( - [freeze-module], - [AS_HELP_STRING([--with-freeze-module=Programs/_freeze_module], - [path to _freeze_module binary for cross compiling])], - [ - AC_MSG_CHECKING([for --with-freeze-module]) - AS_VAR_IF([cross_compiling], [no], AC_MSG_ERROR([--with-freeze-module only applies to cross compiling])) - if test "$with_freeze_module" = yes -o "$with_freeze_module" = no; then - AC_MSG_ERROR([invalid --with-freeze-module option: expected path, not "$with_freeze_module"]) - fi - if ! $(command -v "$with_freeze_module" >/dev/null 2>&1); then - AC_MSG_ERROR([invalid or missing freeze module binary "$with_freeze_module"]) - fi - FREEZE_MODULE="$with_freeze_module" - AC_MSG_RESULT([$FREEZE_MODULE]) - ], [ - AS_VAR_IF([cross_compiling], [yes], - [AC_MSG_ERROR([Cross compiling requires --with-freeze-module])] - ) - FREEZE_MODULE=Programs/_freeze_module - ] -) -AC_SUBST([FREEZE_MODULE]) - -dnl build-python is used for cross compiling and macOS framework builds. AC_ARG_WITH( [build-python], [AS_HELP_STRING([--with-build-python=python]PYTHON_VERSION, @@ -162,6 +136,27 @@ AC_MSG_CHECKING([for Python interpreter freezing]) AC_MSG_RESULT([$PYTHON_FOR_FREEZE]) AC_SUBST([PYTHON_FOR_FREEZE]) +AS_VAR_IF([cross_compiling], [yes], + [ + dnl external build Python, freezing depends on Programs/_freeze_module.py + FREEZE_MODULE_BOOTSTRAP='$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py' + FREEZE_MODULE_BOOTSTRAP_DEPS='$(srcdir)/Programs/_freeze_module.py' + FREEZE_MODULE='$(FREEZE_MODULE_BOOTSTRAP)' + FREEZE_MODULE_DEPS='$(FREEZE_MODULE_BOOTSTRAP_DEPS)' + ], + [ + dnl internal build tools also depend on Programs/_freeze_module and _bootstrap_python. + FREEZE_MODULE_BOOTSTRAP='./Programs/_freeze_module' + FREEZE_MODULE_BOOTSTRAP_DEPS="Programs/_freeze_module" + FREEZE_MODULE='$(PYTHON_FOR_FREEZE) $(srcdir)/Programs/_freeze_module.py' + FREEZE_MODULE_DEPS="_bootstrap_python \$(srcdir)/Programs/_freeze_module.py" + ] +) +AC_SUBST([FREEZE_MODULE_BOOTSTRAP]) +AC_SUBST([FREEZE_MODULE_BOOTSTRAP_DEPS]) +AC_SUBST([FREEZE_MODULE]) +AC_SUBST([FREEZE_MODULE_DEPS]) + AC_CHECK_PROGS([PYTHON_FOR_REGEN], [python$PACKAGE_VERSION python3.10 python3.9 python3.8 python3.7 python3.6 python3 python], [python3]) |