Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | We cross compile python. This patch uses tools from host/native |
| 2 | python instead of in-tree tools |
| 3 | |
| 4 | -Khem |
| 5 | |
| 6 | Upstream-Status: Inappropriate[Configuration Specific] |
| 7 | |
| 8 | --- |
| 9 | Makefile.pre.in | 25 +++++++++++++------------ |
| 10 | 1 file changed, 13 insertions(+), 12 deletions(-) |
| 11 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 12 | Index: 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | |
| 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 24 | @@ -276,6 +277,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | ########################################################################## |
| 26 | # Parser |
| 27 | PGEN= Parser/pgen$(EXE) |
| 28 | +HOSTPGEN= $(PGEN)$(EXE) |
| 29 | |
| 30 | PSRCS= \ |
| 31 | Parser/acceler.c \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 32 | @@ -506,7 +508,7 @@ build_all_generate_profile: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | |
| 34 | run_profile_task: |
| 35 | : # FIXME: can't run for a cross build |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 36 | - $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true |
| 37 | + $(LLVM_PROF_FILE) $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) || true |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 39 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | @$(MKDIR_P) Include |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
| 46 | + $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 47 | $(GRAMMAR_C): $(GRAMMAR_H) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | touch $(GRAMMAR_C) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 49 | |
| 50 | @@ -968,7 +970,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/pyth |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | ###################################################################### |
| 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 59 | @@ -1455,7 +1457,7 @@ frameworkinstallstructure: $(LDLIBRARY) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 68 | @@ -1521,7 +1523,7 @@ config.status: $(srcdir)/configure |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 69 | |
| 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 77 | @@ -1656,7 +1658,7 @@ funny: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 78 | |
| 79 | # Perform some verification checks on any modified files. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 80 | patchcheck: all |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 82 | + $(RUNSHARED) ./$(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 83 | |
| 84 | # Dependencies |
| 85 | |