blob: 7cd7e3b4906ed08b2808fb61b3ba3759a0ddb2e4 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From ecde3ea170999a9ef734e8af4d7c25be5ba81697 Mon Sep 17 00:00:00 2001
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 31 Mar 2017 15:42:46 +0300
4Subject: [PATCH] cross-compile support
5
6We cross compile python. This patch uses tools from host/native
7python instead of in-tree tools
8
9-Khem
10
Brad Bishop316dfdd2018-06-25 12:45:53 -040011Rebased on 3.5.4
12
Brad Bishopd7bf8c12018-02-25 22:55:05 -050013Upstream-Status: Inappropriate[Configuration Specific]
14Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Brad Bishop316dfdd2018-06-25 12:45:53 -040015Signed-off-by: Derek Straka <derek@asterius.io>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016---
17 Makefile.pre.in | 14 ++++++++------
18 1 file changed, 8 insertions(+), 6 deletions(-)
19
20diff --git a/Makefile.pre.in b/Makefile.pre.in
Brad Bishop316dfdd2018-06-25 12:45:53 -040021index 144c1f8629..f252ac2417 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022--- a/Makefile.pre.in
23+++ b/Makefile.pre.in
Brad Bishop316dfdd2018-06-25 12:45:53 -040024@@ -223,6 +223,7 @@ LIBOBJS= @LIBOBJS@
25
Brad Bishopd7bf8c12018-02-25 22:55:05 -050026 PYTHON= python$(EXE)
27 BUILDPYTHON= python$(BUILDEXE)
28+HOSTPYTHON= $(BUILDPYTHON)
Brad Bishop316dfdd2018-06-25 12:45:53 -040029
30 PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@
Brad Bishopd7bf8c12018-02-25 22:55:05 -050031 PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
Brad Bishop316dfdd2018-06-25 12:45:53 -040032@@ -277,6 +278,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
Brad Bishopd7bf8c12018-02-25 22:55:05 -050033 ##########################################################################
34 # Parser
35 PGEN= Parser/pgen$(EXE)
36+HOSTPGEN= $(PGEN)$(EXE)
Brad Bishop316dfdd2018-06-25 12:45:53 -040037
Brad Bishopd7bf8c12018-02-25 22:55:05 -050038 PSRCS= \
39 Parser/acceler.c \
Brad Bishop316dfdd2018-06-25 12:45:53 -040040@@ -478,7 +480,7 @@ build_all_generate_profile:
41
Brad Bishopd7bf8c12018-02-25 22:55:05 -050042 run_profile_task:
43 : # FIXME: can't run for a cross build
44- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
45+ $(LLVM_PROF_FILE) $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) || true
Brad Bishop316dfdd2018-06-25 12:45:53 -040046
Brad Bishopd7bf8c12018-02-25 22:55:05 -050047 build_all_merge_profile:
48 $(LLVM_PROF_MERGER)
Brad Bishop316dfdd2018-06-25 12:45:53 -040049@@ -772,7 +774,7 @@ regen-grammar: $(PGEN)
50 # Regenerate Include/graminit.h and Python/graminit.c
51 # from Grammar/Grammar using pgen
Brad Bishopd7bf8c12018-02-25 22:55:05 -050052 @$(MKDIR_P) Include
Brad Bishop316dfdd2018-06-25 12:45:53 -040053- $(PGEN) $(srcdir)/Grammar/Grammar \
54+ $(HOSTPGEN) $(srcdir)/Grammar/Grammar \
55 $(srcdir)/Include/graminit.h \
56 $(srcdir)/Python/graminit.c
57
58@@ -978,7 +980,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
Brad Bishopd7bf8c12018-02-25 22:55:05 -050059 ######################################################################
Brad Bishop316dfdd2018-06-25 12:45:53 -040060
Brad Bishopd7bf8c12018-02-25 22:55:05 -050061 TESTOPTS= $(EXTRATESTOPTS)
62-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
63+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
64 TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
65 TESTTIMEOUT= 3600
Brad Bishop316dfdd2018-06-25 12:45:53 -040066
67@@ -1470,7 +1472,7 @@ frameworkinstallstructure: $(LDLIBRARY)
Brad Bishopd7bf8c12018-02-25 22:55:05 -050068 fi; \
69 done
70 $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
71- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
72+ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
73 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
74 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
75 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
Brad Bishop316dfdd2018-06-25 12:45:53 -040076@@ -1543,7 +1545,7 @@ Python/dtoa.o: Python/dtoa.c
77
Brad Bishopd7bf8c12018-02-25 22:55:05 -050078 # Run reindent on the library
79 reindent:
80- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
81+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
Brad Bishop316dfdd2018-06-25 12:45:53 -040082
Brad Bishopd7bf8c12018-02-25 22:55:05 -050083 # Rerun configure with the same options as it was run last time,
84 # provided the config.status script exists
Brad Bishop316dfdd2018-06-25 12:45:53 -040085@@ -1678,7 +1680,7 @@ funny:
86
Brad Bishopd7bf8c12018-02-25 22:55:05 -050087 # Perform some verification checks on any modified files.
Brad Bishop316dfdd2018-06-25 12:45:53 -040088 patchcheck: @DEF_MAKE_RULE@
Brad Bishopd7bf8c12018-02-25 22:55:05 -050089- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
Brad Bishop316dfdd2018-06-25 12:45:53 -040090+ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
91
Brad Bishopd7bf8c12018-02-25 22:55:05 -050092 # Dependencies
Brad Bishop316dfdd2018-06-25 12:45:53 -040093
94--
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500952.11.0
96