diff options
author | Barry Warsaw <barry@python.org> | 2010-11-24 19:43:47 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2010-11-24 19:43:47 (GMT) |
commit | 14d98ac31b9f4e5b89284271f03fb77fc81ab624 (patch) | |
tree | 2f784cc5d4b814b41c4d14f2f308e1173c938e58 /Lib | |
parent | fdba067213f1881632f9f1b7b4fce53cf88bbe28 (diff) | |
download | cpython-14d98ac31b9f4e5b89284271f03fb77fc81ab624.zip cpython-14d98ac31b9f4e5b89284271f03fb77fc81ab624.tar.gz cpython-14d98ac31b9f4e5b89284271f03fb77fc81ab624.tar.bz2 |
Final patch for issue 9807.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/command/install.py | 6 | ||||
-rw-r--r-- | Lib/distutils/sysconfig.py | 19 | ||||
-rw-r--r-- | Lib/sysconfig.py | 11 |
3 files changed, 28 insertions, 8 deletions
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index 58f6ec5..7f9d00f 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -48,7 +48,7 @@ INSTALL_SCHEMES = { 'unix_prefix': { 'purelib': '$base/lib/python$py_version_short/site-packages', 'platlib': '$platbase/lib/python$py_version_short/site-packages', - 'headers': '$base/include/python$py_version_short/$dist_name', + 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, @@ -82,7 +82,8 @@ if HAS_USER_SITE: INSTALL_SCHEMES['unix_user'] = { 'purelib': '$usersite', 'platlib': '$usersite', - 'headers': '$userbase/include/python$py_version_short/$dist_name', + 'headers': + '$userbase/include/python$py_version_short$abiflags/$dist_name', 'scripts': '$userbase/bin', 'data' : '$userbase', } @@ -322,6 +323,7 @@ class install(Command): 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, + 'abiflags': sys.abiflags, } if HAS_USER_SITE: diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index be91f92..897b7d6 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -11,7 +11,6 @@ Email: <fdrake@acm.org> __revision__ = "$Id$" -import io import os import re import sys @@ -49,6 +48,18 @@ def _python_build(): return False python_build = _python_build() +# Calculate the build qualifier flags if they are defined. Adding the flags +# to the include and lib directories only makes sense for an installation, not +# an in-source build. +build_flags = '' +try: + if not python_build: + build_flags = sys.abiflags +except AttributeError: + # It's not a configure-based build, so the sys module doesn't have + # this attribute, which is fine. + pass + def get_python_version(): """Return a string containing the major and minor Python version, leaving off the patchlevel. Sample return values could be '1.5' @@ -83,7 +94,8 @@ def get_python_inc(plat_specific=0, prefix=None): else: incdir = os.path.join(get_config_var('srcdir'), 'Include') return os.path.normpath(incdir) - return os.path.join(prefix, "include", "python" + get_python_version()) + python_dir = 'python' + get_python_version() + build_flags + return os.path.join(prefix, "include", python_dir) elif os.name == "nt": return os.path.join(prefix, "include") elif os.name == "os2": @@ -209,7 +221,8 @@ def get_makefile_filename(): if python_build: return os.path.join(os.path.dirname(sys.executable), "Makefile") lib_dir = get_python_lib(plat_specific=1, standard_lib=1) - return os.path.join(lib_dir, "config", "Makefile") + config_file = 'config-{}{}'.format(get_python_version(), build_flags) + return os.path.join(lib_dir, config_file, 'Makefile') def parse_config_h(fp, g=None): diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 52efdb0..fe8c990 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -25,8 +25,10 @@ _INSTALL_SCHEMES = { 'platstdlib': '{platbase}/lib/python{py_version_short}', 'purelib': '{base}/lib/python{py_version_short}/site-packages', 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', - 'include': '{base}/include/python{py_version_short}', - 'platinclude': '{platbase}/include/python{py_version_short}', + 'include': + '{base}/include/python{py_version_short}{abiflags}', + 'platinclude': + '{platbase}/include/python{py_version_short}{abiflags}', 'scripts': '{base}/bin', 'data': '{base}', }, @@ -317,7 +319,9 @@ def get_makefile_filename(): """Return the path of the Makefile.""" if _PYTHON_BUILD: return os.path.join(_PROJECT_BASE, "Makefile") - return os.path.join(get_path('stdlib'), "config", "Makefile") + return os.path.join(get_path('stdlib'), + 'config-{}{}'.format(_PY_VERSION_SHORT, sys.abiflags), + 'Makefile') def _init_posix(vars): @@ -471,6 +475,7 @@ def get_config_vars(*args): _CONFIG_VARS['base'] = _PREFIX _CONFIG_VARS['platbase'] = _EXEC_PREFIX _CONFIG_VARS['projectbase'] = _PROJECT_BASE + _CONFIG_VARS['abiflags'] = sys.abiflags if os.name in ('nt', 'os2'): _init_non_posix(_CONFIG_VARS) |