Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | We need to ensure our host tools get run during build, not the freshly |
| 2 | built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN. |
| 3 | |
| 4 | Upstream-Status: Inappropriate [embedded specific] |
| 5 | |
| 6 | Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille-media.de> |
| 7 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> |
| 8 | |
| 9 | Rebased for python-2.7.9 |
| 10 | Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> |
| 11 | |
| 12 | Index: Python-2.7.9/Makefile.pre.in |
| 13 | =================================================================== |
| 14 | --- Python-2.7.9.orig/Makefile.pre.in |
| 15 | +++ Python-2.7.9/Makefile.pre.in |
| 16 | @@ -234,6 +234,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ |
| 17 | ########################################################################## |
| 18 | # Parser |
| 19 | PGEN= Parser/pgen$(EXE) |
| 20 | +HOSTPGEN= $(PGEN)$(EXE) |
| 21 | |
| 22 | PSRCS= \ |
| 23 | Parser/acceler.c \ |
| 24 | @@ -445,7 +446,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA |
| 25 | $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) |
| 26 | |
| 27 | platform: $(BUILDPYTHON) pybuilddir.txt |
| 28 | - $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform |
| 29 | + $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform |
| 30 | |
| 31 | # Create build directory and generate the sysconfig build-time data there. |
| 32 | # pybuilddir.txt contains the name of the build dir and is used for |
| 33 | @@ -611,7 +612,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p |
| 34 | $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) |
| 35 | @$(MKDIR_P) Include |
| 36 | $(MAKE) $(PGEN) |
| 37 | - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
| 38 | + $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
| 39 | $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) |
| 40 | $(MAKE) $(GRAMMAR_H) |
| 41 | touch $(GRAMMAR_C) |
| 42 | @@ -1043,27 +1044,27 @@ libinstall: build_all $(srcdir)/Lib/$(PL |
| 43 | $(DESTDIR)$(LIBDEST)/distutils/tests ; \ |
| 44 | fi |
| 45 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
| 46 | - $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
| 47 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
| 48 | -d $(LIBDEST) -f \ |
| 49 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ |
| 50 | $(DESTDIR)$(LIBDEST) |
| 51 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
| 52 | - $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ |
| 53 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
| 54 | -d $(LIBDEST) -f \ |
| 55 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ |
| 56 | $(DESTDIR)$(LIBDEST) |
| 57 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
| 58 | - $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ |
| 59 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
| 60 | -d $(LIBDEST)/site-packages -f \ |
| 61 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages |
| 62 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
| 63 | - $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ |
| 64 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
| 65 | -d $(LIBDEST)/site-packages -f \ |
| 66 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages |
| 67 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
| 68 | - $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt |
| 69 | + $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt |
| 70 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
| 71 | - $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt |
| 72 | + $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt |
| 73 | |
| 74 | # Create the PLATDIR source directory, if one wasn't distributed.. |
| 75 | $(srcdir)/Lib/$(PLATDIR): |
| 76 | Index: Python-2.7.9/setup.py |
| 77 | =================================================================== |
| 78 | --- Python-2.7.9.orig/setup.py |
| 79 | +++ Python-2.7.9/setup.py |
| 80 | @@ -334,6 +334,7 @@ class PyBuildExt(build_ext): |
| 81 | self.failed.append(ext.name) |
| 82 | self.announce('*** WARNING: renaming "%s" since importing it' |
| 83 | ' failed: %s' % (ext.name, why), level=3) |
| 84 | + return |
| 85 | assert not self.inplace |
| 86 | basename, tail = os.path.splitext(ext_filename) |
| 87 | newname = basename + "_failed" + tail |
| 88 | @@ -558,6 +559,9 @@ class PyBuildExt(build_ext): |
| 89 | |
| 90 | # XXX Omitted modules: gl, pure, dl, SGI-specific modules |
| 91 | |
| 92 | + lib_dirs = [ os.getenv("STAGING_LIBDIR"), os.getenv("STAGING_BASELIBDIR") ] |
| 93 | + inc_dirs = [ os.getenv("STAGING_INCDIR") ] |
| 94 | + |
| 95 | # |
| 96 | # The following modules are all pretty straightforward, and compile |
| 97 | # on pretty much any POSIXish platform. |