From: doko@ubuntu.com Date: Thu, 21 Mar 2013 20:39:52 +0000 (-0700) Subject: - Issue #16754: Fix the incorrect shared library extension on linux. Introduce X-Git-Tag: v3.4.0a1~1119 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d3d0fe0b2ebb3628167fb90a6ffd51c3b73046b;p=python - Issue #16754: Fix the incorrect shared library extension on linux. Introduce two makefile macros SHLIB_SUFFIX and EXT_SUFFIX. SO now has the value of SHLIB_SUFFIX again (as in 2.x and 3.1). The SO macro is removed in 3.4. --- 6d3d0fe0b2ebb3628167fb90a6ffd51c3b73046b diff --cc Lib/distutils/command/build_ext.py index f7c71b3e8f,1ad0d5ff58..a6aad53ddf --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@@ -665,11 -673,14 +665,11 @@@ class build_ext(Command) """ from distutils.sysconfig import get_config_var ext_path = ext_name.split('.') - # OS/2 has an 8 character module (extension) limit :-( - if os.name == "os2": - ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8] # extensions in debug_mode are named 'module_d.pyd' under windows - so_ext = get_config_var('SO') + ext_suffix = get_config_var('EXT_SUFFIX') if os.name == 'nt' and self.debug: - return os.path.join(*ext_path) + '_d' + so_ext - return os.path.join(*ext_path) + so_ext + return os.path.join(*ext_path) + '_d' + ext_suffix + return os.path.join(*ext_path) + ext_suffix def get_export_symbols(self, ext): """Return the list of symbols that a shared extension has to diff --cc Lib/distutils/sysconfig.py index 71492f306c,b73503d296..898aa26732 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@@ -479,7 -486,8 +479,7 @@@ def _init_nt() # XXX hmmm.. a normal install puts include files here g['INCLUDEPY'] = get_python_inc(plat_specific=0) -- g['SO'] = '.pyd' + g['EXT_SUFFIX'] = '.pyd' g['EXE'] = ".exe" g['VERSION'] = get_python_version().replace(".", "") g['BINDIR'] = os.path.dirname(os.path.abspath(sys.executable)) diff --cc Lib/sysconfig.py index a98cc71533,2f5f7404ff..2095657358 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@@ -416,7 -436,8 +416,7 @@@ def _init_non_posix(vars) vars['LIBDEST'] = get_path('stdlib') vars['BINLIBDEST'] = get_path('platstdlib') vars['INCLUDEPY'] = get_path('include') -- vars['SO'] = '.pyd' + vars['EXT_SUFFIX'] = '.pyd' vars['EXE'] = '.exe' vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable)) diff --cc Makefile.pre.in index ad91c302e0,6709f4a68a..534ddc0dc5 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@@ -125,7 -125,9 +125,8 @@@ INCLUDEPY= $(INCLUDEDIR)/python$(LDVERS CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION) # Symbols used for using shared libraries - SO= @SO@ + SHLIB_SUFFIX= @SHLIB_SUFFIX@ + EXT_SUFFIX= @EXT_SUFFIX@ -SO= $(SHLIB_SUFFIX) LDSHARED= @LDSHARED@ $(PY_LDFLAGS) BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) LDCXXSHARED= @LDCXXSHARED@ diff --cc configure index c5256642d1,fa8d518783..aefad26880 --- a/configure +++ b/configure @@@ -625,8 -625,7 +625,9 @@@ ac_includes_default=" ac_subst_vars='LTLIBOBJS SRCDIRS THREADHEADERS +LIBPL +PY_ENABLE_SHARED + EXT_SUFFIX SOABI LIBC LIBM @@@ -13695,49 -13719,6 +13723,10 @@@ LDVERSION='$(VERSION)$(ABIFLAGS) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5 $as_echo "$LDVERSION" >&6; } + +LIBPL="${prefix}/lib/python${VERSION}/config-${LDVERSION}" + + - # SO is the extension of shared libraries `(including the dot!) - # -- usually .so, .sl on HP-UX, .dll on Cygwin - { $as_echo "$as_me:${as_lineno-$LINENO}: checking SO" >&5 - $as_echo_n "checking SO... " >&6; } - 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*|GNU*) - 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SO" >&5 - $as_echo "$SO" >&6; } - - - cat >>confdefs.h <<_ACEOF - #define SHLIB_EXT "$SO" - _ACEOF - - # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the sign bit" >&5 diff --cc configure.ac index 34f19f3bd9,8cf0e9251b..12dde47be4 --- a/configure.ac +++ b/configure.ac @@@ -3931,44 -3954,6 +3956,11 @@@ AC_MSG_CHECKING(LDVERSION LDVERSION='$(VERSION)$(ABIFLAGS)' AC_MSG_RESULT($LDVERSION) +dnl define LIBPL after ABIFLAGS and LDVERSION is defined. +AC_SUBST(PY_ENABLE_SHARED) +LIBPL="${prefix}/lib/python${VERSION}/config-${LDVERSION}" +AC_SUBST(LIBPL) + - # 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*|GNU*) - 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) - - AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).]) - # 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)