cpython: 53fa224b95f4 (original) (raw)
Mercurial > cpython
changeset 79080:53fa224b95f4 2.7
- Issue #11715: Fix multiarch detection without having Debian development tools (dpkg-dev) installed. [#11715]
doko@ubuntu.com | |
---|---|
date | Fri, 21 Sep 2012 13:51:40 +0200 |
parents | 3d170d1e2fa3 |
children | 7a125913a375 |
files | Misc/NEWS setup.py |
diffstat | 2 files changed, 24 insertions(+), 0 deletions(-)[+] [-] Misc/NEWS 3 setup.py 21 |
line wrap: on
line diff
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -400,6 +400,9 @@ Tests Build ----- +- Issue #11715: Fix multiarch detection without having Debian development
- Issue #15819: Make sure we can build Python out-of-tree from a readonly source directory. (Somewhat related to Issue #9860.)
--- a/setup.py +++ b/setup.py @@ -351,6 +351,27 @@ class PyBuildExt(build_ext): def add_multiarch_paths(self): # Debian/Ubuntu multiarch support. # https://wiki.ubuntu.com/MultiarchSpec[](#l2.6)
cc = sysconfig.get_config_var('CC')[](#l2.7)
tmpfile = os.path.join(self.build_temp, 'multiarch')[](#l2.8)
if not os.path.exists(self.build_temp):[](#l2.9)
os.makedirs(self.build_temp)[](#l2.10)
ret = os.system([](#l2.11)
'%s -print-multiarch > %s 2> /dev/null' % (cc, tmpfile))[](#l2.12)
multiarch_path_component = ''[](#l2.13)
try:[](#l2.14)
if ret >> 8 == 0:[](#l2.15)
with open(tmpfile) as fp:[](#l2.16)
multiarch_path_component = fp.readline().strip()[](#l2.17)
finally:[](#l2.18)
os.unlink(tmpfile)[](#l2.19)
if multiarch_path_component != '':[](#l2.21)
add_dir_to_list(self.compiler.library_dirs,[](#l2.22)
'/usr/lib/' + multiarch_path_component)[](#l2.23)
add_dir_to_list(self.compiler.include_dirs,[](#l2.24)
'/usr/include/' + multiarch_path_component)[](#l2.25)
return[](#l2.26)
+ if not find_executable('dpkg-architecture'): return tmpfile = os.path.join(self.build_temp, 'multiarch')