Barry Warsaw 2010-09-03 18:30:30 +00:00
parent e4ea994f20
commit 35f3a2cbeb
6 changed files with 430 additions and 333 deletions

View File

@ -323,8 +323,8 @@ class BuildExtTestCase(TempdirManager,
finally:
os.chdir(old_wd)
self.assertTrue(os.path.exists(so_file))
self.assertEquals(os.path.splitext(so_file)[-1],
sysconfig.get_config_var('SO'))
so_ext = sysconfig.get_config_var('SO')
self.assertTrue(so_file.endswith(so_ext))
so_dir = os.path.dirname(so_file)
self.assertEquals(so_dir, other_tmp_dir)
@ -333,8 +333,7 @@ class BuildExtTestCase(TempdirManager,
cmd.run()
so_file = cmd.get_outputs()[0]
self.assertTrue(os.path.exists(so_file))
self.assertEquals(os.path.splitext(so_file)[-1],
sysconfig.get_config_var('SO'))
self.assertTrue(so_file.endswith(so_ext))
so_dir = os.path.dirname(so_file)
self.assertEquals(so_dir, cmd.build_lib)

View File

@ -35,6 +35,7 @@ LINKCC= @LINKCC@
AR= @AR@
RANLIB= @RANLIB@
SVNVERSION= @SVNVERSION@
SOABI= @SOABI@
GNULD= @GNULD@
@ -559,6 +560,11 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
Modules/python.o: $(srcdir)/Modules/python.c
$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Modules/python.c
Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
$(CC) -c $(PY_CORE_CFLAGS) \
-DSOABI='"$(SOABI)"' \
-o $@ $(srcdir)/Python/dynload_shlib.c
$(IO_OBJS): $(IO_H)
# Use a stamp file to prevent make -j invoking pgen twice

View File

@ -30,27 +30,34 @@
#define LEAD_UNDERSCORE ""
#endif
/* The .so extension module ABI tag, supplied by the Makefile via
Makefile.pre.in and configure. This is used to discriminate between
incompatible .so files so that extensions for different Python builds can
live in the same directory. E.g. foomodule.cpython-32.so
*/
const struct filedescr _PyImport_DynLoadFiletab[] = {
#ifdef __CYGWIN__
{".dll", "rb", C_EXTENSION},
{"module.dll", "rb", C_EXTENSION},
#else
#else /* !__CYGWIN__ */
#if defined(PYOS_OS2) && defined(PYCC_GCC)
{".pyd", "rb", C_EXTENSION},
{".dll", "rb", C_EXTENSION},
#else
#else /* !(defined(PYOS_OS2) && defined(PYCC_GCC)) */
#ifdef __VMS
{".exe", "rb", C_EXTENSION},
{".EXE", "rb", C_EXTENSION},
{"module.exe", "rb", C_EXTENSION},
{"MODULE.EXE", "rb", C_EXTENSION},
#else
#else /* !__VMS */
{"." SOABI ".so", "rb", C_EXTENSION},
{".so", "rb", C_EXTENSION},
{"module." SOABI ".so", "rb", C_EXTENSION},
{"module.so", "rb", C_EXTENSION},
#endif
#endif
#endif
#endif /* __VMS */
#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
#endif /* __CYGWIN__ */
{0, 0}
};

624
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ m4_define([version_required],
[],
[m4_fatal([Autoconf version $1 is required for Python], 63)])
])
version_required(2.65)
AC_PREREQ(2.65)
AC_REVISION($Revision$)
AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
@ -52,6 +52,7 @@ mv confdefs.h.new confdefs.h
AC_SUBST(VERSION)
VERSION=PYTHON_VERSION
# Version number or Python's own shared library file.
AC_SUBST(SOVERSION)
SOVERSION=1.0
@ -817,6 +818,9 @@ if test -z "$LN" ; then
esac
fi
# For calculating the .so ABI tag.
SOABI_QUALIFIERS=""
# Check for --with-pydebug
AC_MSG_CHECKING(for --with-pydebug)
AC_ARG_WITH(pydebug,
@ -828,6 +832,7 @@ then
[Define if you want to build an interpreter with many run-time checks.])
AC_MSG_RESULT(yes);
Py_DEBUG='true'
SOABI_QUALIFIERS="${SOABI_QUALIFIERS}d"
else AC_MSG_RESULT(no); Py_DEBUG='false'
fi],
[AC_MSG_RESULT(no)])
@ -1649,34 +1654,6 @@ AC_SUBST(LDCXXSHARED)
AC_SUBST(BLDSHARED)
AC_SUBST(CCSHARED)
AC_SUBST(LINKFORSHARED)
# SO is the extension of shared libraries `(including the dot!)
# -- usually .so, .sl on HP-UX, .dll on Cygwin
AC_MSG_CHECKING(SO)
if test -z "$SO"
then
case $ac_sys_system in
hp*|HP*)
case `uname -m` in
ia64) SO=.so;;
*) SO=.sl;;
esac
;;
CYGWIN*) SO=.dll;;
*) SO=.so;;
esac
else
# this might also be a termcap variable, see #610332
echo
echo '====================================================================='
echo '+ +'
echo '+ WARNING: You have set SO in your environment. +'
echo '+ Do you really mean to change the extension for shared libraries? +'
echo '+ Continuing in 10 seconds to let you to ponder. +'
echo '+ +'
echo '====================================================================='
sleep 10
fi
AC_MSG_RESULT($SO)
AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
# LDSHARED is the ld *command* used to create shared library
@ -2487,7 +2464,9 @@ AC_ARG_WITH(pymalloc,
AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized mallocs]))
if test -z "$with_pymalloc"
then with_pymalloc="yes"
then
with_pymalloc="yes"
SOABI_QUALIFIERS="${SOABI_QUALIFIERS}m"
fi
if test "$with_pymalloc" != "no"
then
@ -3595,7 +3574,7 @@ fi
],
[
case "$have_ucs4_tcl" in
yes) unicode_size="4" ;;
yes) unicode_size="4";;
*) unicode_size="2" ;;
esac
])
@ -3603,7 +3582,10 @@ esac
AH_TEMPLATE(Py_UNICODE_SIZE,
[Define as the size of the unicode type.])
case "$unicode_size" in
4) AC_DEFINE(Py_UNICODE_SIZE, 4) ;;
4)
AC_DEFINE(Py_UNICODE_SIZE, 4)
SOABI_QUALIFIERS="${SOABI_QUALIFIERS}u"
;;
*) AC_DEFINE(Py_UNICODE_SIZE, 2) ;;
esac
@ -3636,6 +3618,55 @@ AC_MSG_RESULT($PY_UNICODE_TYPE)
# check for endianness
AC_C_BIGENDIAN
# ABI version string for Python extension modules. This appears between the
# periods in shared library file names, e.g. foo.<SOABI>.so. It is calculated
# from the following attributes which affect the ABI of this Python build (in
# this order):
#
# * The Python implementation (always 'cpython-' for us)
# * The major and minor version numbers
# * --with-pydebug (adds a 'd')
# * --with-pymalloc (adds a 'm')
# * --with-wide-unicode (adds a 'u')
#
# Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
# would get a shared library ABI version tag of 'cpython-32udm' and shared
# libraries would be named 'foo.cpython-32udm.so'.
AC_SUBST(SOABI)
AC_MSG_CHECKING(SOABI)
SOABI='cpython-'`echo $VERSION | tr -d .`${SOABI_QUALIFIERS}
AC_MSG_RESULT($SOABI)
# SO is the extension of shared libraries `(including the dot!)
# -- usually .so, .sl on HP-UX, .dll on Cygwin
AC_MSG_CHECKING(SO)
if test -z "$SO"
then
case $ac_sys_system in
hp*|HP*)
case `uname -m` in
ia64) SO=.so;;
*) SO=.sl;;
esac
;;
CYGWIN*) SO=.dll;;
Linux*) SO=.${SOABI}.so;;
*) SO=.so;;
esac
else
# this might also be a termcap variable, see #610332
echo
echo '====================================================================='
echo '+ +'
echo '+ WARNING: You have set SO in your environment. +'
echo '+ Do you really mean to change the extension for shared libraries? +'
echo '+ Continuing in 10 seconds to let you to ponder. +'
echo '+ +'
echo '====================================================================='
sleep 10
fi
AC_MSG_RESULT($SO)
# Check whether right shifting a negative integer extends the sign bit
# or fills with zeros (like the Cray J90, according to Tim Peters).
AC_MSG_CHECKING(whether right shift extends the sign bit)

View File

@ -1040,7 +1040,7 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Define to 0 if you don't want to use computed gotos in ceval.c. */
/* Define if you want to use computed gotos in ceval.c. */
#undef USE_COMPUTED_GOTOS
/* Define if the compiler supports the inline keyword */