Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From ecde3ea170999a9ef734e8af4d7c25be5ba81697 Mon Sep 17 00:00:00 2001 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Fri, 31 Mar 2017 15:42:46 +0300 |
| 4 | Subject: [PATCH] cross-compile support |
| 5 | |
| 6 | We cross compile python. This patch uses tools from host/native |
| 7 | python instead of in-tree tools |
| 8 | |
| 9 | -Khem |
| 10 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 11 | Rebased on 3.5.4 |
| 12 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 13 | Upstream-Status: Inappropriate[Configuration Specific] |
| 14 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 15 | Signed-off-by: Derek Straka <derek@asterius.io> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 16 | --- |
| 17 | Makefile.pre.in | 14 ++++++++------ |
| 18 | 1 file changed, 8 insertions(+), 6 deletions(-) |
| 19 | |
| 20 | diff --git a/Makefile.pre.in b/Makefile.pre.in |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 21 | index 144c1f8629..f252ac2417 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 22 | --- a/Makefile.pre.in |
| 23 | +++ b/Makefile.pre.in |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 24 | @@ -223,6 +223,7 @@ LIBOBJS= @LIBOBJS@ |
| 25 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 26 | PYTHON= python$(EXE) |
| 27 | BUILDPYTHON= python$(BUILDEXE) |
| 28 | +HOSTPYTHON= $(BUILDPYTHON) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 29 | |
| 30 | PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 31 | PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 32 | @@ -277,6 +278,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 33 | ########################################################################## |
| 34 | # Parser |
| 35 | PGEN= Parser/pgen$(EXE) |
| 36 | +HOSTPGEN= $(PGEN)$(EXE) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 37 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 38 | PSRCS= \ |
| 39 | Parser/acceler.c \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 40 | @@ -478,7 +480,7 @@ build_all_generate_profile: |
| 41 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 42 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 46 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 47 | build_all_merge_profile: |
| 48 | $(LLVM_PROF_MERGER) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 49 | @@ -772,7 +774,7 @@ regen-grammar: $(PGEN) |
| 50 | # Regenerate Include/graminit.h and Python/graminit.c |
| 51 | # from Grammar/Grammar using pgen |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 52 | @$(MKDIR_P) Include |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 53 | - $(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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 59 | ###################################################################### |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 60 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 61 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 66 | |
| 67 | @@ -1470,7 +1472,7 @@ frameworkinstallstructure: $(LDLIBRARY) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 68 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 76 | @@ -1543,7 +1545,7 @@ Python/dtoa.o: Python/dtoa.c |
| 77 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 78 | # 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 82 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 83 | # Rerun configure with the same options as it was run last time, |
| 84 | # provided the config.status script exists |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 85 | @@ -1678,7 +1680,7 @@ funny: |
| 86 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 87 | # Perform some verification checks on any modified files. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 88 | patchcheck: @DEF_MAKE_RULE@ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 89 | - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 90 | + $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py |
| 91 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 92 | # Dependencies |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 93 | |
| 94 | -- |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 95 | 2.11.0 |
| 96 | |