Python-05-isalibs.diff revision 8904
15341N/A--- Python-2.4.2/Python/import.c Wed Sep 14 11:15:03 2005
15341N/A+++ Python-2.4.2-new/Python/import.c Tue Aug 29 17:06:36 2006
15341N/A@@ -702,8 +702,9 @@
15341N/A }
15341N/A pyc_mtime = PyMarshal_ReadLongFromFile(fp);
15341N/A if (pyc_mtime != mtime) {
15341N/A- if (Py_VerboseFlag)
15341N/A- PySys_WriteStderr("# %s has bad mtime\n", cpathname);
15341N/A+ /*if (Py_VerboseFlag) */
15341N/A+ PySys_WriteStderr("# %s has bad mtime %lu vs %lu\n",
15341N/A+cpathname, mtime, pyc_mtime);
15341N/A fclose(fp);
15341N/A return NULL;
15341N/A }
15341N/A@@ -1058,6 +1059,57 @@
15341N/A static int find_init_module(char *); /* Forward */
15341N/A static struct filedescr importhookdescr = {"", "", IMP_HOOK};
15341N/A
15341N/A+#ifdef HAVE_STAT
15341N/A+static char *
15341N/A+insert_64dir(char *buf, size_t buflen)
15341N/A+{
15341N/A+ char *base;
15341N/A+ char *cp;
15341N/A+ size_t blen;
15406N/A+
15406N/A+ if ((blen = strlen(buf)) == 0)
15341N/A+ return (NULL);
15341N/A+
15341N/A+ cp = &buf[blen - 1];
15341N/A+ while (cp != buf && *cp != SEP)
15341N/A+ cp--;
15341N/A+
15341N/A+ if (cp != buf)
15341N/A+ cp++;
15341N/A+
15341N/A+ if (blen + strlen("64/") + 1 >= buflen)
15341N/A+ return NULL;
15341N/A+
15341N/A+ base = strdup(cp);
15341N/A+ sprintf(cp, "64%c%s", SEP, base);
15341N/A+ free(base);
15341N/A+
15341N/A+ return buf;
15341N/A+}
15341N/A+
15341N/A+/*
15341N/A+ * If we're on a 64-bit platform, modify lookups for shared object files.
15341N/A+ */
15341N/A+static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen)
15341N/A+{
15341N/A+ struct stat statbuf;
15341N/A+
15341N/A+ if (sizeof(void *) != 8)
15341N/A+ return 0;
15341N/A+
15341N/A+ if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
15341N/A+ return 0;
15341N/A+
15341N/A+ if (fdp->type != C_EXTENSION)
15341N/A+ return 0;
15341N/A+
15341N/A+ if (insert_64dir(buf, buflen) == NULL)
15341N/A+ return 0;
15341N/A+
15341N/A+ return strlen("64/");
15341N/A+}
15341N/A+#endif
15341N/A+
15341N/A static struct filedescr *
15406N/A find_module(char *fullname, char *subname, PyObject *path, char *buf,
15406N/A size_t buflen, FILE **p_fp, PyObject **p_loader)
15341N/A@@ -1075,11 +1127,10 @@
15341N/A static struct filedescr fd_builtin = {"", "", C_BUILTIN};
15341N/A static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
15341N/A char name[MAXPATHLEN+1];
15341N/A-#if defined(PYOS_OS2)
15341N/A size_t saved_len;
15341N/A size_t saved_namelen;
15341N/A char *saved_buf = NULL;
15341N/A-#endif
15341N/A+
15341N/A if (p_loader != NULL)
15341N/A *p_loader = NULL;
15341N/A
15341N/A@@ -1269,7 +1320,7 @@
15341N/A }
15341N/A #endif
15341N/A #endif
15341N/A-#if defined(PYOS_OS2)
15341N/A+
15341N/A /* take a snapshot of the module spec for restoration
15341N/A * after the 8 character DLL hackery
15341N/A */
15341N/A@@ -1276,8 +1327,12 @@
15341N/A saved_buf = strdup(buf);
15341N/A saved_len = len;
15341N/A saved_namelen = namelen;
15341N/A-#endif /* PYOS_OS2 */
15341N/A+
15341N/A for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
15341N/A+#ifdef HAVE_STAT
15406N/A+ len += modify_path(fdp, buf, buflen);
15406N/A+#endif
15406N/A+
15406N/A #if defined(PYOS_OS2)
15406N/A /* OS/2 limits DLLs to 8 character names (w/o
15406N/A extension)
15406N/A@@ -1318,14 +1373,12 @@
15406N/A fp = NULL;
15406N/A }
15406N/A }
15406N/A-#if defined(PYOS_OS2)
15406N/A+
15341N/A /* restore the saved snapshot */
15341N/A strcpy(buf, saved_buf);
15341N/A len = saved_len;
15341N/A namelen = saved_namelen;
15341N/A-#endif
15341N/A }
15341N/A-#if defined(PYOS_OS2)
15341N/A /* don't need/want the module name snapshot anymore */
15341N/A if (saved_buf)
15341N/A {
15341N/A@@ -1332,7 +1385,6 @@
15341N/A free(saved_buf);
15341N/A saved_buf = NULL;
15341N/A }
15341N/A-#endif
15341N/A Py_XDECREF(copy);
15341N/A if (fp != NULL)
15341N/A break;
15341N/A--- Python-2.4.2/Lib/distutils/command/build_ext.py Wed Nov 10 14:23:15 2004
15341N/A+++ Python-2.4.2-new/Lib/distutils/command/build_ext.py Thu Aug 24 18:22:44 2006
15341N/A@@ -614,7 +614,13 @@
15341N/A so_ext = get_config_var('SO')
15341N/A if os.name == 'nt' and self.debug:
15341N/A return apply(os.path.join, ext_path) + '_d' + so_ext
15341N/A- return apply(os.path.join, ext_path) + so_ext
15341N/A+ # .so extensions are word-size specific
15341N/A+ path = apply(os.path.join, ext_path)
15341N/A+ if sys.maxint == 2147483647L:
15341N/A+ return path + so_ext
15341N/A+ dirname = os.path.dirname(path);
15406N/A+ basename = os.path.basename(path);
15406N/A+ return os.path.join(dirname, "64", basename + so_ext)
15344N/A
15344N/A def get_export_symbols (self, ext):
15341N/A """Return the list of symbols that a shared extension has to
15341N/ANo differences encountered
15341N/ANo differences encountered
15341N/ANo differences encountered
15341N/A--- Python-2.4.2/Python/importdl.h Mon Dec 30 14:08:05 2002
15341N/A+++ Python-2.4.2-new/Python/importdl.h Thu Aug 24 17:43:33 2006
15341N/A@@ -31,8 +31,9 @@
15341N/A extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
15341N/A FILE *);
15341N/A
15341N/A-/* Max length of module suffix searched for -- accommodates "module.slb" */
15341N/A-#define MAXSUFFIXSIZE 12
15341N/A+/* Max length of module suffix searched for -- accommodates "module.slb"
15341N/A+ and "64/" */
15341N/A+#define MAXSUFFIXSIZE 15
15341N/A
15341N/A #ifdef MS_WINDOWS
15341N/A #include <windows.h>
15341N/A--- Python-2.4.2/configure.in Sun Aug 7 14:08:53 2005
15341N/A+++ Python-2.4.2-new/configure.in Tue Aug 22 19:06:04 2006
15341N/A@@ -14,8 +14,36 @@
15341N/A AH_TOP([
15341N/A #ifndef Py_PYCONFIG_H
15341N/A #define Py_PYCONFIG_H
15341N/A+
15341N/A ])
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"
@@ -1064,15 +1112,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
@@ -1081,9 +1122,6 @@
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_MSG_CHECKING(for uintptr_t support)
have_uintptr_t=no
@@ -1092,101 +1130,21 @@
have_uintptr_t=yes
])
AC_MSG_RESULT($have_uintptr_t)
-if test "$have_uintptr_t" = yes ; then
-AC_CHECK_SIZEOF(uintptr_t, 4)
-fi
-# 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_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_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_MSG_CHECKING(for --enable-toolbox-glue)
AC_ARG_ENABLE(toolbox-glue,
AC_HELP_STRING(--enable-toolbox-glue, disable/enable MacOSX glue code for extensions))
@@ -1408,10 +1366,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";
@@ -2705,12 +2663,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([
@@ -2740,6 +2692,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.2/Makefile.pre.in Mon Mar 28 15:23:01 2005
+++ Python-2.4.2-new/Makefile.pre.in Tue Aug 22 17:45:05 2006
@@ -79,7 +79,7 @@
# Expanded directories
BINDIR= $(exec_prefix)/bin
-LIBDIR= $(exec_prefix)/lib
+LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
@@ -86,11 +86,11 @@
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@
@@ -747,6 +747,7 @@
# Install the include files
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+
inclinstall:
@for i in $(INCLDIRSTOMAKE); \
do \