]>
Commit | Line | Data |
---|---|---|
d41c15c0 JB |
1 | diff -Nur Python-3.2.orig/configure.in Python-3.2/configure.in |
2 | --- Python-3.2.orig/configure.in 2011-02-19 08:58:23.000000000 +0000 | |
75257062 | 3 | +++ Python-3.2/configure.in 2011-05-21 21:16:30.000000000 +0100 |
4 | @@ -580,6 +580,41 @@ | |
5 | esac;; | |
e684db95 AM |
6 | esac |
7 | ||
8 | +AC_SUBST(ARCH) | |
9 | +AC_MSG_CHECKING(ARCH) | |
10 | +ARCH=`uname -m` | |
11 | +case $ARCH in | |
12 | +i?86) ARCH=i386;; | |
13 | +esac | |
14 | +AC_MSG_RESULT($ARCH) | |
15 | + | |
16 | +AC_SUBST(LIB) | |
17 | +AC_MSG_CHECKING(LIB) | |
18 | +case $ac_sys_system in | |
19 | +Linux*) | |
20 | + # Test if the compiler is 64bit | |
21 | + echo 'int i;' > conftest.$ac_ext | |
22 | + python_cv_cc_64bit_output=no | |
23 | + if AC_TRY_EVAL(ac_compile); then | |
24 | + case `/usr/bin/file conftest.$ac_objext` in | |
25 | + *"ELF 64"*) | |
26 | + python_cv_cc_64bit_output=yes | |
27 | + ;; | |
28 | + esac | |
29 | + fi | |
30 | + rm -rf conftest* | |
31 | + ;; | |
32 | +esac | |
33 | + | |
34 | +case $ARCH:$python_cv_cc_64bit_output in | |
35 | +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) | |
36 | + LIB="lib64" | |
37 | + ;; | |
38 | +*:*) | |
39 | + LIB="lib" | |
40 | + ;; | |
41 | +esac | |
42 | +AC_MSG_RESULT($LIB) | |
43 | ||
44 | AC_SUBST(LIBRARY) | |
45 | AC_MSG_CHECKING(LIBRARY) | |
d41c15c0 JB |
46 | diff -Nur Python-3.2.orig/Include/pythonrun.h Python-3.2/Include/pythonrun.h |
47 | --- Python-3.2.orig/Include/pythonrun.h 2010-12-27 01:49:31.000000000 +0000 | |
75257062 | 48 | +++ Python-3.2/Include/pythonrun.h 2011-05-21 21:16:30.000000000 +0100 |
49 | @@ -175,6 +175,8 @@ | |
e684db95 AM |
50 | /* In their own files */ |
51 | PyAPI_FUNC(const char *) Py_GetVersion(void); | |
52 | PyAPI_FUNC(const char *) Py_GetPlatform(void); | |
53 | +PyAPI_FUNC(const char *) Py_GetArch(void); | |
54 | +PyAPI_FUNC(const char *) Py_GetLib(void); | |
55 | PyAPI_FUNC(const char *) Py_GetCopyright(void); | |
56 | PyAPI_FUNC(const char *) Py_GetCompiler(void); | |
57 | PyAPI_FUNC(const char *) Py_GetBuildInfo(void); | |
d41c15c0 JB |
58 | diff -Nur Python-3.2.orig/Lib/distutils/command/install.py Python-3.2/Lib/distutils/command/install.py |
59 | --- Python-3.2.orig/Lib/distutils/command/install.py 2010-11-25 03:46:44.000000000 +0000 | |
75257062 | 60 | +++ Python-3.2/Lib/distutils/command/install.py 2011-05-21 21:16:30.000000000 +0100 |
e3852288 JB |
61 | @@ -27,6 +27,8 @@ |
62 | from site import USER_SITE | |
63 | HAS_USER_SITE = True | |
e684db95 AM |
64 | |
65 | +libname = sys.lib | |
66 | + | |
67 | if sys.version < "2.2": | |
68 | WINDOWS_SCHEME = { | |
69 | 'purelib': '$base', | |
e3852288 | 70 | @@ -47,14 +49,14 @@ |
e684db95 AM |
71 | INSTALL_SCHEMES = { |
72 | 'unix_prefix': { | |
73 | 'purelib': '$base/lib/python$py_version_short/site-packages', | |
74 | - 'platlib': '$platbase/lib/python$py_version_short/site-packages', | |
75 | + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', | |
e3852288 | 76 | 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', |
e684db95 AM |
77 | 'scripts': '$base/bin', |
78 | 'data' : '$base', | |
79 | }, | |
80 | 'unix_home': { | |
81 | 'purelib': '$base/lib/python', | |
82 | - 'platlib': '$base/lib/python', | |
83 | + 'platlib': '$base/'+libname+'/python', | |
84 | 'headers': '$base/include/python/$dist_name', | |
85 | 'scripts': '$base/bin', | |
86 | 'data' : '$base', | |
d41c15c0 JB |
87 | diff -Nur Python-3.2.orig/Lib/distutils/sysconfig.py Python-3.2/Lib/distutils/sysconfig.py |
88 | --- Python-3.2.orig/Lib/distutils/sysconfig.py 2010-11-24 19:43:47.000000000 +0000 | |
75257062 | 89 | +++ Python-3.2/Lib/distutils/sysconfig.py 2011-05-21 21:16:30.000000000 +0100 |
90 | @@ -124,8 +124,12 @@ | |
e684db95 AM |
91 | prefix = plat_specific and EXEC_PREFIX or PREFIX |
92 | ||
93 | if os.name == "posix": | |
94 | + if plat_specific: | |
95 | + lib = sys.lib | |
96 | + else: | |
97 | + lib = 'lib' | |
98 | libpython = os.path.join(prefix, | |
99 | - "lib", "python" + get_python_version()) | |
100 | + lib, "python" + get_python_version()) | |
101 | if standard_lib: | |
102 | return libpython | |
103 | else: | |
d41c15c0 JB |
104 | diff -Nur Python-3.2.orig/Lib/distutils/tests/test_install.py Python-3.2/Lib/distutils/tests/test_install.py |
105 | --- Python-3.2.orig/Lib/distutils/tests/test_install.py 2010-11-20 19:04:17.000000000 +0000 | |
75257062 | 106 | +++ Python-3.2/Lib/distutils/tests/test_install.py 2011-05-21 21:16:30.000000000 +0100 |
107 | @@ -49,8 +49,9 @@ | |
e684db95 AM |
108 | self.assertEqual(got, expected) |
109 | ||
110 | libdir = os.path.join(destination, "lib", "python") | |
111 | + platlibdir = os.path.join(destination, sys.lib, "python") | |
112 | check_path(cmd.install_lib, libdir) | |
113 | - check_path(cmd.install_platlib, libdir) | |
114 | + check_path(cmd.install_platlib, platlibdir) | |
115 | check_path(cmd.install_purelib, libdir) | |
116 | check_path(cmd.install_headers, | |
117 | os.path.join(destination, "include", "python", "foopkg")) | |
d41c15c0 JB |
118 | diff -Nur Python-3.2.orig/Lib/site.py Python-3.2/Lib/site.py |
119 | --- Python-3.2.orig/Lib/site.py 2010-12-26 19:54:29.000000000 +0000 | |
75257062 | 120 | +++ Python-3.2/Lib/site.py 2011-05-21 21:16:30.000000000 +0100 |
e3852288 | 121 | @@ -285,13 +285,16 @@ |
04df829f | 122 | if sys.platform in ('os2emx', 'riscos'): |
e3852288 | 123 | sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) |
04df829f | 124 | elif os.sep == '/': |
e3852288 JB |
125 | - sitepackages.append(os.path.join(prefix, "lib", |
126 | + sitepackages.append(os.path.join(prefix, sys.lib, | |
04df829f | 127 | "python" + sys.version[:3], |
128 | "site-packages")) | |
e3852288 JB |
129 | - sitepackages.append(os.path.join(prefix, "lib", "site-python")) |
130 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) | |
04df829f | 131 | + if sys.lib != 'lib': |
e3852288 JB |
132 | + sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages")) |
133 | + sitepackages.append(os.path.join(prefix, "lib", "site-python")) | |
04df829f | 134 | else: |
e3852288 JB |
135 | sitepackages.append(prefix) |
136 | - sitepackages.append(os.path.join(prefix, "lib", "site-packages")) | |
137 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) | |
04df829f | 138 | if sys.platform == "darwin": |
139 | # for framework builds *only* we add the standard Apple | |
e3852288 | 140 | # locations. |
d41c15c0 JB |
141 | diff -Nur Python-3.2.orig/Lib/sysconfig.py Python-3.2/Lib/sysconfig.py |
142 | --- Python-3.2.orig/Lib/sysconfig.py 2010-11-25 01:34:47.000000000 +0000 | |
75257062 | 143 | +++ Python-3.2/Lib/sysconfig.py 2011-05-21 21:23:17.000000000 +0100 |
144 | @@ -21,10 +21,10 @@ | |
145 | ||
146 | _INSTALL_SCHEMES = { | |
147 | 'posix_prefix': { | |
148 | - 'stdlib': '{base}/lib/python{py_version_short}', | |
149 | - 'platstdlib': '{platbase}/lib/python{py_version_short}', | |
150 | + 'stdlib': '{base}/' + sys.lib + '/python{py_version_short}', | |
151 | + 'platstdlib': '{platbase}/' + sys.lib + '/python{py_version_short}', | |
152 | 'purelib': '{base}/lib/python{py_version_short}/site-packages', | |
153 | - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', | |
154 | + 'platlib': '{platbase}/' + sys.lib + '/python{py_version_short}/site-packages', | |
155 | 'include': | |
156 | '{base}/include/python{py_version_short}{abiflags}', | |
157 | 'platinclude': | |
158 | @@ -33,10 +33,10 @@ | |
159 | 'data': '{base}', | |
160 | }, | |
161 | 'posix_home': { | |
162 | - 'stdlib': '{base}/lib/python', | |
163 | - 'platstdlib': '{base}/lib/python', | |
164 | + 'stdlib': '{base}/' + sys.lib + '/python', | |
165 | + 'platstdlib': '{base}/' + sys.lib + '/python', | |
166 | 'purelib': '{base}/lib/python', | |
167 | - 'platlib': '{base}/lib/python', | |
168 | + 'platlib': '{base}/' + sys.lib + '/python', | |
169 | 'include': '{base}/include/python', | |
170 | 'platinclude': '{base}/include/python', | |
171 | 'scripts': '{base}/bin', | |
d41c15c0 JB |
172 | diff -Nur Python-3.2.orig/Makefile.pre.in Python-3.2/Makefile.pre.in |
173 | --- Python-3.2.orig/Makefile.pre.in 2011-02-19 08:47:14.000000000 +0000 | |
75257062 | 174 | +++ Python-3.2/Makefile.pre.in 2011-05-21 21:16:30.000000000 +0100 |
e3852288 | 175 | @@ -86,6 +86,8 @@ |
e684db95 AM |
176 | |
177 | # Machine-dependent subdirectories | |
178 | MACHDEP= @MACHDEP@ | |
179 | +LIB= @LIB@ | |
180 | +ARCH= @ARCH@ | |
181 | ||
182 | # Install prefix for architecture-independent files | |
183 | prefix= @prefix@ | |
e3852288 | 184 | @@ -102,7 +104,7 @@ |
e684db95 AM |
185 | MANDIR= @mandir@ |
186 | INCLUDEDIR= @includedir@ | |
187 | CONFINCLUDEDIR= $(exec_prefix)/include | |
188 | -SCRIPTDIR= $(prefix)/lib | |
189 | +SCRIPTDIR= $(prefix)/$(LIB) | |
e3852288 | 190 | ABIFLAGS= @ABIFLAGS@ |
e684db95 AM |
191 | |
192 | # Detailed destination directories | |
e3852288 JB |
193 | @@ -605,7 +607,7 @@ |
194 | Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) | |
e684db95 AM |
195 | |
196 | Python/getplatform.o: $(srcdir)/Python/getplatform.c | |
e3852288 JB |
197 | - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c |
198 | + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c | |
e684db95 AM |
199 | |
200 | Python/importdl.o: $(srcdir)/Python/importdl.c | |
e3852288 | 201 | $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c |
d41c15c0 JB |
202 | diff -Nur Python-3.2.orig/Modules/getpath.c Python-3.2/Modules/getpath.c |
203 | --- Python-3.2.orig/Modules/getpath.c 2010-12-03 20:14:31.000000000 +0000 | |
75257062 | 204 | +++ Python-3.2/Modules/getpath.c 2011-05-21 21:16:30.000000000 +0100 |
e3852288 | 205 | @@ -121,9 +121,17 @@ |
e684db95 AM |
206 | #define EXEC_PREFIX PREFIX |
207 | #endif | |
208 | ||
209 | +#ifndef LIB_PYTHON | |
210 | +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__) | |
a1d9b939 | 211 | +#define LIB_PYTHON L"lib64/python" |
e684db95 | 212 | +#else |
a1d9b939 | 213 | +#define LIB_PYTHON L"lib/python" |
e684db95 AM |
214 | +#endif |
215 | +#endif | |
216 | + | |
217 | #ifndef PYTHONPATH | |
218 | -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ | |
219 | - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" | |
220 | +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \ | |
221 | + EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:" | |
222 | #endif | |
223 | ||
224 | #ifndef LANDMARK | |
e3852288 | 225 | @@ -134,7 +142,7 @@ |
04df829f | 226 | static wchar_t exec_prefix[MAXPATHLEN+1]; |
227 | static wchar_t progpath[MAXPATHLEN+1]; | |
228 | static wchar_t *module_search_path = NULL; | |
e3852288 JB |
229 | -static wchar_t *lib_python = L"lib/python" VERSION; |
230 | +static wchar_t *lib_python = LIB_PYTHON VERSION; | |
04df829f | 231 | |
e3852288 JB |
232 | static void |
233 | reduce(wchar_t *dir) | |
d41c15c0 JB |
234 | diff -Nur Python-3.2.orig/Python/getplatform.c Python-3.2/Python/getplatform.c |
235 | --- Python-3.2.orig/Python/getplatform.c 2000-09-02 00:29:29.000000000 +0100 | |
75257062 | 236 | +++ Python-3.2/Python/getplatform.c 2011-05-21 21:16:30.000000000 +0100 |
e684db95 AM |
237 | @@ -10,3 +10,23 @@ |
238 | { | |
239 | return PLATFORM; | |
240 | } | |
241 | + | |
242 | +#ifndef ARCH | |
243 | +#define ARCH "unknown" | |
244 | +#endif | |
245 | + | |
246 | +const char * | |
247 | +Py_GetArch(void) | |
248 | +{ | |
249 | + return ARCH; | |
250 | +} | |
251 | + | |
252 | +#ifndef LIB | |
253 | +#define LIB "lib" | |
254 | +#endif | |
255 | + | |
256 | +const char * | |
257 | +Py_GetLib(void) | |
258 | +{ | |
259 | + return LIB; | |
260 | +} | |
d41c15c0 JB |
261 | diff -Nur Python-3.2.orig/Python/sysmodule.c Python-3.2/Python/sysmodule.c |
262 | --- Python-3.2.orig/Python/sysmodule.c 2011-01-05 20:08:25.000000000 +0000 | |
75257062 | 263 | +++ Python-3.2/Python/sysmodule.c 2011-05-21 21:16:30.000000000 +0100 |
e3852288 JB |
264 | @@ -1608,6 +1608,10 @@ |
265 | PyUnicode_FromString(Py_GetCopyright())); | |
266 | SET_SYS_FROM_STRING("platform", | |
267 | PyUnicode_FromString(Py_GetPlatform())); | |
268 | + SET_SYS_FROM_STRING("arch", | |
269 | + PyUnicode_FromString(Py_GetArch())); | |
270 | + SET_SYS_FROM_STRING("lib", | |
271 | + PyUnicode_FromString(Py_GetLib())); | |
272 | SET_SYS_FROM_STRING("executable", | |
273 | PyUnicode_FromWideChar( | |
274 | Py_GetProgramFullPath(), -1)); | |
d41c15c0 JB |
275 | diff -Nur Python-3.2.orig/setup.py Python-3.2/setup.py |
276 | --- Python-3.2.orig/setup.py 2010-12-28 09:51:43.000000000 +0000 | |
75257062 | 277 | +++ Python-3.2/setup.py 2011-05-21 21:16:30.000000000 +0100 |
e3852288 JB |
278 | @@ -422,12 +422,12 @@ |
279 | add_dir_to_list(self.compiler.include_dirs, | |
280 | sysconfig.get_config_var("INCLUDEDIR")) | |
e684db95 AM |
281 | |
282 | + libname = sys.lib | |
283 | # lib_dirs and inc_dirs are used to search for files; | |
284 | # if a file is found in one of those directories, it can | |
285 | # be assumed that no additional -I,-L directives are needed. | |
286 | lib_dirs = self.compiler.library_dirs + [ | |
287 | - '/lib64', '/usr/lib64', | |
288 | - '/lib', '/usr/lib', | |
289 | + libname, '/usr/'+libname | |
290 | ] | |
291 | inc_dirs = self.compiler.include_dirs + ['/usr/include'] | |
292 | exts = [] | |
e3852288 JB |
293 | @@ -620,11 +620,11 @@ |
294 | elif curses_library: | |
295 | readline_libs.append(curses_library) | |
e684db95 | 296 | elif self.compiler.find_library_file(lib_dirs + |
e3852288 JB |
297 | - ['/usr/lib/termcap'], |
298 | + ['/usr/' + libname + '/termcap'], | |
299 | 'termcap'): | |
e684db95 AM |
300 | readline_libs.append('termcap') |
301 | exts.append( Extension('readline', ['readline.c'], | |
302 | - library_dirs=['/usr/lib/termcap'], | |
e3852288 | 303 | + library_dirs=['/usr/' + libname + '/termcap'], |
e684db95 AM |
304 | extra_link_args=readline_extra_link_args, |
305 | libraries=readline_libs) ) | |
e3852288 | 306 | else: |