15341N/A pyc_mtime = PyMarshal_ReadLongFromFile(fp);
15341N/A- PySys_WriteStderr("# %s has bad mtime\n", cpathname);
15341N/A+ PySys_WriteStderr("# %s has bad mtime %lu vs %lu\n",
15341N/A static int find_init_module(char *); /* Forward */
15341N/A static struct filedescr importhookdescr = {"", "", IMP_HOOK};
15341N/A+insert_64dir(char *buf, size_t buflen)
15406N/A+ if ((blen = strlen(buf)) == 0)
15341N/A+ while (cp != buf && *cp != SEP)
15341N/A+ if (blen + strlen("64/") + 1 >= buflen)
15341N/A+ sprintf(cp, "64%c%s", SEP, base);
15341N/A+ * If we're on a 64-bit platform, modify lookups for shared object files.
15341N/A+static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen)
15341N/A+ if (insert_64dir(buf, buflen) == NULL)
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 static struct filedescr fd_builtin = {"", "", C_BUILTIN};
15341N/A static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
15341N/A /* take a snapshot of the module spec for restoration
15341N/A * after the 8 character DLL hackery
15341N/A for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
15406N/A+ len += modify_path(fdp, buf, buflen);
15406N/A /* OS/2 limits DLLs to 8 character names (w/o
15341N/A /* restore the saved snapshot */
15341N/A+ # .so extensions are word-size specific
15344N/A def get_export_symbols (self, ext):
15341N/A """Return the list of symbols that a shared extension has to
15341N/A extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
+ * Python originally defined these statically, which prevents a 32-64 python
+#define SIZEOF_LONG_LONG 8
+#define SIZEOF_PTHREAD_T 4
+#define SIZEOF_UINTPTR_T 8
+#define SIZEOF_UINTPTR_T 4
/* 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 */
+# 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
+ # 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])])
+ AS_TR_SH([ac_cv_sizeof_$1])=0
# Arguments passed to configure.
CONFIG_ARGS="$ac_configure_args"
-# Sizes of various common basic types
-# ANSI C requires sizeof(char) == 1, so no need to check it
-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)
AC_MSG_CHECKING(for long long support)
AC_MSG_RESULT($have_long_long)
-if test "$have_long_long" = yes ; then
-AC_CHECK_SIZEOF(long long, 8)
AC_MSG_CHECKING(for uintptr_t support)
AC_MSG_RESULT($have_uintptr_t)
-if test "$have_uintptr_t" = yes ; then
-AC_CHECK_SIZEOF(uintptr_t, 4)
-# 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,
+PY_CHECK_SIZEOF(off_t,4,[
- FILE *f=fopen("conftestval", "w");
- fprintf(f, "%d\n", sizeof(off_t));
-ac_cv_sizeof_off_t=`cat conftestval`,
-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_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_CHECK_SIZEOF() doesn't include <
time.h>.
-AC_MSG_CHECKING(size of time_t)
-AC_CACHE_VAL(ac_cv_sizeof_time_t,
- FILE *f=fopen("conftestval", "w");
- fprintf(f, "%d\n", sizeof(time_t));
-ac_cv_sizeof_time_t=`cat conftestval`,
-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
-if test "$ac_cv_kpthread" = "yes"
-elif test "$ac_cv_kthread" = "yes"
-elif test "$ac_cv_pthread" = "yes"
-AC_MSG_CHECKING(for pthread_t)
-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,
- FILE *f=fopen("conftestval", "w");
- fprintf(f, "%d\n", sizeof(pthread_t));
- 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.])
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))
case $ac_sys_system/$ac_sys_release in
- SunOS*) if test "$GCC" = yes;
- else CCSHARED="-xcode=pic32";
hp*|HP*) if test "$GCC" = yes;
-# determine wchar_t size
-if test "$wchar_h" = yes
- AC_CHECK_SIZEOF(wchar_t, 4, [#include <
wchar.h>])
AC_MSG_CHECKING(for UCS-4 tcl)
ac_cv_wchar_t_signed=yes)])
AC_MSG_RESULT($ac_cv_wchar_t_signed)
+ PY_CHECK_SIZEOF(wchar_t, 4, [
AC_MSG_CHECKING(what type to use for unicode)
BINDIR= $(exec_prefix)/bin
-LIBDIR= $(exec_prefix)/lib
CONFINCLUDEDIR= $(exec_prefix)/include
# Detailed destination directories
-BINLIBDEST= $(LIBDIR)/python$(VERSION)
-LIBDEST= $(SCRIPTDIR)/python$(VERSION)
-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-LIBP= $(LIBDIR)/python$(VERSION)
+LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
# Symbols used for using shared libraries
# Install the include files
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
@for i in $(INCLDIRSTOMAKE); \