]>
Commit | Line | Data |
---|---|---|
e684db95 AM |
1 | diff -Nur Python-2.5b2.orig/configure.in Python-2.5b2/configure.in |
2 | --- Python-2.5b2.orig/configure.in 2006-07-06 11:13:35.000000000 +0100 | |
3 | +++ Python-2.5b2/configure.in 2006-07-12 17:42:51.000000000 +0100 | |
4 | @@ -503,6 +503,41 @@ | |
5 | ;; | |
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) | |
46 | diff -Nur Python-2.5b2.orig/Include/pythonrun.h Python-2.5b2/Include/pythonrun.h | |
47 | --- Python-2.5b2.orig/Include/pythonrun.h 2006-04-03 07:26:32.000000000 +0100 | |
48 | +++ Python-2.5b2/Include/pythonrun.h 2006-07-12 17:42:51.000000000 +0100 | |
49 | @@ -107,6 +107,8 @@ | |
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); | |
e3852288 JB |
58 | --- Python-3.2/Lib/distutils/command/install.py.orig 2010-11-25 04:46:44.000000000 +0100 |
59 | +++ Python-3.2/Lib/distutils/command/install.py 2011-04-02 08:13:23.765733920 +0200 | |
60 | @@ -27,6 +27,8 @@ | |
61 | from site import USER_SITE | |
62 | HAS_USER_SITE = True | |
e684db95 AM |
63 | |
64 | +libname = sys.lib | |
65 | + | |
66 | if sys.version < "2.2": | |
67 | WINDOWS_SCHEME = { | |
68 | 'purelib': '$base', | |
e3852288 | 69 | @@ -47,14 +49,14 @@ |
e684db95 AM |
70 | INSTALL_SCHEMES = { |
71 | 'unix_prefix': { | |
72 | 'purelib': '$base/lib/python$py_version_short/site-packages', | |
73 | - 'platlib': '$platbase/lib/python$py_version_short/site-packages', | |
74 | + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', | |
e3852288 | 75 | 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', |
e684db95 AM |
76 | 'scripts': '$base/bin', |
77 | 'data' : '$base', | |
78 | }, | |
79 | 'unix_home': { | |
80 | 'purelib': '$base/lib/python', | |
81 | - 'platlib': '$base/lib/python', | |
82 | + 'platlib': '$base/'+libname+'/python', | |
83 | 'headers': '$base/include/python/$dist_name', | |
84 | 'scripts': '$base/bin', | |
85 | 'data' : '$base', | |
86 | diff -Nur Python-2.5b2.orig/Lib/distutils/sysconfig.py Python-2.5b2/Lib/distutils/sysconfig.py | |
87 | --- Python-2.5b2.orig/Lib/distutils/sysconfig.py 2006-06-27 11:08:25.000000000 +0100 | |
88 | +++ Python-2.5b2/Lib/distutils/sysconfig.py 2006-07-12 17:42:51.000000000 +0100 | |
89 | @@ -99,8 +99,12 @@ | |
90 | prefix = plat_specific and EXEC_PREFIX or PREFIX | |
91 | ||
92 | if os.name == "posix": | |
93 | + if plat_specific: | |
94 | + lib = sys.lib | |
95 | + else: | |
96 | + lib = 'lib' | |
97 | libpython = os.path.join(prefix, | |
98 | - "lib", "python" + get_python_version()) | |
99 | + lib, "python" + get_python_version()) | |
100 | if standard_lib: | |
101 | return libpython | |
102 | else: | |
103 | diff -Nur Python-2.5b2.orig/Lib/distutils/tests/test_install.py Python-2.5b2/Lib/distutils/tests/test_install.py | |
104 | --- Python-2.5b2.orig/Lib/distutils/tests/test_install.py 2004-06-26 00:02:59.000000000 +0100 | |
105 | +++ Python-2.5b2/Lib/distutils/tests/test_install.py 2006-07-12 17:42:51.000000000 +0100 | |
e684db95 AM |
106 | @@ -39,8 +39,9 @@ |
107 | self.assertEqual(got, expected) | |
108 | ||
109 | libdir = os.path.join(destination, "lib", "python") | |
110 | + platlibdir = os.path.join(destination, sys.lib, "python") | |
111 | check_path(cmd.install_lib, libdir) | |
112 | - check_path(cmd.install_platlib, libdir) | |
113 | + check_path(cmd.install_platlib, platlibdir) | |
114 | check_path(cmd.install_purelib, libdir) | |
115 | check_path(cmd.install_headers, | |
116 | os.path.join(destination, "include", "python", "foopkg")) | |
e3852288 JB |
117 | --- Python-3.2/Lib/site.py.orig 2010-12-26 20:54:29.000000000 +0100 |
118 | +++ Python-3.2/Lib/site.py 2011-04-02 08:16:21.341737273 +0200 | |
119 | @@ -285,13 +285,16 @@ | |
04df829f | 120 | if sys.platform in ('os2emx', 'riscos'): |
e3852288 | 121 | sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) |
04df829f | 122 | elif os.sep == '/': |
e3852288 JB |
123 | - sitepackages.append(os.path.join(prefix, "lib", |
124 | + sitepackages.append(os.path.join(prefix, sys.lib, | |
04df829f | 125 | "python" + sys.version[:3], |
126 | "site-packages")) | |
e3852288 JB |
127 | - sitepackages.append(os.path.join(prefix, "lib", "site-python")) |
128 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) | |
04df829f | 129 | + if sys.lib != 'lib': |
e3852288 JB |
130 | + sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages")) |
131 | + sitepackages.append(os.path.join(prefix, "lib", "site-python")) | |
04df829f | 132 | else: |
e3852288 JB |
133 | sitepackages.append(prefix) |
134 | - sitepackages.append(os.path.join(prefix, "lib", "site-packages")) | |
135 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) | |
04df829f | 136 | if sys.platform == "darwin": |
137 | # for framework builds *only* we add the standard Apple | |
e3852288 JB |
138 | # locations. |
139 | --- Python-3.2/Makefile.pre.in.orig 2011-02-19 09:47:14.000000000 +0100 | |
140 | +++ Python-3.2/Makefile.pre.in 2011-04-02 08:17:59.357737273 +0200 | |
141 | @@ -86,6 +86,8 @@ | |
e684db95 AM |
142 | |
143 | # Machine-dependent subdirectories | |
144 | MACHDEP= @MACHDEP@ | |
145 | +LIB= @LIB@ | |
146 | +ARCH= @ARCH@ | |
147 | ||
148 | # Install prefix for architecture-independent files | |
149 | prefix= @prefix@ | |
e3852288 | 150 | @@ -102,7 +104,7 @@ |
e684db95 AM |
151 | MANDIR= @mandir@ |
152 | INCLUDEDIR= @includedir@ | |
153 | CONFINCLUDEDIR= $(exec_prefix)/include | |
154 | -SCRIPTDIR= $(prefix)/lib | |
155 | +SCRIPTDIR= $(prefix)/$(LIB) | |
e3852288 | 156 | ABIFLAGS= @ABIFLAGS@ |
e684db95 AM |
157 | |
158 | # Detailed destination directories | |
e3852288 JB |
159 | @@ -605,7 +607,7 @@ |
160 | Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) | |
e684db95 AM |
161 | |
162 | Python/getplatform.o: $(srcdir)/Python/getplatform.c | |
e3852288 JB |
163 | - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c |
164 | + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c | |
e684db95 AM |
165 | |
166 | Python/importdl.o: $(srcdir)/Python/importdl.c | |
e3852288 JB |
167 | $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c |
168 | --- Python-3.2/Modules/getpath.c.orig 2010-12-03 21:14:31.000000000 +0100 | |
169 | +++ Python-3.2/Modules/getpath.c 2011-04-02 08:18:39.573738111 +0200 | |
170 | @@ -121,9 +121,17 @@ | |
e684db95 AM |
171 | #define EXEC_PREFIX PREFIX |
172 | #endif | |
173 | ||
174 | +#ifndef LIB_PYTHON | |
175 | +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__) | |
a1d9b939 | 176 | +#define LIB_PYTHON L"lib64/python" |
e684db95 | 177 | +#else |
a1d9b939 | 178 | +#define LIB_PYTHON L"lib/python" |
e684db95 AM |
179 | +#endif |
180 | +#endif | |
181 | + | |
182 | #ifndef PYTHONPATH | |
183 | -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ | |
184 | - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" | |
185 | +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \ | |
186 | + EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:" | |
187 | #endif | |
188 | ||
189 | #ifndef LANDMARK | |
e3852288 | 190 | @@ -134,7 +142,7 @@ |
04df829f | 191 | static wchar_t exec_prefix[MAXPATHLEN+1]; |
192 | static wchar_t progpath[MAXPATHLEN+1]; | |
193 | static wchar_t *module_search_path = NULL; | |
e3852288 JB |
194 | -static wchar_t *lib_python = L"lib/python" VERSION; |
195 | +static wchar_t *lib_python = LIB_PYTHON VERSION; | |
04df829f | 196 | |
e3852288 JB |
197 | static void |
198 | reduce(wchar_t *dir) | |
e684db95 AM |
199 | diff -Nur Python-2.5b2.orig/Python/getplatform.c Python-2.5b2/Python/getplatform.c |
200 | --- Python-2.5b2.orig/Python/getplatform.c 2000-09-02 00:29:29.000000000 +0100 | |
201 | +++ Python-2.5b2/Python/getplatform.c 2006-07-12 17:42:51.000000000 +0100 | |
202 | @@ -10,3 +10,23 @@ | |
203 | { | |
204 | return PLATFORM; | |
205 | } | |
206 | + | |
207 | +#ifndef ARCH | |
208 | +#define ARCH "unknown" | |
209 | +#endif | |
210 | + | |
211 | +const char * | |
212 | +Py_GetArch(void) | |
213 | +{ | |
214 | + return ARCH; | |
215 | +} | |
216 | + | |
217 | +#ifndef LIB | |
218 | +#define LIB "lib" | |
219 | +#endif | |
220 | + | |
221 | +const char * | |
222 | +Py_GetLib(void) | |
223 | +{ | |
224 | + return LIB; | |
225 | +} | |
e3852288 JB |
226 | --- Python-3.2/Python/sysmodule.c.orig 2011-01-05 21:08:25.000000000 +0100 |
227 | +++ Python-3.2/Python/sysmodule.c 2011-04-02 08:20:16.773734758 +0200 | |
228 | @@ -1608,6 +1608,10 @@ | |
229 | PyUnicode_FromString(Py_GetCopyright())); | |
230 | SET_SYS_FROM_STRING("platform", | |
231 | PyUnicode_FromString(Py_GetPlatform())); | |
232 | + SET_SYS_FROM_STRING("arch", | |
233 | + PyUnicode_FromString(Py_GetArch())); | |
234 | + SET_SYS_FROM_STRING("lib", | |
235 | + PyUnicode_FromString(Py_GetLib())); | |
236 | SET_SYS_FROM_STRING("executable", | |
237 | PyUnicode_FromWideChar( | |
238 | Py_GetProgramFullPath(), -1)); | |
239 | --- Python-3.2/setup.py.orig 2010-12-28 10:51:43.000000000 +0100 | |
240 | +++ Python-3.2/setup.py 2011-04-02 08:21:49.597738949 +0200 | |
241 | @@ -422,12 +422,12 @@ | |
242 | add_dir_to_list(self.compiler.include_dirs, | |
243 | sysconfig.get_config_var("INCLUDEDIR")) | |
e684db95 AM |
244 | |
245 | + libname = sys.lib | |
246 | # lib_dirs and inc_dirs are used to search for files; | |
247 | # if a file is found in one of those directories, it can | |
248 | # be assumed that no additional -I,-L directives are needed. | |
249 | lib_dirs = self.compiler.library_dirs + [ | |
250 | - '/lib64', '/usr/lib64', | |
251 | - '/lib', '/usr/lib', | |
252 | + libname, '/usr/'+libname | |
253 | ] | |
254 | inc_dirs = self.compiler.include_dirs + ['/usr/include'] | |
255 | exts = [] | |
e3852288 JB |
256 | @@ -620,11 +620,11 @@ |
257 | elif curses_library: | |
258 | readline_libs.append(curses_library) | |
e684db95 | 259 | elif self.compiler.find_library_file(lib_dirs + |
e3852288 JB |
260 | - ['/usr/lib/termcap'], |
261 | + ['/usr/' + libname + '/termcap'], | |
262 | 'termcap'): | |
e684db95 AM |
263 | readline_libs.append('termcap') |
264 | exts.append( Extension('readline', ['readline.c'], | |
265 | - library_dirs=['/usr/lib/termcap'], | |
e3852288 | 266 | + library_dirs=['/usr/' + libname + '/termcap'], |
e684db95 AM |
267 | extra_link_args=readline_extra_link_args, |
268 | libraries=readline_libs) ) | |
e3852288 | 269 | else: |