--- Python-2.4.4/Python/import.c.patch05 2006-10-05 14:08:58.000000000 -0400
+++ Python-2.4.4/Python/import.c 2006-11-04 20:49:28.497670000 -0500
@@ -708,7 +707,8 @@
pyc_mtime = PyMarshal_ReadLongFromFile(fp);
if (pyc_mtime != mtime) {
if (Py_VerboseFlag)
- PySys_WriteStderr("# %s has bad mtime\n", cpathname);
+ PySys_WriteStderr("# %s has bad mtime %lu vs %lu\n",
+cpathname, mtime, pyc_mtime);
fclose(fp);
return NULL;
}
@@ -1068,6 +1069,57 @@
static int find_init_module(char *); /* Forward */
static struct filedescr importhookdescr = {"", "", IMP_HOOK};
+#ifdef HAVE_STAT
+static char *
+insert_64dir(char *buf, size_t buflen)
+{
+ char *base;
+ char *cp;
+ size_t blen;
+
+ if ((blen = strlen(buf)) == 0)
+ return (NULL);
+
+ cp = &buf[blen - 1];
+ while (cp != buf && *cp != SEP)
+ cp--;
+
+ if (cp != buf)
+ cp++;
+
+ if (blen + strlen("64/") + 1 >= buflen)
+ return NULL;
+
+ base = strdup(cp);
+ sprintf(cp, "64%c%s", SEP, base);
+ free(base);
+
+ return buf;
+}
+
+/*
+ * If we're on a 64-bit platform, modify lookups for shared object files.
+ */
+static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen)
+{
+ struct stat statbuf;
+
+ if (sizeof(void *) != 8)
+ return 0;
+
+ if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
+ return 0;
+
+ if (fdp->type != C_EXTENSION)
+ return 0;
+
+ if (insert_64dir(buf, buflen) == NULL)
+ return 0;
+
+ return strlen("64/");
+}
+#endif
+
static struct filedescr *
find_module(char *fullname, char *subname, PyObject *path, char *buf,
size_t buflen, FILE **p_fp, PyObject **p_loader)
@@ -1085,11 +1137,10 @@
static struct filedescr fd_builtin = {"", "", C_BUILTIN};
static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
char name[MAXPATHLEN+1];
-#if defined(PYOS_OS2)
size_t saved_len;
size_t saved_namelen;
char *saved_buf = NULL;
-#endif
+
if (p_loader != NULL)
*p_loader = NULL;
@@ -1281,15 +1332,19 @@
}
#endif
#endif
-#if defined(PYOS_OS2)
+
/* take a snapshot of the module spec for restoration
* after the 8 character DLL hackery
*/
saved_buf = strdup(buf);
saved_len = len;
saved_namelen = namelen;
-#endif /* PYOS_OS2 */
+
for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
+#ifdef HAVE_STAT
+ len += modify_path(fdp, buf, buflen);
+#endif
+
#if defined(PYOS_OS2)
/* OS/2 limits DLLs to 8 character names (w/o
extension)
@@ -1330,21 +1385,18 @@
fp = NULL;
}
}
-#if defined(PYOS_OS2)
+
/* restore the saved snapshot */
strcpy(buf, saved_buf);
len = saved_len;
namelen = saved_namelen;
-#endif
}
-#if defined(PYOS_OS2)
/* don't need/want the module name snapshot anymore */
if (saved_buf)
{
free(saved_buf);
saved_buf = NULL;
}
-#endif
Py_XDECREF(copy);
if (fp != NULL)
break;
--- Python-2.4.4/Python/importdl.h.patch05 2002-12-30 17:08:05.000000000 -0500
+++ Python-2.4.4/Python/importdl.h 2006-11-04 20:49:28.500505000 -0500
@@ -31,8 +31,9 @@
extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
FILE *);
-/* Max length of module suffix searched for -- accommodates "module.slb" */
-#define MAXSUFFIXSIZE 12
+/* Max length of module suffix searched for -- accommodates "module.slb"
+ and "64/" */
+#define MAXSUFFIXSIZE 15
#ifdef MS_WINDOWS
#include <windows.h>
--- Python-2.4.4/Lib/distutils/command/build_ext.py.patch05 2004-11-10 17:23:15.000000000 -0500
+++ Python-2.4.4/Lib/distutils/command/build_ext.py 2006-11-04 20:49:28.499417000 -0500
@@ -614,7 +614,13 @@
so_ext = get_config_var('SO')
if os.name == 'nt' and self.debug:
return apply(os.path.join, ext_path) + '_d' + so_ext
- return apply(os.path.join, ext_path) + so_ext
+ # .so extensions are word-size specific
+ path = apply(os.path.join, ext_path)
+ if sys.maxint == 2147483647L:
+ return path + so_ext
+ dirname = os.path.dirname(path);
+ basename = os.path.basename(path);
+ return os.path.join(dirname, "64", basename + so_ext)
def get_export_symbols (self, ext):
"""Return the list of symbols that a shared extension has to
--- Python-2.4.4/configure.in.patch05 2006-10-17 12:03:36.000000000 -0400
+++ Python-2.4.4/configure.in 2006-11-04 21:00:54.845972000 -0500
@@ -14,8 +14,36 @@
AH_TOP([
#ifndef Py_PYCONFIG_H
#define Py_PYCONFIG_H
+
])
AH_BOTTOM([
+
+#include <sys/isa_defs.h>
+
+/*
+ * Python originally defined these statically, which prevents a 32-64 python
+ * from working at all.
+ */
+
+#define SIZEOF_SHORT 2
+#define SIZEOF_INT 4
+#define SIZEOF_LONG_LONG 8
+#define SIZEOF_FPOS_T 8
+#define SIZEOF_OFF_T 8
+#define SIZEOF_PTHREAD_T 4
+
+#ifdef _LP64
+#define SIZEOF_LONG 8
+#define SIZEOF_UINTPTR_T 8
+#define SIZEOF_VOID_P 8
+#define SIZEOF_TIME_T 8
+#else
+#define SIZEOF_LONG 4
+#define SIZEOF_UINTPTR_T 4
+#define SIZEOF_VOID_P 4
+#define SIZEOF_TIME_T 4
+#endif
+
/* Define the macros needed if on a UnixWare 7.x system. */
#if defined(__USLC__) && defined(__SCO_VERSION__)
#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
@@ -56,6 +84,26 @@
define_xopen_source=yes
+# AC_CHECK_SIZEOF without the AC_DEFINE_UNQUOTED
+AC_DEFUN([PY_CHECK_SIZEOF],
+[AS_LITERAL_IF([$1], [],
+ [AC_FATAL([$0: requires literal arguments])])dnl
+AC_CHECK_TYPE([$1], [], [], [$3])
+AC_CACHE_CHECK([size of $1], AS_TR_SH([ac_cv_sizeof_$1]),
+[if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
+ # The cast to unsigned long works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+ # This bug is HP SR number 8606223364.
+ _AC_COMPUTE_INT([(long) (sizeof ($1))],
+ [AS_TR_SH([ac_cv_sizeof_$1])],
+ [AC_INCLUDES_DEFAULT([$3])],
+ [AC_MSG_FAILURE([cannot compute sizeof ($1), 77])])
+else
+ AS_TR_SH([ac_cv_sizeof_$1])=0
+fi])dnl
+])# PY_CHECK_SIZEOF
+
# Arguments passed to configure.
AC_SUBST(CONFIG_ARGS)
CONFIG_ARGS="$ac_configure_args"
@@ -1142,15 +1190,8 @@
AC_TYPE_SIZE_T
AC_TYPE_UID_T
-# Sizes of various common basic types
-# ANSI C requires sizeof(char) == 1, so no need to check it
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(long, 4)
-AC_CHECK_SIZEOF(void *, 4)
-AC_CHECK_SIZEOF(short, 2)
-AC_CHECK_SIZEOF(float, 4)
-AC_CHECK_SIZEOF(double, 8)
-AC_CHECK_SIZEOF(fpos_t, 4)
+PY_CHECK_SIZEOF(short)
+PY_CHECK_SIZEOF(long)
AC_MSG_CHECKING(for long long support)
have_long_long=no
@@ -1159,107 +1200,28 @@
have_long_long=yes
])
AC_MSG_RESULT($have_long_long)
-if test "$have_long_long" = yes ; then
-AC_CHECK_SIZEOF(long long, 8)
-fi
AC_CHECK_TYPES(uintptr_t,
- [AC_CHECK_SIZEOF(uintptr_t, 4)],
+ [],
[], [#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif])
-# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
-AC_MSG_CHECKING(size of off_t)
-AC_CACHE_VAL(ac_cv_sizeof_off_t,
-[AC_TRY_RUN([#include <stdio.h>
+PY_CHECK_SIZEOF(off_t,4,[
+#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(off_t));
- exit(0);
-}],
-ac_cv_sizeof_off_t=`cat conftestval`,
-ac_cv_sizeof_off_t=0,
-ac_cv_sizeof_off_t=4)
-])
-AC_MSG_RESULT($ac_cv_sizeof_off_t)
-AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
-[The number of bytes in an off_t.])
+])
AC_MSG_CHECKING(whether to enable large file support)
-if test "$have_long_long" = yes -a \
- "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
- "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
- AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
- [Defined to enable large file support when an off_t is bigger than a long
- and long long is available and at least as big as an off_t. You may need
- to add some flags for configuration and compilation to enable this mode.
- (For Solaris and Linux, the necessary defines are already defined.)])
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-
-# AC_CHECK_SIZEOF() doesn't include <time.h>.
-AC_MSG_CHECKING(size of time_t)
-AC_CACHE_VAL(ac_cv_sizeof_time_t,
-[AC_TRY_RUN([#include <stdio.h>
-#include <time.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(time_t));
- exit(0);
-}],
-ac_cv_sizeof_time_t=`cat conftestval`,
-ac_cv_sizeof_time_t=0,
-ac_cv_sizeof_time_t=4)
-])
-AC_MSG_RESULT($ac_cv_sizeof_time_t)
-AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
-[The number of bytes in a time_t.])
-
-# if have pthread_t then define SIZEOF_PTHREAD_T
-ac_save_cc="$CC"
-if test "$ac_cv_kpthread" = "yes"
-then CC="$CC -Kpthread"
-elif test "$ac_cv_kthread" = "yes"
-then CC="$CC -Kthread"
-elif test "$ac_cv_pthread" = "yes"
-then CC="$CC -pthread"
-fi
-AC_MSG_CHECKING(for pthread_t)
-have_pthread_t=no
-AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
-AC_MSG_RESULT($have_pthread_t)
-if test "$have_pthread_t" = yes ; then
- # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
- AC_MSG_CHECKING(size of pthread_t)
- AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
- [AC_TRY_RUN([#include <stdio.h>
-#include <pthread.h>
- main()
- {
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(pthread_t));
- exit(0);
- }],
- ac_cv_sizeof_pthread_t=`cat conftestval`,
- ac_cv_sizeof_pthread_t=0,
- ac_cv_sizeof_pthread_t=4)
- ])
- AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
- AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
- [The number of bytes in a pthread_t.])
-fi
-CC="$ac_save_cc"
+AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
+[Defined to enable large file support when an off_t is bigger than a long
+ and long long is available and at least as big as an off_t. You may need
+ to add some flags for configuration and compilation to enable this mode.
+ (For Solaris and Linux, the necessary defines are already defined.)])
+AC_MSG_RESULT(yes)
AC_MSG_CHECKING(for --enable-toolbox-glue)
AC_ARG_ENABLE(toolbox-glue,
@@ -1496,10 +1458,6 @@
if test -z "$CCSHARED"
then
case $ac_sys_system/$ac_sys_release in
- SunOS*) if test "$GCC" = yes;
- then CCSHARED="-fPIC";
- else CCSHARED="-xcode=pic32";
- fi;;
hp*|HP*) if test "$GCC" = yes;
then CCSHARED="-fPIC";
else CCSHARED="+z";
@@ -2815,12 +2773,6 @@
wchar_h="no"
)
-# determine wchar_t size
-if test "$wchar_h" = yes
-then
- AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
-fi
-
AC_MSG_CHECKING(for UCS-4 tcl)
have_ucs4_tcl=no
AC_TRY_COMPILE([
@@ -2850,6 +2802,11 @@
ac_cv_wchar_t_signed=no,
ac_cv_wchar_t_signed=yes)])
AC_MSG_RESULT($ac_cv_wchar_t_signed)
+
+ PY_CHECK_SIZEOF(wchar_t, 4, [
+ #include <wchar.h>
+ #include <stdlib.h
+ ])
fi
AC_MSG_CHECKING(what type to use for unicode)
--- Python-2.4.4/Makefile.pre.in.patch05 2006-10-08 13:41:25.000000000 -0400
+++ Python-2.4.4/Makefile.pre.in 2006-11-04 20:49:28.627191000 -0500
@@ -79,18 +79,18 @@
# Expanded directories
BINDIR= $(exec_prefix)/bin
-LIBDIR= $(exec_prefix)/lib
+LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
SCRIPTDIR= $(prefix)/lib
# Detailed destination directories
-BINLIBDEST= $(LIBDIR)/python$(VERSION)
-LIBDEST= $(SCRIPTDIR)/python$(VERSION)
-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-LIBP= $(LIBDIR)/python$(VERSION)
+BINLIBDEST= $(exec_prefix)/lib/python$(VERSION)
+LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
+LIBP= $(exec_prefix)/lib/python$(VERSION)
# Symbols used for using shared libraries
SO= @SO@
@@ -777,6 +777,7 @@
# Install the include files
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+
inclinstall:
@for i in $(INCLDIRSTOMAKE); \
do \