summaryrefslogtreecommitdiffstats
path: root/Makefile.pre.in
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-04-23 00:58:44 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-04-23 00:58:44 (GMT)
commit1046d5c65354c5b35486ac0cb7d3b02507004b04 (patch)
tree335821854ea9159a77d077fa678f9e4f84265067 /Makefile.pre.in
parent19620c57d78f2175e326205f6b919ded834099b2 (diff)
downloadcpython-1046d5c65354c5b35486ac0cb7d3b02507004b04.zip
cpython-1046d5c65354c5b35486ac0cb7d3b02507004b04.tar.gz
cpython-1046d5c65354c5b35486ac0cb7d3b02507004b04.tar.bz2
Issue #22359: Disable running cross-compiled _freeze_importlib and pgen
Patch by Xavier de Gaye.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r--Makefile.pre.in27
1 files changed, 20 insertions, 7 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 17c0b57..e5182a6 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)