summaryrefslogtreecommitdiffstats
path: root/meta/packages/python/python-2.5.2/crosscompile.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/python/python-2.5.2/crosscompile.patch')
-rw-r--r--meta/packages/python/python-2.5.2/crosscompile.patch110
1 files changed, 110 insertions, 0 deletions
diff --git a/meta/packages/python/python-2.5.2/crosscompile.patch b/meta/packages/python/python-2.5.2/crosscompile.patch
new file mode 100644
index 0000000000..f1b1c6f3e0
--- /dev/null
+++ b/meta/packages/python/python-2.5.2/crosscompile.patch
@@ -0,0 +1,110 @@
1#
2# Patch (C) by Michael 'Mickey' Lauer <mlauer@vanille-media.de>
3#
4Index: Python-2.5.2/Makefile.pre.in
5===================================================================
6--- Python-2.5.2.orig/Makefile.pre.in
7+++ Python-2.5.2/Makefile.pre.in
8@@ -173,6 +173,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
9
10 PYTHON= python$(EXE)
11 BUILDPYTHON= python$(BUILDEXE)
12+HOSTPYTHON= $(BUILDPYTHON)
13
14 # === Definitions added by makesetup ===
15
16@@ -199,7 +200,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
17 ##########################################################################
18 # Parser
19 PGEN= Parser/pgen$(EXE)
20-
21+HOSTPGEN= $(PGEN)$(EXE)
22 POBJS= \
23 Parser/acceler.o \
24 Parser/grammar1.o \
25@@ -348,8 +349,8 @@ platform: $(BUILDPYTHON)
26 # Build the shared modules
27 sharedmods: $(BUILDPYTHON)
28 case $$MAKEFLAGS in \
29- *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
30- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
31+ *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
32+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
33 esac
34
35 # Build static library
36@@ -474,7 +475,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
37
38 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
39 -@ mkdir Include
40- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
41+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
42
43 $(PGEN): $(PGENOBJS)
44 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
45@@ -782,19 +783,19 @@ libinstall: $(BUILDPYTHON) $(srcdir)/Lib
46 done
47 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
48 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
49- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
50+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
51 -d $(LIBDEST) -f \
52 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
53 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
54- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
55+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
56 -d $(LIBDEST) -f \
57 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
58 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
59- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
60+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
61 -d $(LIBDEST)/site-packages -f \
62 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
63 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
64- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
65+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
66 -d $(LIBDEST)/site-packages -f \
67 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
68
69@@ -894,7 +895,7 @@ libainstall: all
70 # Install the dynamically loadable modules
71 # This goes into $(exec_prefix)
72 sharedinstall:
73- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
74+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
75 --prefix=$(prefix) \
76 --install-scripts=$(BINDIR) \
77 --install-platlib=$(DESTSHARED) \
78Index: Python-2.5.2/setup.py
79===================================================================
80--- Python-2.5.2.orig/setup.py
81+++ Python-2.5.2/setup.py
82@@ -211,6 +211,7 @@ class PyBuildExt(build_ext):
83 except ImportError, why:
84 self.announce('*** WARNING: renaming "%s" since importing it'
85 ' failed: %s' % (ext.name, why), level=3)
86+ return
87 assert not self.inplace
88 basename, tail = os.path.splitext(ext_filename)
89 newname = basename + "_failed" + tail
90@@ -244,8 +245,8 @@ class PyBuildExt(build_ext):
91
92 def detect_modules(self):
93 # Ensure that /usr/local is always used
94- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
95- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
96+ # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
97+ # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
98
99 # Add paths specified in the environment variables LDFLAGS and
100 # CPPFLAGS for header and library files.
101@@ -342,6 +343,9 @@ class PyBuildExt(build_ext):
102
103 # XXX Omitted modules: gl, pure, dl, SGI-specific modules
104
105+ lib_dirs = [ os.getenv( "STAGING_LIBDIR" ) ]
106+ inc_dirs = [ os.getenv( "STAGING_INCDIR" ) ]
107+
108 #
109 # The following modules are all pretty straightforward, and compile
110 # on pretty much any POSIXish platform.