00-bits.patch revision 458
458N/A#
458N/A# This patch makes the pyconfig.h header file 32/64 bit friendly.
458N/A#
458N/A--- Python-2.7.1/configure.in.orig Tue Jul 12 14:46:56 2011
458N/A+++ Python-2.7.1/configure.in Tue Jul 12 14:47:05 2011
458N/A@@ -12,7 +12,7 @@
458N/A [],
458N/A [m4_fatal([Autoconf version $1 is required for Python], 63)])
458N/A ])
458N/A-version_required(2.65)
458N/A+version_required(2.63)
458N/A
458N/A AC_REVISION($Revision: 86076 $)
458N/A AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
458N/A@@ -35,6 +35,41 @@
458N/A #define Py_PYCONFIG_H
458N/A ])
458N/A AH_BOTTOM([
458N/A+
458N/A+#include <sys/isa_defs.h>
458N/A+
458N/A+/*
458N/A+ * Python originally defined these statically, which prevents a 32-64 python
458N/A+ * from working at all.
458N/A+ */
458N/A+
458N/A+#define SIZEOF_SHORT 2
458N/A+#define SIZEOF_INT 4
458N/A+#define SIZEOF_LONG_LONG 8
458N/A+#define SIZEOF_FPOS_T 8
458N/A+#define SIZEOF_OFF_T 8
458N/A+#define SIZEOF_PTHREAD_T 4
458N/A+
458N/A+#ifdef _LP64
458N/A+#define SIZEOF_LONG 8
458N/A+#define SIZEOF_UINTPTR_T 8
458N/A+#define SIZEOF_VOID_P 8
458N/A+#define SIZEOF_TIME_T 8
458N/A+#define SIZEOF_SIZE_T 8
458N/A+#define SIZEOF_LONG_DOUBLE 16
458N/A+#else
458N/A+#define SIZEOF_LONG 4
458N/A+#define SIZEOF_UINTPTR_T 4
458N/A+#define SIZEOF_VOID_P 4
458N/A+#define SIZEOF_TIME_T 4
458N/A+#define SIZEOF_SIZE_T 4
458N/A+#if defined(__i386)
458N/A+#define SIZEOF_LONG_DOUBLE 12
458N/A+#else
458N/A+#define SIZEOF_LONG_DOUBLE 16
458N/A+#endif
458N/A+#endif
458N/A+
458N/A /* Define the macros needed if on a UnixWare 7.x system. */
458N/A #if defined(__USLC__) && defined(__SCO_VERSION__)
458N/A #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
458N/A@@ -1474,13 +1509,13 @@
458N/A # Sizes of various common basic types
458N/A # ANSI C requires sizeof(char) == 1, so no need to check it
458N/A AC_CHECK_SIZEOF(int, 4)
458N/A-AC_CHECK_SIZEOF(long, 4)
458N/A-AC_CHECK_SIZEOF(void *, 4)
458N/A+dnl AC_CHECK_SIZEOF(long, 4)
458N/A+dnl AC_CHECK_SIZEOF(void *, 4)
458N/A AC_CHECK_SIZEOF(short, 2)
458N/A AC_CHECK_SIZEOF(float, 4)
458N/A AC_CHECK_SIZEOF(double, 8)
458N/A AC_CHECK_SIZEOF(fpos_t, 4)
458N/A-AC_CHECK_SIZEOF(size_t, 4)
458N/A+dnl AC_CHECK_SIZEOF(size_t, 4)
458N/A AC_CHECK_SIZEOF(pid_t, 4)
458N/A
458N/A AC_MSG_CHECKING(for long long support)
458N/A@@ -1501,9 +1536,9 @@
458N/A have_long_double=yes
458N/A ],[])
458N/A AC_MSG_RESULT($have_long_double)
458N/A-if test "$have_long_double" = yes ; then
458N/A-AC_CHECK_SIZEOF(long double, 12)
458N/A-fi
458N/A+dnl if test "$have_long_double" = yes ; then
458N/A+dnl AC_CHECK_SIZEOF(long double, 12)
458N/A+dnl fi
458N/A
458N/A AC_MSG_CHECKING(for _Bool support)
458N/A have_c99_bool=no
458N/A@@ -1517,7 +1552,7 @@
458N/A fi
458N/A
458N/A AC_CHECK_TYPES(uintptr_t,
458N/A- [AC_CHECK_SIZEOF(uintptr_t, 4)],
458N/A+ [],
458N/A [], [#ifdef HAVE_STDINT_H
458N/A #include <stdint.h>
458N/A #endif
458N/A@@ -1534,8 +1569,8 @@
458N/A AC_MSG_CHECKING(whether to enable large file support)
458N/A if test "$have_long_long" = yes
458N/A then
458N/A-if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
458N/A- "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
458N/A+dnl if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
458N/A+dnl "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
458N/A AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
458N/A [Defined to enable large file support when an off_t is bigger than a long
458N/A and long long is available and at least as big as an off_t. You may need
458N/A@@ -1542,21 +1577,21 @@
458N/A to add some flags for configuration and compilation to enable this mode.
458N/A (For Solaris and Linux, the necessary defines are already defined.)])
458N/A AC_MSG_RESULT(yes)
458N/A+dnl else
458N/A+dnl AC_MSG_RESULT(no)
458N/A+dnl fi
458N/A else
458N/A AC_MSG_RESULT(no)
458N/A fi
458N/A-else
458N/A- AC_MSG_RESULT(no)
458N/A-fi
458N/A
458N/A-AC_CHECK_SIZEOF(time_t, [], [
458N/A-#ifdef HAVE_SYS_TYPES_H
458N/A-#include <sys/types.h>
458N/A-#endif
458N/A-#ifdef HAVE_TIME_H
458N/A-#include <time.h>
458N/A-#endif
458N/A-])
458N/A+dnl AC_CHECK_SIZEOF(time_t, [], [
458N/A+dnl #ifdef HAVE_SYS_TYPES_H
458N/A+dnl #include <sys/types.h>
458N/A+dnl #endif
458N/A+dnl #ifdef HAVE_TIME_H
458N/A+dnl #include <time.h>
458N/A+dnl #endif
458N/A+dnl ])
458N/A
458N/A # if have pthread_t then define SIZEOF_PTHREAD_T
458N/A ac_save_cc="$CC"
458N/A@@ -1906,12 +1941,6 @@
458N/A if test -z "$CCSHARED"
458N/A then
458N/A case $ac_sys_system/$ac_sys_release in
458N/A- SunOS*) if test "$GCC" = yes;
458N/A- then CCSHARED="-fPIC";
458N/A- elif test `uname -p` = sparc;
458N/A- then CCSHARED="-xcode=pic32";
458N/A- else CCSHARED="-Kpic";
458N/A- fi;;
458N/A hp*|HP*) if test "$GCC" = yes;
458N/A then CCSHARED="-fPIC";
458N/A else CCSHARED="+z";