blob: 28fe70adb384ced23c5a00e2483ad13db3a638d8 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001We cross compile python. This patch uses tools from host/native
2python instead of in-tree tools
3
4-Khem
5
6Upstream-Status: Inappropriate[Configuration Specific]
7
8---
9 Makefile.pre.in | 25 +++++++++++++------------
10 1 file changed, 13 insertions(+), 12 deletions(-)
11
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050012Index: Python-3.5.1/Makefile.pre.in
13===================================================================
14--- Python-3.5.1.orig/Makefile.pre.in
15+++ Python-3.5.1/Makefile.pre.in
16@@ -220,6 +220,7 @@ LIBOBJS= @LIBOBJS@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
18 PYTHON= python$(EXE)
19 BUILDPYTHON= python$(BUILDEXE)
20+HOSTPYTHON= $(BUILDPYTHON)
21
22 PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
23 _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050024@@ -276,6 +277,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025 ##########################################################################
26 # Parser
27 PGEN= Parser/pgen$(EXE)
28+HOSTPGEN= $(PGEN)$(EXE)
29
30 PSRCS= \
31 Parser/acceler.c \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032@@ -506,7 +508,7 @@ build_all_generate_profile:
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033
34 run_profile_task:
35 : # FIXME: can't run for a cross build
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050036- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
37+ $(LLVM_PROF_FILE) $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) || true
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050039 build_all_merge_profile:
40 $(LLVM_PROF_MERGER)
41@@ -779,7 +781,7 @@ $(IO_OBJS): $(IO_H)
42
43 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044 @$(MKDIR_P) Include
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
46+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050047 $(GRAMMAR_C): $(GRAMMAR_H)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050048 touch $(GRAMMAR_C)
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050049
50@@ -968,7 +970,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/pyth
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051 ######################################################################
52
53 TESTOPTS= $(EXTRATESTOPTS)
54-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
55+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
56 TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
57 TESTTIMEOUT= 3600
58
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050059@@ -1455,7 +1457,7 @@ frameworkinstallstructure: $(LDLIBRARY)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050060 fi; \
61 done
62 $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
63- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
64+ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
65 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
66 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
67 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050068@@ -1521,7 +1523,7 @@ config.status: $(srcdir)/configure
Patrick Williamsc124f4f2015-09-15 14:41:29 -050069
70 # Run reindent on the library
71 reindent:
72- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
73+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
74
75 # Rerun configure with the same options as it was run last time,
76 # provided the config.status script exists
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050077@@ -1656,7 +1658,7 @@ funny:
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078
79 # Perform some verification checks on any modified files.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050080 patchcheck: all
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050082+ $(RUNSHARED) ./$(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083
84 # Dependencies
85