]> SALOME platform Git repositories - tools/install.git/blob - config_files/patches/Python-2.4.1-lib64.patch
Salome HOME
Add RANDOMIZER and SIERPINSKY modules.
[tools/install.git] / config_files / patches / Python-2.4.1-lib64.patch
1 --- Python-2.4.1/Include/pythonrun.h.lib64      2005-08-25 14:19:42.000000000 +0200
2 +++ Python-2.4.1/Include/pythonrun.h    2005-08-25 14:19:39.000000000 +0200
3 @@ -93,6 +93,8 @@
4  /* In their own files */
5  PyAPI_FUNC(const char *) Py_GetVersion(void);
6  PyAPI_FUNC(const char *) Py_GetPlatform(void);
7 +PyAPI_FUNC(const char *) Py_GetArch(void);
8 +PyAPI_FUNC(const char *) Py_GetLib(void);
9  PyAPI_FUNC(const char *) Py_GetCopyright(void);
10  PyAPI_FUNC(const char *) Py_GetCompiler(void);
11  PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
12 --- Python-2.4.1/Lib/distutils/command/install.py.lib64 2005-08-25 14:20:10.000000000 +0200
13 +++ Python-2.4.1/Lib/distutils/command/install.py       2005-08-25 14:20:09.000000000 +0200
14 @@ -19,6 +19,8 @@
15  from distutils.errors import DistutilsOptionError
16  from glob import glob
17  
18 +libname = sys.lib
19 +
20  if sys.version < "2.2":
21      WINDOWS_SCHEME = {
22          'purelib': '$base',
23 @@ -38,15 +40,15 @@
24  
25  INSTALL_SCHEMES = {
26      'unix_prefix': {
27 -        'purelib': '$base/lib/python$py_version_short/site-packages',
28 -        'platlib': '$platbase/lib/python$py_version_short/site-packages',
29 +        'purelib': '$base/'+libname+'/python$py_version_short/site-packages',
30 +        'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
31          'headers': '$base/include/python$py_version_short/$dist_name',
32          'scripts': '$base/bin',
33          'data'   : '$base',
34          },
35      'unix_home': {
36 -        'purelib': '$base/lib/python',
37 -        'platlib': '$base/lib/python',
38 +        'purelib': '$base/'+libname+'/python',
39 +        'platlib': '$base/'+libname+'/python',
40          'headers': '$base/include/python/$dist_name',
41          'scripts': '$base/bin',
42          'data'   : '$base',
43 --- Python-2.4.1/Lib/distutils/tests/test_install.py.lib64      2005-08-25 14:20:13.000000000 +0200
44 +++ Python-2.4.1/Lib/distutils/tests/test_install.py    2005-08-25 14:20:13.000000000 +0200
45 @@ -1,6 +1,7 @@
46  """Tests for distutils.command.install."""
47  
48  import os
49 +import sys
50  import unittest
51  
52  from distutils.command.install import install
53 @@ -38,7 +39,7 @@
54              expected = os.path.normpath(expected)
55              self.assertEqual(got, expected)
56  
57 -        libdir = os.path.join(destination, "lib", "python")
58 +        libdir = os.path.join(destination, sys.lib, "python")
59          check_path(cmd.install_lib, libdir)
60          check_path(cmd.install_platlib, libdir)
61          check_path(cmd.install_purelib, libdir)
62 --- Python-2.4.1/Lib/distutils/sysconfig.py.lib64       2005-08-25 14:20:13.000000000 +0200
63 +++ Python-2.4.1/Lib/distutils/sysconfig.py     2005-08-25 14:20:12.000000000 +0200
64 @@ -100,7 +100,7 @@
65  
66      if os.name == "posix":
67          libpython = os.path.join(prefix,
68 -                                 "lib", "python" + get_python_version())
69 +                                 sys.lib, "python" + get_python_version())
70          if standard_lib:
71              return libpython
72          else:
73 --- Python-2.4.1/Lib/site.py.lib64      2005-08-25 14:21:50.000000000 +0200
74 +++ Python-2.4.1/Lib/site.py    2005-08-25 14:55:33.000000000 +0200
75 @@ -179,12 +179,18 @@
76                  sitedirs = [os.path.join(prefix, "Lib", "site-packages")]
77              elif os.sep == '/':
78                  sitedirs = [os.path.join(prefix,
79 -                                         "lib",
80 +                                         sys.lib,
81                                           "python" + sys.version[:3],
82                                           "site-packages"),
83 -                            os.path.join(prefix, "lib", "site-python")]
84 +                            os.path.join(prefix, sys.lib, "site-python")]
85 +                if sys.lib != 'lib':
86 +                    sitedirs.append(os.path.join(prefix,
87 +                                                 'lib',
88 +                                                 "python" + sys.version[:3],
89 +                                                 "site-packages"))
90 +                    sitedirs.append(os.path.join(prefix, 'lib', "site-python"))
91              else:
92 -                sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
93 +                sitedirs = [prefix, os.path.join(prefix, sys.lib, "site-packages")]
94              if sys.platform == 'darwin':
95                  # for framework builds *only* we add the standard Apple
96                  # locations. Currently only per-user, but /Library and
97 --- Python-2.4.1/Modules/getpath.c.lib64        2005-08-25 14:23:20.000000000 +0200
98 +++ Python-2.4.1/Modules/getpath.c      2005-08-25 14:23:06.000000000 +0200
99 @@ -111,9 +111,17 @@
100  #define EXEC_PREFIX PREFIX
101  #endif
102  
103 +#ifndef LIB_PYTHON
104 +#if defined(__x86_64__)
105 +#define LIB_PYTHON "lib64/python" VERSION
106 +#else
107 +#define LIB_PYTHON "lib/python" VERSION
108 +#endif
109 +#endif
110 +
111  #ifndef PYTHONPATH
112 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
113 -              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
114 +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
115 +              EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
116  #endif
117  
118  #ifndef LANDMARK
119 @@ -124,7 +132,7 @@
120  static char exec_prefix[MAXPATHLEN+1];
121  static char progpath[MAXPATHLEN+1];
122  static char *module_search_path = NULL;
123 -static char lib_python[] = "lib/python" VERSION;
124 +static char lib_python[] = LIB_PYTHON;
125  
126  static void
127  reduce(char *dir)
128 --- Python-2.4.1/Python/getplatform.c.lib64     2005-08-25 14:23:53.000000000 +0200
129 +++ Python-2.4.1/Python/getplatform.c   2005-08-25 14:23:47.000000000 +0200
130 @@ -10,3 +10,23 @@
131  {
132         return PLATFORM;
133  }
134 +
135 +#ifndef ARCH
136 +#define ARCH "unknown"
137 +#endif
138 +
139 +const char *
140 +Py_GetArch(void)
141 +{
142 +       return ARCH;
143 +}
144 +
145 +#ifndef LIB
146 +#define LIB "lib"
147 +#endif
148 +
149 +const char *
150 +Py_GetLib(void)
151 +{
152 +       return LIB;
153 +}
154 --- Python-2.4.1/Python/sysmodule.c.lib64       2005-08-25 14:23:53.000000000 +0200
155 +++ Python-2.4.1/Python/sysmodule.c     2005-08-25 14:23:52.000000000 +0200
156 @@ -1022,6 +1022,12 @@
157         PyDict_SetItemString(sysdict, "platform",
158                              v = PyString_FromString(Py_GetPlatform()));
159         Py_XDECREF(v);
160 +       PyDict_SetItemString(sysdict, "arch",
161 +                            v = PyString_FromString(Py_GetArch()));
162 +       Py_XDECREF(v);
163 +       PyDict_SetItemString(sysdict, "lib",
164 +                            v = PyString_FromString(Py_GetLib()));
165 +       Py_XDECREF(v);
166         PyDict_SetItemString(sysdict, "executable",
167                              v = PyString_FromString(Py_GetProgramFullPath()));
168         Py_XDECREF(v);
169 --- Python-2.4.1/configure.in.lib64     2005-08-25 14:24:33.000000000 +0200
170 +++ Python-2.4.1/configure.in   2005-08-25 14:19:07.000000000 +0200
171 @@ -423,6 +423,41 @@
172      ;;
173  esac
174  
175 +AC_SUBST(ARCH)
176 +AC_MSG_CHECKING(ARCH)
177 +ARCH=`uname -m`
178 +case $ARCH in
179 +i?86) ARCH=i386;;
180 +esac
181 +AC_MSG_RESULT($ARCH)
182 +
183 +AC_SUBST(LIB)
184 +AC_MSG_CHECKING(LIB)
185 +case $ac_sys_system in
186 +Linux*)
187 +  # Test if the compiler is 64bit
188 +  echo 'int i;' > conftest.$ac_ext
189 +  python_cv_cc_64bit_output=no
190 +  if AC_TRY_EVAL(ac_compile); then
191 +    case `/usr/bin/file conftest.$ac_objext` in
192 +    *"ELF 64"*)
193 +      python_cv_cc_64bit_output=yes
194 +      ;;
195 +    esac
196 +  fi
197 +  rm -rf conftest*
198 +  ;;
199 +esac
200 +
201 +case $ARCH:$python_cv_cc_64bit_output in
202 +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
203 +  LIB="lib64"
204 +  ;;
205 +*:*)
206 +  LIB="lib"
207 +  ;;
208 +esac
209 +AC_MSG_RESULT($LIB)
210  
211  AC_SUBST(LIBRARY)
212  AC_MSG_CHECKING(LIBRARY)
213 --- Python-2.4.1/Makefile.pre.in.lib64  2005-08-25 14:24:35.000000000 +0200
214 +++ Python-2.4.1/Makefile.pre.in        2005-08-25 14:19:06.000000000 +0200
215 @@ -70,6 +70,8 @@
216  
217  # Machine-dependent subdirectories
218  MACHDEP=       @MACHDEP@
219 +LIB=           @LIB@
220 +ARCH=          @ARCH@
221  
222  # Install prefix for architecture-independent files
223  prefix=                @prefix@
224 @@ -79,11 +81,11 @@
225  
226  # Expanded directories
227  BINDIR=                $(exec_prefix)/bin
228 -LIBDIR=                $(exec_prefix)/lib
229 +LIBDIR=                $(exec_prefix)/$(LIB)
230  MANDIR=                @mandir@
231  INCLUDEDIR=    @includedir@
232  CONFINCLUDEDIR=        $(exec_prefix)/include
233 -SCRIPTDIR=     $(prefix)/lib
234 +SCRIPTDIR=     $(prefix)/$(LIB)
235  
236  # Detailed destination directories
237  BINLIBDEST=    $(LIBDIR)/python$(VERSION)
238 @@ -458,7 +460,7 @@
239  Python/compile.o Python/symtable.o: $(GRAMMAR_H)
240  
241  Python/getplatform.o: $(srcdir)/Python/getplatform.c
242 -               $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
243 +               $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
244  
245  Python/importdl.o: $(srcdir)/Python/importdl.c
246                 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
247 --- Python-2.4.1/setup.py.lib64 2005-08-25 14:24:35.000000000 +0200
248 +++ Python-2.4.1/setup.py       2005-08-25 14:19:07.000000000 +0200
249 @@ -259,12 +259,12 @@
250          except NameError:
251              have_unicode = 0
252  
253 +        libname = sys.lib
254          # lib_dirs and inc_dirs are used to search for files;
255          # if a file is found in one of those directories, it can
256          # be assumed that no additional -I,-L directives are needed.
257          lib_dirs = self.compiler.library_dirs + [
258 -            '/lib64', '/usr/lib64',
259 -            '/lib', '/usr/lib',
260 +            libname, '/usr/'+libname
261              ]
262          inc_dirs = self.compiler.include_dirs + ['/usr/include']
263          exts = []
264 @@ -426,11 +426,11 @@
265              elif self.compiler.find_library_file(lib_dirs, 'curses'):
266                  readline_libs.append('curses')
267              elif self.compiler.find_library_file(lib_dirs +
268 -                                               ['/usr/lib/termcap'],
269 +                                               ['/usr/'+libname+'/termcap'],
270                                                 'termcap'):
271                  readline_libs.append('termcap')
272              exts.append( Extension('readline', ['readline.c'],
273 -                                   library_dirs=['/usr/lib/termcap'],
274 +                                   library_dirs=['/usr/'+libname+'/termcap'],
275                                     libraries=readline_libs) )
276          if platform not in ['mac']:
277              # crypt module.
278 @@ -1017,8 +1017,8 @@
279              added_lib_dirs.append('/usr/openwin/lib')
280          elif os.path.exists('/usr/X11R6/include'):
281              include_dirs.append('/usr/X11R6/include')
282 -            added_lib_dirs.append('/usr/X11R6/lib64')
283 -            added_lib_dirs.append('/usr/X11R6/lib')
284 +            added_lib_dirs.append('/usr/X11R6/'+sys.lib)
285 +            #added_lib_dirs.append('/usr/X11R6/lib')
286          elif os.path.exists('/usr/X11R5/include'):
287              include_dirs.append('/usr/X11R5/include')
288              added_lib_dirs.append('/usr/X11R5/lib')