summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
diff options
context:
space:
mode:
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.patch138
1 files changed, 138 insertions, 0 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
new file mode 100644
index 0000000000..691beada03
--- /dev/null
+++ b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
@@ -0,0 +1,138 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# We need to ensure our host tools get run during build, not the freshly
4# built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
5# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
6
7Index: Python-2.7.2/Makefile.pre.in
8===================================================================
9--- Python-2.7.2.orig/Makefile.pre.in
10+++ Python-2.7.2/Makefile.pre.in
11@@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
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 ##########################################################################
21 # Parser
22 PGEN= Parser/pgen$(EXE)
23-
24+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
35
36 # Build the shared modules
37 sharedmods: $(BUILDPYTHON)
38 @case $$MAKEFLAGS in \
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
45 # Build static library
46@@ -542,7 +543,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
47 $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
48 Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
49 -@$(INSTALL) -d Include
50- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
51+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
52 -touch Parser/pgen.stamp
53
54 $(PGEN): $(PGENOBJS)
55@@ -926,25 +927,25 @@ libinstall: build_all $(srcdir)/Lib/$(PL
56 done
57 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
58 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
59- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
60+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
61 -d $(LIBDEST) -f \
62 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
63 $(DESTDIR)$(LIBDEST)
64 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
65- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
66+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
67 -d $(LIBDEST) -f \
68 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
69 $(DESTDIR)$(LIBDEST)
70 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
71- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
72+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
73 -d $(LIBDEST)/site-packages -f \
74 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
75 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
76- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
77+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
78 -d $(LIBDEST)/site-packages -f \
79 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
80 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
81- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
82+ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
83
84 # Create the PLATDIR source directory, if one wasn't distributed..
85 $(srcdir)/Lib/$(PLATDIR):
86@@ -1049,7 +1050,7 @@ libainstall: all python-config
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) \
95Index: Python-2.7.2/setup.py
96===================================================================
97--- Python-2.7.2.orig/setup.py
98+++ Python-2.7.2/setup.py
99@@ -313,6 +313,7 @@ class PyBuildExt(build_ext):
100 self.failed.append(ext.name)
101 self.announce('*** WARNING: renaming "%s" since importing it'
102 ' failed: %s' % (ext.name, why), level=3)
103+ return
104 assert not self.inplace
105 basename, tail = os.path.splitext(ext_filename)
106 newname = basename + "_failed" + tail
107@@ -369,8 +370,8 @@ 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
120 # XXX Omitted modules: gl, pure, dl, SGI-specific modules
121
122+ lib_dirs = [ os.getenv("STAGING_LIBDIR"), os.getenv("STAGING_BASELIBDIR") ]
123+ inc_dirs = [ os.getenv("STAGING_INCDIR") ]
124+
125 #
126 # The following modules are all pretty straightforward, and compile
127 # 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'],