diff options
author | doko@ubuntu.com <doko@ubuntu.com> | 2013-03-21 20:39:52 (GMT) |
---|---|---|
committer | doko@ubuntu.com <doko@ubuntu.com> | 2013-03-21 20:39:52 (GMT) |
commit | 6d3d0fe0b2ebb3628167fb90a6ffd51c3b73046b (patch) | |
tree | 9f03bd9e07f9425fe8bb611334478d1c621878eb /Lib/distutils | |
parent | d06b35c1b6ef9e49c455bb4e163ce056bf80d073 (diff) | |
parent | 1621d77fc8fb2385d26c7de39f55df60426ec6ec (diff) | |
download | cpython-6d3d0fe0b2ebb3628167fb90a6ffd51c3b73046b.zip cpython-6d3d0fe0b2ebb3628167fb90a6ffd51c3b73046b.tar.gz cpython-6d3d0fe0b2ebb3628167fb90a6ffd51c3b73046b.tar.bz2 |
- 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.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 6 | ||||
-rw-r--r-- | Lib/distutils/sysconfig.py | 8 | ||||
-rw-r--r-- | Lib/distutils/tests/test_build_ext.py | 8 | ||||
-rw-r--r-- | Lib/distutils/tests/test_install.py | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index f7c71b3..a6aad53 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -666,10 +666,10 @@ class build_ext(Command): from distutils.sysconfig import get_config_var ext_path = ext_name.split('.') # 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 --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 71492f3..898aa26 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -184,9 +184,9 @@ def customize_compiler(compiler): _osx_support.customize_compiler(_config_vars) _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' - (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \ + (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', - 'CCSHARED', 'LDSHARED', 'SO', 'AR', 'ARFLAGS') + 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') newcc = None if 'CC' in os.environ: @@ -225,7 +225,7 @@ def customize_compiler(compiler): linker_exe=cc, archiver=archiver) - compiler.shared_lib_extension = so_ext + compiler.shared_lib_extension = shlib_suffix def get_config_h_filename(): @@ -479,7 +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 --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 065a6a2..44a9852 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -318,8 +318,8 @@ class BuildExtTestCase(TempdirManager, finally: os.chdir(old_wd) self.assertTrue(os.path.exists(so_file)) - so_ext = sysconfig.get_config_var('SO') - self.assertTrue(so_file.endswith(so_ext)) + ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') + self.assertTrue(so_file.endswith(ext_suffix)) so_dir = os.path.dirname(so_file) self.assertEqual(so_dir, other_tmp_dir) @@ -328,7 +328,7 @@ class BuildExtTestCase(TempdirManager, cmd.run() so_file = cmd.get_outputs()[0] self.assertTrue(os.path.exists(so_file)) - self.assertTrue(so_file.endswith(so_ext)) + self.assertTrue(so_file.endswith(ext_suffix)) so_dir = os.path.dirname(so_file) self.assertEqual(so_dir, cmd.build_lib) @@ -355,7 +355,7 @@ class BuildExtTestCase(TempdirManager, self.assertEqual(lastdir, 'bar') def test_ext_fullpath(self): - ext = sysconfig.get_config_vars()['SO'] + ext = sysconfig.get_config_var('EXT_SUFFIX') # building lxml.etree inplace #etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c') #etree_ext = Extension('lxml.etree', [etree_c]) diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py index 3cf2c73..e9b2642 100644 --- a/Lib/distutils/tests/test_install.py +++ b/Lib/distutils/tests/test_install.py @@ -23,7 +23,7 @@ from distutils.tests import support def _make_ext_name(modname): if os.name == 'nt' and sys.executable.endswith('_d.exe'): modname += '_d' - return modname + sysconfig.get_config_var('SO') + return modname + sysconfig.get_config_var('EXT_SUFFIX') class InstallTestCase(support.TempdirManager, |