@@ -290,8 +290,11 @@ HOSTRUNNER= @HOSTRUNNER@
290290PYTHON_FOR_REGEN?=@PYTHON_FOR_REGEN@
291291UPDATE_FILE=$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/update_file.py
292292PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
293+ # Single-platform builds depend on $(BUILDPYTHON). Cross builds use an
294+ # external "build Python" and have an empty PYTHON_FOR_BUILD_DEPS.
295+ PYTHON_FOR_BUILD_DEPS=@PYTHON_FOR_BUILD_DEPS@
293296
294- # Normal builds use Programs/_freeze_module.c for bootstrapping and
297+ # Single-platform builds use Programs/_freeze_module.c for bootstrapping and
295298# ./_bootstrap_python Programs/_freeze_module.py for remaining modules
296299# Cross builds use an external "build Python" for all modules.
297300PYTHON_FOR_FREEZE=@PYTHON_FOR_FREEZE@
@@ -700,7 +703,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
700703$(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS)
701704 $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
702705
703- platform: $(BUILDPYTHON ) pybuilddir.txt
706+ platform: $(PYTHON_FOR_BUILD_DEPS ) pybuilddir.txt
704707 $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
705708
706709# Create build directory and generate the sysconfig build-time data there.
@@ -710,7 +713,7 @@ platform: $(BUILDPYTHON) pybuilddir.txt
710713# problems by creating a dummy pybuilddir.txt just to allow interpreter
711714# initialization to succeed. It will be overwritten by generate-posix-vars
712715# or removed in case of failure.
713- pybuilddir.txt: $(BUILDPYTHON )
716+ pybuilddir.txt: $(PYTHON_FOR_BUILD_DEPS )
714717 @echo "none" > ./pybuilddir.txt
715718 $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
716719 if test $$? -ne 0 ; then \
@@ -729,7 +732,7 @@ $(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl
729732# -s, --silent or --quiet is always the first char.
730733# Under BSD make, MAKEFLAGS might be " -s -v x=y".
731734# Ignore macros passed by GNU make, passed after --
732- sharedmods: $(BUILDPYTHON ) pybuilddir.txt @LIBMPDEC_INTERNAL@ @LIBEXPAT_INTERNAL@
735+ sharedmods: $(PYTHON_FOR_BUILD_DEPS ) pybuilddir.txt @LIBMPDEC_INTERNAL@ @LIBEXPAT_INTERNAL@
733736 @case "`echo X $$MAKEFLAGS | sed 's/^X //;s/ -- .*//'`" in \
734737 *\ -s*|s*) quiet="-q";; \
735738 *) quiet="";; \
0 commit comments