diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-04-23 01:18:54 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-04-23 01:18:54 (GMT) |
commit | da28494d0a208410f5f7c1df476da9268908c565 (patch) | |
tree | f1df79e2eb2b3f70dd2cd4fc59a09f8a2d6cf364 | |
parent | 15932593bae491ffad73f690c8a2bcf6f91a085b (diff) | |
parent | 1046d5c65354c5b35486ac0cb7d3b02507004b04 (diff) | |
download | cpython-da28494d0a208410f5f7c1df476da9268908c565.zip cpython-da28494d0a208410f5f7c1df476da9268908c565.tar.gz cpython-da28494d0a208410f5f7c1df476da9268908c565.tar.bz2 |
Issue #22359: Merge cross-compilation fix from 3.5
-rw-r--r-- | Makefile.pre.in | 27 | ||||
-rw-r--r-- | Misc/NEWS | 5 | ||||
-rwxr-xr-x | configure | 1 | ||||
-rw-r--r-- | configure.ac | 1 |
4 files changed, 27 insertions, 7 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in index 63805fc..57a6357 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -221,6 +221,7 @@ LIBOBJS= @LIBOBJS@ PYTHON= python$(EXE) BUILDPYTHON= python$(BUILDEXE) +cross_compiling=@cross_compiling@ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ BUILD_GNU_TYPE= @build@ @@ -718,12 +719,16 @@ Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FRO $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib - ./Programs/_freeze_importlib \ - $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h + if test "$(cross_compiling)" != "yes"; then \ + ./Programs/_freeze_importlib \ + $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h; \ + fi Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib - ./Programs/_freeze_importlib \ - $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h + if test "$(cross_compiling)" != "yes"; then \ + ./Programs/_freeze_importlib \ + $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h; \ + fi ############################################################################ @@ -784,10 +789,18 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(IO_OBJS): $(IO_H) $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN) - @$(MKDIR_P) Include - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + @$(MKDIR_P) Include + if test "$(cross_compiling)" != "yes"; then \ + $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \ + else \ + cp $(srcdir)/Include/graminit.h $(GRAMMAR_H); \ + fi $(GRAMMAR_C): $(GRAMMAR_H) - touch $(GRAMMAR_C) + if test "$(cross_compiling)" != "yes"; then \ + touch $(GRAMMAR_C); \ + else \ + cp $(srcdir)/Python/graminit.c $(GRAMMAR_C); \ + fi $(PGEN): $(PGENOBJS) $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) @@ -1005,6 +1005,11 @@ Tests Build ----- +- Issue #22359: Disable the rules for running _freeze_importlib and pgen when + cross-compiling. The output of these programs is normally saved with the + source code anyway, and is still regenerated when doing a native build. + Patch by Xavier de Gaye. + - Issue #21668: Link audioop, _datetime, _ctypes_test modules to libm, except on Mac OS X. Patch written by Chi Hsuan Yen. @@ -751,6 +751,7 @@ build_os build_vendor build_cpu build +cross_compiling HAS_HG HGBRANCH HGTAG diff --git a/configure.ac b/configure.ac index 326afbc..7a6b5be 100644 --- a/configure.ac +++ b/configure.ac @@ -49,6 +49,7 @@ fi AC_CONFIG_SRCDIR([Include/object.h]) AC_CONFIG_HEADER(pyconfig.h) +AC_SUBST(cross_compiling) AC_CANONICAL_HOST AC_SUBST(build) AC_SUBST(host) |