1 diff -Naur --exclude=CVS Python-2.4.4/configure.in Python-2.4.4-patched/configure.in
2 --- Python-2.4.4/configure.in 2006-10-17 20:03:36.000000000 +0400
3 +++ Python-2.4.4-patched/configure.in 2007-04-23 19:31:52.000000000 +0400
18 +case $ac_sys_system in
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
26 + python_cv_cc_64bit_output=yes
34 +case $ARCH:$python_cv_cc_64bit_output in
35 +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
45 AC_MSG_CHECKING(LIBRARY)
46 diff -Naur --exclude=CVS Python-2.4.4/Include/pythonrun.h Python-2.4.4-patched/Include/pythonrun.h
47 --- Python-2.4.4/Include/pythonrun.h 2004-10-07 07:58:07.000000000 +0400
48 +++ Python-2.4.4-patched/Include/pythonrun.h 2007-04-23 19:10:18.000000000 +0400
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);
58 diff -Naur --exclude=CVS Python-2.4.4/Lib/distutils/command/install.py Python-2.4.4-patched/Lib/distutils/command/install.py
59 --- Python-2.4.4/Lib/distutils/command/install.py 2005-01-20 22:15:39.000000000 +0300
60 +++ Python-2.4.4-patched/Lib/distutils/command/install.py 2007-04-23 19:12:27.000000000 +0400
62 from distutils.errors import DistutilsOptionError
67 if sys.version < "2.2":
74 - 'purelib': '$base/lib/python$py_version_short/site-packages',
75 - 'platlib': '$platbase/lib/python$py_version_short/site-packages',
76 + 'purelib': '$base/'+libname+'/python$py_version_short/site-packages',
77 + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
78 'headers': '$base/include/python$py_version_short/$dist_name',
79 'scripts': '$base/bin',
83 - 'purelib': '$base/lib/python',
84 - 'platlib': '$base/lib/python',
85 + 'purelib': '$base/'+libname+'/python',
86 + 'platlib': '$base/'+libname+'/python',
87 'headers': '$base/include/python/$dist_name',
88 'scripts': '$base/bin',
90 diff -Naur --exclude=CVS Python-2.4.4/Lib/distutils/sysconfig.py Python-2.4.4-patched/Lib/distutils/sysconfig.py
91 --- Python-2.4.4/Lib/distutils/sysconfig.py 2006-10-08 21:41:25.000000000 +0400
92 +++ Python-2.4.4-patched/Lib/distutils/sysconfig.py 2007-04-23 19:21:19.000000000 +0400
95 if os.name == "posix":
96 libpython = os.path.join(prefix,
97 - "lib", "python" + get_python_version())
98 + sys.lib, "python" + get_python_version())
102 diff -Naur --exclude=CVS Python-2.4.4/Lib/distutils/tests/test_install.py Python-2.4.4-patched/Lib/distutils/tests/test_install.py
103 --- Python-2.4.4/Lib/distutils/tests/test_install.py 2004-06-26 03:02:59.000000000 +0400
104 +++ Python-2.4.4-patched/Lib/distutils/tests/test_install.py 2007-04-23 19:20:24.000000000 +0400
106 """Tests for distutils.command.install."""
112 from distutils.command.install import install
114 expected = os.path.normpath(expected)
115 self.assertEqual(got, expected)
117 - libdir = os.path.join(destination, "lib", "python")
118 + libdir = os.path.join(destination, sys.lib, "python")
119 check_path(cmd.install_lib, libdir)
120 check_path(cmd.install_platlib, libdir)
121 check_path(cmd.install_purelib, libdir)
122 diff -Naur --exclude=CVS Python-2.4.4/Lib/site.py Python-2.4.4-patched/Lib/site.py
123 --- Python-2.4.4/Lib/site.py 2004-07-20 06:28:28.000000000 +0400
124 +++ Python-2.4.4-patched/Lib/site.py 2007-04-23 19:23:19.000000000 +0400
125 @@ -179,12 +179,18 @@
126 sitedirs = [os.path.join(prefix, "Lib", "site-packages")]
128 sitedirs = [os.path.join(prefix,
131 "python" + sys.version[:3],
133 - os.path.join(prefix, "lib", "site-python")]
134 + os.path.join(prefix, sys.lib, "site-python")]
135 + if sys.lib != 'lib':
136 + sitedirs.append(os.path.join(prefix,
138 + "python" + sys.version[:3],
140 + sitedirs.append(os.path.join(prefix, 'lib', "site-python"))
142 - sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
143 + sitedirs = [prefix, os.path.join(prefix, sys.lib, "site-packages")]
144 if sys.platform == 'darwin':
145 # for framework builds *only* we add the standard Apple
146 # locations. Currently only per-user, but /Library and
147 diff -Naur --exclude=CVS Python-2.4.4/Makefile.pre.in Python-2.4.4-patched/Makefile.pre.in
148 --- Python-2.4.4/Makefile.pre.in 2006-10-08 21:41:25.000000000 +0400
149 +++ Python-2.4.4-patched/Makefile.pre.in 2007-04-23 19:34:43.000000000 +0400
152 # Machine-dependent subdirectories
157 # Install prefix for architecture-independent files
161 # Expanded directories
162 BINDIR= $(exec_prefix)/bin
163 -LIBDIR= $(exec_prefix)/lib
164 +LIBDIR= $(exec_prefix)/$(LIB)
166 INCLUDEDIR= @includedir@
167 CONFINCLUDEDIR= $(exec_prefix)/include
168 -SCRIPTDIR= $(prefix)/lib
169 +SCRIPTDIR= $(prefix)/$(LIB)
171 # Detailed destination directories
172 BINLIBDEST= $(LIBDIR)/python$(VERSION)
174 Python/compile.o Python/symtable.o: $(GRAMMAR_H)
176 Python/getplatform.o: $(srcdir)/Python/getplatform.c
177 - $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
178 + $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
180 Python/importdl.o: $(srcdir)/Python/importdl.c
181 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
182 diff -Naur --exclude=CVS Python-2.4.4/Modules/getpath.c Python-2.4.4-patched/Modules/getpath.c
183 --- Python-2.4.4/Modules/getpath.c 2006-02-20 20:37:39.000000000 +0300
184 +++ Python-2.4.4-patched/Modules/getpath.c 2007-04-23 19:25:34.000000000 +0400
186 #define EXEC_PREFIX PREFIX
190 +#if defined(__x86_64__)
191 +#define LIB_PYTHON "lib64/python" VERSION
193 +#define LIB_PYTHON "lib/python" VERSION
198 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
199 - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
200 +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
201 + EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
206 static char exec_prefix[MAXPATHLEN+1];
207 static char progpath[MAXPATHLEN+1];
208 static char *module_search_path = NULL;
209 -static char lib_python[] = "lib/python" VERSION;
210 +static char lib_python[] = LIB_PYTHON;
214 diff -Naur --exclude=CVS Python-2.4.4/Python/getplatform.c Python-2.4.4-patched/Python/getplatform.c
215 --- Python-2.4.4/Python/getplatform.c 2000-09-02 03:29:29.000000000 +0400
216 +++ Python-2.4.4-patched/Python/getplatform.c 2007-04-23 19:27:19.000000000 +0400
223 +#define ARCH "unknown"
241 diff -Naur --exclude=CVS Python-2.4.4/Python/sysmodule.c Python-2.4.4-patched/Python/sysmodule.c
242 --- Python-2.4.4/Python/sysmodule.c 2006-10-05 22:08:58.000000000 +0400
243 +++ Python-2.4.4-patched/Python/sysmodule.c 2007-04-23 19:29:43.000000000 +0400
244 @@ -1035,6 +1035,10 @@
245 PyString_FromString(Py_GetCopyright()));
246 SET_SYS_FROM_STRING("platform",
247 PyString_FromString(Py_GetPlatform()));
248 + SET_SYS_FROM_STRING("arch",
249 + PyString_FromString(Py_GetArch()));
250 + SET_SYS_FROM_STRING("lib",
251 + PyString_FromString(Py_GetLib()));
252 SET_SYS_FROM_STRING("executable",
253 PyString_FromString(Py_GetProgramFullPath()));
254 SET_SYS_FROM_STRING("prefix",
255 diff -Naur --exclude=CVS Python-2.4.4/setup.py Python-2.4.4-patched/setup.py
256 --- Python-2.4.4/setup.py 2006-10-08 21:41:25.000000000 +0400
257 +++ Python-2.4.4-patched/setup.py 2007-04-23 19:38:02.000000000 +0400
258 @@ -263,12 +263,12 @@
263 # lib_dirs and inc_dirs are used to search for files;
264 # if a file is found in one of those directories, it can
265 # be assumed that no additional -I,-L directives are needed.
266 lib_dirs = self.compiler.library_dirs + [
267 - '/lib64', '/usr/lib64',
268 - '/lib', '/usr/lib',
269 + libname, '/usr/'+libname
271 inc_dirs = self.compiler.include_dirs + ['/usr/include']
274 elif self.compiler.find_library_file(lib_dirs, 'curses'):
275 readline_libs.append('curses')
276 elif self.compiler.find_library_file(lib_dirs +
277 - ['/usr/lib/termcap'],
278 + ['/usr/'+libname+'/termcap'],
280 readline_libs.append('termcap')
283 readline_extra_link_args = ()
285 exts.append( Extension('readline', ['readline.c'],
286 - library_dirs=['/usr/lib/termcap'],
287 + library_dirs=['/usr/'+libname+'/termcap'],
288 extra_link_args=readline_extra_link_args,
289 libraries=readline_libs) )
290 if platform not in ['mac']:
291 @@ -1069,8 +1069,8 @@
292 added_lib_dirs.append('/usr/openwin/lib')
293 elif os.path.exists('/usr/X11R6/include'):
294 include_dirs.append('/usr/X11R6/include')
295 - added_lib_dirs.append('/usr/X11R6/lib64')
296 - added_lib_dirs.append('/usr/X11R6/lib')
297 + added_lib_dirs.append('/usr/X11R6/'+sys.lib)
298 + #added_lib_dirs.append('/usr/X11R6/lib')
299 elif os.path.exists('/usr/X11R5/include'):
300 include_dirs.append('/usr/X11R5/include')
301 added_lib_dirs.append('/usr/X11R5/lib')