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 | |
| 12 | --- a/Makefile.pre.in |
| 13 | +++ b/Makefile.pre.in |
| 14 | @@ -193,6 +193,7 @@ LIBOBJS= @LIBOBJS@ |
| 15 | |
| 16 | PYTHON= python$(EXE) |
| 17 | BUILDPYTHON= python$(BUILDEXE) |
| 18 | +HOSTPYTHON= $(BUILDPYTHON) |
| 19 | |
| 20 | PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ |
| 21 | _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ |
| 22 | @@ -239,6 +240,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ |
| 23 | ########################################################################## |
| 24 | # Parser |
| 25 | PGEN= Parser/pgen$(EXE) |
| 26 | +HOSTPGEN= $(PGEN)$(EXE) |
| 27 | |
| 28 | PSRCS= \ |
| 29 | Parser/acceler.c \ |
| 30 | @@ -451,7 +453,7 @@ build_all_generate_profile: |
| 31 | |
| 32 | run_profile_task: |
| 33 | : # FIXME: can't run for a cross build |
| 34 | - $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) |
| 35 | + $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) |
| 36 | |
| 37 | build_all_use_profile: |
| 38 | $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction" |
| 39 | @@ -640,7 +642,7 @@ $(IO_OBJS): $(IO_H) |
| 40 | $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) |
| 41 | @$(MKDIR_P) Include |
| 42 | $(MAKE) $(PGEN) |
| 43 | - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
| 44 | + $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
| 45 | $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) |
| 46 | $(MAKE) $(GRAMMAR_H) |
| 47 | touch $(GRAMMAR_C) |
| 48 | @@ -820,7 +822,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho |
| 49 | ###################################################################### |
| 50 | |
| 51 | TESTOPTS= $(EXTRATESTOPTS) |
| 52 | -TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS) |
| 53 | +TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS) |
| 54 | TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py |
| 55 | TESTTIMEOUT= 3600 |
| 56 | |
| 57 | @@ -1229,7 +1231,7 @@ frameworkinstallstructure: $(LDLIBRARY) |
| 58 | fi; \ |
| 59 | done |
| 60 | $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers |
| 61 | - sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist |
| 62 | + sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist |
| 63 | $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current |
| 64 | $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) |
| 65 | $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers |
| 66 | @@ -1288,7 +1290,7 @@ config.status: $(srcdir)/configure |
| 67 | |
| 68 | # Run reindent on the library |
| 69 | reindent: |
| 70 | - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib |
| 71 | + $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib |
| 72 | |
| 73 | # Rerun configure with the same options as it was run last time, |
| 74 | # provided the config.status script exists |
| 75 | @@ -1414,7 +1416,7 @@ funny: |
| 76 | |
| 77 | # Perform some verification checks on any modified files. |
| 78 | patchcheck: |
| 79 | - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py |
| 80 | + $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py |
| 81 | |
| 82 | # Dependencies |
| 83 | |