diff options
Diffstat (limited to 'meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch')
-rw-r--r-- | meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch | 137 |
1 files changed, 48 insertions, 89 deletions
diff --git a/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch index 691beada03..1257ca6557 100644 --- a/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch +++ b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch | |||
@@ -1,102 +1,83 @@ | |||
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 | |||
1 | Upstream-Status: Inappropriate [embedded specific] | 4 | Upstream-Status: Inappropriate [embedded specific] |
2 | 5 | ||
3 | # We need to ensure our host tools get run during build, not the freshly | 6 | Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille-media.de> |
4 | # built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN. | 7 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> |
5 | # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> | 8 | |
9 | Rebased for python-2.7.9 | ||
10 | Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> | ||
6 | 11 | ||
7 | Index: Python-2.7.2/Makefile.pre.in | 12 | Index: Python-2.7.9/Makefile.pre.in |
8 | =================================================================== | 13 | =================================================================== |
9 | --- Python-2.7.2.orig/Makefile.pre.in | 14 | --- Python-2.7.9.orig/Makefile.pre.in |
10 | +++ Python-2.7.2/Makefile.pre.in | 15 | +++ Python-2.7.9/Makefile.pre.in |
11 | @@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ | 16 | @@ -234,6 +234,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ |
12 | |||
13 | PYTHON= python$(EXE) | ||
14 | BUILDPYTHON= python$(BUILDEXE) | ||
15 | +HOSTPYTHON= $(BUILDPYTHON) | ||
16 | |||
17 | # The task to run while instrument when building the profile-opt target | ||
18 | PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck | ||
19 | @@ -214,7 +215,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ | ||
20 | ########################################################################## | 17 | ########################################################################## |
21 | # Parser | 18 | # Parser |
22 | PGEN= Parser/pgen$(EXE) | 19 | PGEN= Parser/pgen$(EXE) |
23 | - | ||
24 | +HOSTPGEN= $(PGEN)$(EXE) | 20 | +HOSTPGEN= $(PGEN)$(EXE) |
25 | POBJS= \ | ||
26 | Parser/acceler.o \ | ||
27 | Parser/grammar1.o \ | ||
28 | @@ -401,14 +402,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA | ||
29 | $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) | ||
30 | |||
31 | platform: $(BUILDPYTHON) | ||
32 | - $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform | ||
33 | + $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform | ||
34 | 21 | ||
22 | PSRCS= \ | ||
23 | Parser/acceler.c \ | ||
24 | @@ -445,7 +446,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA | ||
25 | $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) | ||
35 | 26 | ||
36 | # Build the shared modules | 27 | platform: $(BUILDPYTHON) pybuilddir.txt |
37 | sharedmods: $(BUILDPYTHON) | 28 | - $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform |
38 | @case $$MAKEFLAGS in \ | 29 | + $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform |
39 | - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ | ||
40 | - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ | ||
41 | + *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ | ||
42 | + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ | ||
43 | esac | ||
44 | 30 | ||
45 | # Build static library | 31 | # Create build directory and generate the sysconfig build-time data there. |
46 | @@ -542,7 +543,7 @@ Modules/python.o: $(srcdir)/Modules/pyth | 32 | # pybuilddir.txt contains the name of the build dir and is used for |
47 | $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp | 33 | @@ -611,7 +612,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p |
48 | Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) | 34 | $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) |
49 | -@$(INSTALL) -d Include | 35 | @$(MKDIR_P) Include |
36 | $(MAKE) $(PGEN) | ||
50 | - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | 37 | - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
51 | + $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | 38 | + $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
52 | -touch Parser/pgen.stamp | 39 | $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) |
53 | 40 | $(MAKE) $(GRAMMAR_H) | |
54 | $(PGEN): $(PGENOBJS) | 41 | touch $(GRAMMAR_C) |
55 | @@ -926,25 +927,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL | 42 | @@ -1043,27 +1044,27 @@ libinstall: build_all $(srcdir)/Lib/$(PL |
56 | done | 43 | $(DESTDIR)$(LIBDEST)/distutils/tests ; \ |
57 | $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt | 44 | fi |
58 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | 45 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
59 | - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ | 46 | - $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
60 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ | 47 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
61 | -d $(LIBDEST) -f \ | 48 | -d $(LIBDEST) -f \ |
62 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ | 49 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ |
63 | $(DESTDIR)$(LIBDEST) | 50 | $(DESTDIR)$(LIBDEST) |
64 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | 51 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
65 | - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ | 52 | - $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ |
66 | + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ | 53 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
67 | -d $(LIBDEST) -f \ | 54 | -d $(LIBDEST) -f \ |
68 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ | 55 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ |
69 | $(DESTDIR)$(LIBDEST) | 56 | $(DESTDIR)$(LIBDEST) |
70 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | 57 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
71 | - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ | 58 | - $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ |
72 | + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ | 59 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
73 | -d $(LIBDEST)/site-packages -f \ | 60 | -d $(LIBDEST)/site-packages -f \ |
74 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages | 61 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages |
75 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | 62 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
76 | - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ | 63 | - $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ |
77 | + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ | 64 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ |
78 | -d $(LIBDEST)/site-packages -f \ | 65 | -d $(LIBDEST)/site-packages -f \ |
79 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages | 66 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages |
80 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | 67 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ |
81 | - ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" | 68 | - $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt |
82 | + $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" | 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 | ||
83 | 73 | ||
84 | # Create the PLATDIR source directory, if one wasn't distributed.. | 74 | # Create the PLATDIR source directory, if one wasn't distributed.. |
85 | $(srcdir)/Lib/$(PLATDIR): | 75 | $(srcdir)/Lib/$(PLATDIR): |
86 | @@ -1049,7 +1050,7 @@ libainstall: all python-config | 76 | Index: Python-2.7.9/setup.py |
87 | # Install the dynamically loadable modules | ||
88 | # This goes into $(exec_prefix) | ||
89 | sharedinstall: sharedmods | ||
90 | - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ | ||
91 | + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ | ||
92 | --prefix=$(prefix) \ | ||
93 | --install-scripts=$(BINDIR) \ | ||
94 | --install-platlib=$(DESTSHARED) \ | ||
95 | Index: Python-2.7.2/setup.py | ||
96 | =================================================================== | 77 | =================================================================== |
97 | --- Python-2.7.2.orig/setup.py | 78 | --- Python-2.7.9.orig/setup.py |
98 | +++ Python-2.7.2/setup.py | 79 | +++ Python-2.7.9/setup.py |
99 | @@ -313,6 +313,7 @@ class PyBuildExt(build_ext): | 80 | @@ -334,6 +334,7 @@ class PyBuildExt(build_ext): |
100 | self.failed.append(ext.name) | 81 | self.failed.append(ext.name) |
101 | self.announce('*** WARNING: renaming "%s" since importing it' | 82 | self.announce('*** WARNING: renaming "%s" since importing it' |
102 | ' failed: %s' % (ext.name, why), level=3) | 83 | ' failed: %s' % (ext.name, why), level=3) |
@@ -104,18 +85,7 @@ Index: Python-2.7.2/setup.py | |||
104 | assert not self.inplace | 85 | assert not self.inplace |
105 | basename, tail = os.path.splitext(ext_filename) | 86 | basename, tail = os.path.splitext(ext_filename) |
106 | newname = basename + "_failed" + tail | 87 | newname = basename + "_failed" + tail |
107 | @@ -369,8 +370,8 @@ class PyBuildExt(build_ext): | 88 | @@ -558,6 +559,9 @@ class PyBuildExt(build_ext): |
108 | |||
109 | def detect_modules(self): | ||
110 | # Ensure that /usr/local is always used | ||
111 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
112 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
113 | + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
114 | + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
115 | self.add_multiarch_paths() | ||
116 | |||
117 | # Add paths specified in the environment variables LDFLAGS and | ||
118 | @@ -475,6 +476,9 @@ class PyBuildExt(build_ext): | ||
119 | 89 | ||
120 | # XXX Omitted modules: gl, pure, dl, SGI-specific modules | 90 | # XXX Omitted modules: gl, pure, dl, SGI-specific modules |
121 | 91 | ||
@@ -125,14 +95,3 @@ Index: Python-2.7.2/setup.py | |||
125 | # | 95 | # |
126 | # The following modules are all pretty straightforward, and compile | 96 | # The following modules are all pretty straightforward, and compile |
127 | # on pretty much any POSIXish platform. | 97 | # on pretty much any POSIXish platform. |
128 | @@ -677,8 +681,8 @@ class PyBuildExt(build_ext): | ||
129 | elif curses_library: | ||
130 | readline_libs.append(curses_library) | ||
131 | elif self.compiler.find_library_file(lib_dirs + | ||
132 | - ['/usr/lib/termcap'], | ||
133 | - 'termcap'): | ||
134 | + ['/usr/lib/termcap'], | ||
135 | + 'termcap'): | ||
136 | readline_libs.append('termcap') | ||
137 | exts.append( Extension('readline', ['readline.c'], | ||
138 | library_dirs=['/usr/lib/termcap'], | ||