bpo-45886: Allow overriding freeze command for cross compiling (GH-29735)

This commit is contained in:
Christian Heimes 2021-11-24 09:07:15 +02:00 committed by GitHub
parent f9de97aae5
commit dd8ce9ea8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 43 deletions

View File

@ -1008,6 +1008,9 @@ Python/deepfreeze/frozen_only.c: Python/frozen_modules/frozen_only.h $(DEEPFREEZ
############################################################################ ############################################################################
# frozen modules (including importlib) # frozen modules (including importlib)
# Allow developers to override freeze_module command for cross building (bpo-45886)
FREEZE_MODULE?=Programs/_freeze_module
# FROZEN_FILES_* are auto-generated by Tools/scripts/freeze_modules.py. # FROZEN_FILES_* are auto-generated by Tools/scripts/freeze_modules.py.
FROZEN_FILES_IN = \ FROZEN_FILES_IN = \
Lib/importlib/_bootstrap.py \ Lib/importlib/_bootstrap.py \
@ -1061,69 +1064,69 @@ Programs/_freeze_module: Programs/_freeze_module.o $(LIBRARY_OBJS_OMIT_FROZEN)
# BEGIN: freezing modules # BEGIN: freezing modules
Python/frozen_modules/importlib._bootstrap.h: Programs/_freeze_module Lib/importlib/_bootstrap.py Python/frozen_modules/importlib._bootstrap.h: $(FREEZE_MODULE) Lib/importlib/_bootstrap.py
Programs/_freeze_module importlib._bootstrap $(srcdir)/Lib/importlib/_bootstrap.py Python/frozen_modules/importlib._bootstrap.h $(FREEZE_MODULE) importlib._bootstrap $(srcdir)/Lib/importlib/_bootstrap.py Python/frozen_modules/importlib._bootstrap.h
Python/frozen_modules/importlib._bootstrap_external.h: Programs/_freeze_module Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h: $(FREEZE_MODULE) Lib/importlib/_bootstrap_external.py
Programs/_freeze_module importlib._bootstrap_external $(srcdir)/Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h $(FREEZE_MODULE) importlib._bootstrap_external $(srcdir)/Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h
Python/frozen_modules/zipimport.h: Programs/_freeze_module Lib/zipimport.py Python/frozen_modules/zipimport.h: $(FREEZE_MODULE) Lib/zipimport.py
Programs/_freeze_module zipimport $(srcdir)/Lib/zipimport.py Python/frozen_modules/zipimport.h $(FREEZE_MODULE) zipimport $(srcdir)/Lib/zipimport.py Python/frozen_modules/zipimport.h
Python/frozen_modules/abc.h: Programs/_freeze_module Lib/abc.py Python/frozen_modules/abc.h: $(FREEZE_MODULE) Lib/abc.py
Programs/_freeze_module abc $(srcdir)/Lib/abc.py Python/frozen_modules/abc.h $(FREEZE_MODULE) abc $(srcdir)/Lib/abc.py Python/frozen_modules/abc.h
Python/frozen_modules/codecs.h: Programs/_freeze_module Lib/codecs.py Python/frozen_modules/codecs.h: $(FREEZE_MODULE) Lib/codecs.py
Programs/_freeze_module codecs $(srcdir)/Lib/codecs.py Python/frozen_modules/codecs.h $(FREEZE_MODULE) codecs $(srcdir)/Lib/codecs.py Python/frozen_modules/codecs.h
Python/frozen_modules/io.h: Programs/_freeze_module Lib/io.py Python/frozen_modules/io.h: $(FREEZE_MODULE) Lib/io.py
Programs/_freeze_module io $(srcdir)/Lib/io.py Python/frozen_modules/io.h $(FREEZE_MODULE) io $(srcdir)/Lib/io.py Python/frozen_modules/io.h
Python/frozen_modules/_collections_abc.h: Programs/_freeze_module Lib/_collections_abc.py Python/frozen_modules/_collections_abc.h: $(FREEZE_MODULE) Lib/_collections_abc.py
Programs/_freeze_module _collections_abc $(srcdir)/Lib/_collections_abc.py Python/frozen_modules/_collections_abc.h $(FREEZE_MODULE) _collections_abc $(srcdir)/Lib/_collections_abc.py Python/frozen_modules/_collections_abc.h
Python/frozen_modules/_sitebuiltins.h: Programs/_freeze_module Lib/_sitebuiltins.py Python/frozen_modules/_sitebuiltins.h: $(FREEZE_MODULE) Lib/_sitebuiltins.py
Programs/_freeze_module _sitebuiltins $(srcdir)/Lib/_sitebuiltins.py Python/frozen_modules/_sitebuiltins.h $(FREEZE_MODULE) _sitebuiltins $(srcdir)/Lib/_sitebuiltins.py Python/frozen_modules/_sitebuiltins.h
Python/frozen_modules/genericpath.h: Programs/_freeze_module Lib/genericpath.py Python/frozen_modules/genericpath.h: $(FREEZE_MODULE) Lib/genericpath.py
Programs/_freeze_module genericpath $(srcdir)/Lib/genericpath.py Python/frozen_modules/genericpath.h $(FREEZE_MODULE) genericpath $(srcdir)/Lib/genericpath.py Python/frozen_modules/genericpath.h
Python/frozen_modules/ntpath.h: Programs/_freeze_module Lib/ntpath.py Python/frozen_modules/ntpath.h: $(FREEZE_MODULE) Lib/ntpath.py
Programs/_freeze_module ntpath $(srcdir)/Lib/ntpath.py Python/frozen_modules/ntpath.h $(FREEZE_MODULE) ntpath $(srcdir)/Lib/ntpath.py Python/frozen_modules/ntpath.h
Python/frozen_modules/posixpath.h: Programs/_freeze_module Lib/posixpath.py Python/frozen_modules/posixpath.h: $(FREEZE_MODULE) Lib/posixpath.py
Programs/_freeze_module posixpath $(srcdir)/Lib/posixpath.py Python/frozen_modules/posixpath.h $(FREEZE_MODULE) posixpath $(srcdir)/Lib/posixpath.py Python/frozen_modules/posixpath.h
Python/frozen_modules/os.h: Programs/_freeze_module Lib/os.py Python/frozen_modules/os.h: $(FREEZE_MODULE) Lib/os.py
Programs/_freeze_module os $(srcdir)/Lib/os.py Python/frozen_modules/os.h $(FREEZE_MODULE) os $(srcdir)/Lib/os.py Python/frozen_modules/os.h
Python/frozen_modules/site.h: Programs/_freeze_module Lib/site.py Python/frozen_modules/site.h: $(FREEZE_MODULE) Lib/site.py
Programs/_freeze_module site $(srcdir)/Lib/site.py Python/frozen_modules/site.h $(FREEZE_MODULE) site $(srcdir)/Lib/site.py Python/frozen_modules/site.h
Python/frozen_modules/stat.h: Programs/_freeze_module Lib/stat.py Python/frozen_modules/stat.h: $(FREEZE_MODULE) Lib/stat.py
Programs/_freeze_module stat $(srcdir)/Lib/stat.py Python/frozen_modules/stat.h $(FREEZE_MODULE) stat $(srcdir)/Lib/stat.py Python/frozen_modules/stat.h
Python/frozen_modules/__hello__.h: Programs/_freeze_module Lib/__hello__.py Python/frozen_modules/__hello__.h: $(FREEZE_MODULE) Lib/__hello__.py
Programs/_freeze_module __hello__ $(srcdir)/Lib/__hello__.py Python/frozen_modules/__hello__.h $(FREEZE_MODULE) __hello__ $(srcdir)/Lib/__hello__.py Python/frozen_modules/__hello__.h
Python/frozen_modules/__phello__.h: Programs/_freeze_module Lib/__phello__/__init__.py Python/frozen_modules/__phello__.h: $(FREEZE_MODULE) Lib/__phello__/__init__.py
Programs/_freeze_module __phello__ $(srcdir)/Lib/__phello__/__init__.py Python/frozen_modules/__phello__.h $(FREEZE_MODULE) __phello__ $(srcdir)/Lib/__phello__/__init__.py Python/frozen_modules/__phello__.h
Python/frozen_modules/__phello__.ham.h: Programs/_freeze_module Lib/__phello__/ham/__init__.py Python/frozen_modules/__phello__.ham.h: $(FREEZE_MODULE) Lib/__phello__/ham/__init__.py
Programs/_freeze_module __phello__.ham $(srcdir)/Lib/__phello__/ham/__init__.py Python/frozen_modules/__phello__.ham.h $(FREEZE_MODULE) __phello__.ham $(srcdir)/Lib/__phello__/ham/__init__.py Python/frozen_modules/__phello__.ham.h
Python/frozen_modules/__phello__.ham.eggs.h: Programs/_freeze_module Lib/__phello__/ham/eggs.py Python/frozen_modules/__phello__.ham.eggs.h: $(FREEZE_MODULE) Lib/__phello__/ham/eggs.py
Programs/_freeze_module __phello__.ham.eggs $(srcdir)/Lib/__phello__/ham/eggs.py Python/frozen_modules/__phello__.ham.eggs.h $(FREEZE_MODULE) __phello__.ham.eggs $(srcdir)/Lib/__phello__/ham/eggs.py Python/frozen_modules/__phello__.ham.eggs.h
Python/frozen_modules/__phello__.spam.h: Programs/_freeze_module Lib/__phello__/spam.py Python/frozen_modules/__phello__.spam.h: $(FREEZE_MODULE) Lib/__phello__/spam.py
Programs/_freeze_module __phello__.spam $(srcdir)/Lib/__phello__/spam.py Python/frozen_modules/__phello__.spam.h $(FREEZE_MODULE) __phello__.spam $(srcdir)/Lib/__phello__/spam.py Python/frozen_modules/__phello__.spam.h
Python/frozen_modules/frozen_only.h: Programs/_freeze_module Tools/freeze/flag.py Python/frozen_modules/frozen_only.h: $(FREEZE_MODULE) Tools/freeze/flag.py
Programs/_freeze_module frozen_only $(srcdir)/Tools/freeze/flag.py Python/frozen_modules/frozen_only.h $(FREEZE_MODULE) frozen_only $(srcdir)/Tools/freeze/flag.py Python/frozen_modules/frozen_only.h
# END: freezing modules # END: freezing modules
Tools/scripts/freeze_modules.py: Programs/_freeze_module Tools/scripts/freeze_modules.py: $(FREEZE_MODULE)
.PHONY: regen-frozen .PHONY: regen-frozen
regen-frozen: Tools/scripts/freeze_modules.py $(FROZEN_FILES_IN) regen-frozen: Tools/scripts/freeze_modules.py $(FROZEN_FILES_IN)

View File

@ -0,0 +1,2 @@
The ``_freeze_module`` program path can now be overridden on the command
line, e.g. ``make FREEZE_MODULE=../x86_64/Program/_freeze_module``.

View File

@ -598,10 +598,10 @@ def regen_makefile(modules):
pyfile = relpath_for_posix_display(src.pyfile, ROOT_DIR) pyfile = relpath_for_posix_display(src.pyfile, ROOT_DIR)
pyfiles.append(f'\t\t{pyfile} \\') pyfiles.append(f'\t\t{pyfile} \\')
freeze = (f'Programs/_freeze_module {src.frozenid} ' freeze = (f'$(FREEZE_MODULE) {src.frozenid} '
f'$(srcdir)/{pyfile} {header}') f'$(srcdir)/{pyfile} {header}')
rules.extend([ rules.extend([
f'{header}: Programs/_freeze_module {pyfile}', f'{header}: $(FREEZE_MODULE) {pyfile}',
f'\t{freeze}', f'\t{freeze}',
'', '',
]) ])