summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python/multilib.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python/multilib.patch')
-rw-r--r--meta/recipes-devtools/python/python/multilib.patch257
1 files changed, 257 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python/multilib.patch b/meta/recipes-devtools/python/python/multilib.patch
new file mode 100644
index 0000000000..df470f7c09
--- /dev/null
+++ b/meta/recipes-devtools/python/python/multilib.patch
@@ -0,0 +1,257 @@
1commit 248279e54467a8cd5cde98fc124d1d1384703513
2Author: Yu Ke <ke.yu@intel.com>
3Date: Tue Jun 28 21:21:29 2011 +0800
4
5 SUSE patch for the lib64 issue
6
7 see detail in http://bugs.python.org/issue1294959
8
9 also rebased a bit for Yocto python 2.6.6
10
11 Picked-by: Yu Ke <ke.yu@intel.com>
12
132011/09/29
14Rebased for python 2.7.2
15
16Upstream-Status: Inappropriate [configuration]
17
18Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
19
20Index: Python-2.7.2/Include/pythonrun.h
21===================================================================
22--- Python-2.7.2.orig/Include/pythonrun.h
23+++ Python-2.7.2/Include/pythonrun.h
24@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
25 /* In their own files */
26 PyAPI_FUNC(const char *) Py_GetVersion(void);
27 PyAPI_FUNC(const char *) Py_GetPlatform(void);
28+PyAPI_FUNC(const char *) Py_GetLib(void);
29 PyAPI_FUNC(const char *) Py_GetCopyright(void);
30 PyAPI_FUNC(const char *) Py_GetCompiler(void);
31 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
32Index: Python-2.7.2/Lib/distutils/command/install.py
33===================================================================
34--- Python-2.7.2.orig/Lib/distutils/command/install.py
35+++ Python-2.7.2/Lib/distutils/command/install.py
36@@ -22,6 +22,8 @@ from site import USER_BASE
37 from site import USER_SITE
38
39
40+libname = sys.lib
41+
42 if sys.version < "2.2":
43 WINDOWS_SCHEME = {
44 'purelib': '$base',
45@@ -42,7 +44,7 @@ else:
46 INSTALL_SCHEMES = {
47 'unix_prefix': {
48 'purelib': '$base/lib/python$py_version_short/site-packages',
49- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
50+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
51 'headers': '$base/include/python$py_version_short/$dist_name',
52 'scripts': '$base/bin',
53 'data' : '$base',
54Index: Python-2.7.2/Lib/distutils/sysconfig.py
55===================================================================
56--- Python-2.7.2.orig/Lib/distutils/sysconfig.py
57+++ Python-2.7.2/Lib/distutils/sysconfig.py
58@@ -114,8 +114,11 @@ def get_python_lib(plat_specific=0, stan
59 prefix = plat_specific and EXEC_PREFIX or PREFIX
60
61 if os.name == "posix":
62- libpython = os.path.join(prefix,
63- "lib", "python" + get_python_version())
64+ if plat_specific or standard_lib:
65+ lib = sys.lib
66+ else:
67+ lib = "lib"
68+ libpython = os.path.join(prefix, lib, "python" + get_python_version())
69 if standard_lib:
70 return libpython
71 else:
72Index: Python-2.7.2/Lib/pydoc.py
73===================================================================
74--- Python-2.7.2.orig/Lib/pydoc.py
75+++ Python-2.7.2/Lib/pydoc.py
76@@ -352,7 +352,7 @@ class Doc:
77
78 docloc = os.environ.get("PYTHONDOCS",
79 "http://docs.python.org/library")
80- basedir = os.path.join(sys.exec_prefix, "lib",
81+ basedir = os.path.join(sys.exec_prefix, sys.lib,
82 "python"+sys.version[0:3])
83 if (isinstance(object, type(os)) and
84 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
85Index: Python-2.7.2/Lib/site.py
86===================================================================
87--- Python-2.7.2.orig/Lib/site.py
88+++ Python-2.7.2/Lib/site.py
89@@ -300,13 +300,19 @@ def getsitepackages():
90 if sys.platform in ('os2emx', 'riscos'):
91 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
92 elif os.sep == '/':
93- sitepackages.append(os.path.join(prefix, "lib",
94+ sitepackages.append(os.path.join(prefix, sys.lib,
95 "python" + sys.version[:3],
96 "site-packages"))
97- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
98+ if sys.lib != "lib":
99+ sitepackages.append(os.path.join(prefix, "lib",
100+ "python" + sys.version[:3],
101+ "site-packages"))
102+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
103+ if sys.lib != "lib":
104+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
105 else:
106 sitepackages.append(prefix)
107- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
108+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
109 if sys.platform == "darwin":
110 # for framework builds *only* we add the standard Apple
111 # locations.
112Index: Python-2.7.2/Lib/test/test_dl.py
113===================================================================
114--- Python-2.7.2.orig/Lib/test/test_dl.py
115+++ Python-2.7.2/Lib/test/test_dl.py
116@@ -5,10 +5,11 @@
117 import unittest
118 from test.test_support import verbose, import_module
119 dl = import_module('dl', deprecated=True)
120+import sys
121
122 sharedlibs = [
123- ('/usr/lib/libc.so', 'getpid'),
124- ('/lib/libc.so.6', 'getpid'),
125+ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
126+ ('/'+sys.lib+'/libc.so.6', 'getpid'),
127 ('/usr/bin/cygwin1.dll', 'getpid'),
128 ('/usr/lib/libc.dylib', 'getpid'),
129 ]
130Index: Python-2.7.2/Lib/trace.py
131===================================================================
132--- Python-2.7.2.orig/Lib/trace.py
133+++ Python-2.7.2/Lib/trace.py
134@@ -762,10 +762,10 @@ def main(argv=None):
135 # should I also call expanduser? (after all, could use $HOME)
136
137 s = s.replace("$prefix",
138- os.path.join(sys.prefix, "lib",
139+ os.path.join(sys.prefix, sys.lib,
140 "python" + sys.version[:3]))
141 s = s.replace("$exec_prefix",
142- os.path.join(sys.exec_prefix, "lib",
143+ os.path.join(sys.exec_prefix, sys.lib,
144 "python" + sys.version[:3]))
145 s = os.path.normpath(s)
146 ignore_dirs.append(s)
147Index: Python-2.7.2/Makefile.pre.in
148===================================================================
149--- Python-2.7.2.orig/Makefile.pre.in
150+++ Python-2.7.2/Makefile.pre.in
151@@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
152
153 # Machine-dependent subdirectories
154 MACHDEP= @MACHDEP@
155+LIB= @LIB@
156
157 # Install prefix for architecture-independent files
158 prefix= @prefix@
159@@ -97,7 +98,7 @@ LIBDIR= @libdir@
160 MANDIR= @mandir@
161 INCLUDEDIR= @includedir@
162 CONFINCLUDEDIR= $(exec_prefix)/include
163-SCRIPTDIR= $(prefix)/lib
164+SCRIPTDIR= $(prefix)/@LIB@
165
166 # Detailed destination directories
167 BINLIBDEST= $(LIBDIR)/python$(VERSION)
168@@ -533,6 +534,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
169 -DEXEC_PREFIX='"$(exec_prefix)"' \
170 -DVERSION='"$(VERSION)"' \
171 -DVPATH='"$(VPATH)"' \
172+ -DLIB='"$(LIB)"' \
173 -o $@ $(srcdir)/Modules/getpath.c
174
175 Modules/python.o: $(srcdir)/Modules/python.c
176@@ -567,7 +569,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
177 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
178
179 Python/getplatform.o: $(srcdir)/Python/getplatform.c
180- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
181+ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
182
183 Python/importdl.o: $(srcdir)/Python/importdl.c
184 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
185Index: Python-2.7.2/Modules/getpath.c
186===================================================================
187--- Python-2.7.2.orig/Modules/getpath.c
188+++ Python-2.7.2/Modules/getpath.c
189@@ -116,9 +116,11 @@
190 #define EXEC_PREFIX PREFIX
191 #endif
192
193+#define LIB_PYTHON LIB "/python" VERSION
194+
195 #ifndef PYTHONPATH
196-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
197- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
198+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
199+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
200 #endif
201
202 #ifndef LANDMARK
203@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
204 static char exec_prefix[MAXPATHLEN+1];
205 static char progpath[MAXPATHLEN+1];
206 static char *module_search_path = NULL;
207-static char lib_python[] = "lib/python" VERSION;
208+static char lib_python[] = LIB_PYTHON;
209
210 static void
211 reduce(char *dir)
212Index: Python-2.7.2/Python/getplatform.c
213===================================================================
214--- Python-2.7.2.orig/Python/getplatform.c
215+++ Python-2.7.2/Python/getplatform.c
216@@ -10,3 +10,13 @@ Py_GetPlatform(void)
217 {
218 return PLATFORM;
219 }
220+
221+#ifndef LIB
222+#define LIB "lib"
223+#endif
224+
225+const char *
226+Py_GetLib(void)
227+{
228+ return LIB;
229+}
230Index: Python-2.7.2/Python/sysmodule.c
231===================================================================
232--- Python-2.7.2.orig/Python/sysmodule.c
233+++ Python-2.7.2/Python/sysmodule.c
234@@ -1416,6 +1416,8 @@ _PySys_Init(void)
235 PyString_FromString(Py_GetCopyright()));
236 SET_SYS_FROM_STRING("platform",
237 PyString_FromString(Py_GetPlatform()));
238+ SET_SYS_FROM_STRING("lib",
239+ PyString_FromString(Py_GetLib()));
240 SET_SYS_FROM_STRING("executable",
241 PyString_FromString(Py_GetProgramFullPath()));
242 SET_SYS_FROM_STRING("prefix",
243Index: Python-2.7.2/configure.in
244===================================================================
245--- Python-2.7.2.orig/configure.in
246+++ Python-2.7.2/configure.in
247@@ -629,6 +629,10 @@ SunOS*)
248 ;;
249 esac
250
251+AC_SUBST(LIB)
252+AC_MSG_CHECKING(LIB)
253+LIB=`basename ${libdir}`
254+AC_MSG_RESULT($LIB)
255
256 AC_SUBST(LIBRARY)
257 AC_MSG_CHECKING(LIBRARY)