cpython: 867937dd2279 (original) (raw)
Mercurial > cpython
changeset 69175:867937dd2279 3.2
Issue 11715: Merge multiarch fix from 3.1 branch.
Barry Warsaw barry@python.org | |
---|---|
date | Wed, 06 Apr 2011 15:19:05 -0400 |
parents | b807cf929e26(current diff)7582a78f573b(diff) |
children | 3f00611c3daf c4a514199dba |
files | setup.py |
diffstat | 1 files changed, 21 insertions(+), 0 deletions(-)[+] [-] setup.py 21 |
line wrap: on
line diff
--- a/setup.py +++ b/setup.py @@ -370,12 +370,33 @@ class PyBuildExt(build_ext): return platform return sys.platform
- def add_multiarch_paths(self):
# Debian/Ubuntu multiarch support.[](#l1.8)
# https://wiki.ubuntu.com/MultiarchSpec[](#l1.9)
tmpfile = os.path.join(self.build_temp, 'multiarch')[](#l1.10)
if not os.path.exists(self.build_temp):[](#l1.11)
os.makedirs(self.build_temp)[](#l1.12)
ret = os.system([](#l1.13)
'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %[](#l1.14)
tmpfile)[](#l1.15)
try:[](#l1.16)
if ret >> 8 == 0:[](#l1.17)
with open(tmpfile) as fp:[](#l1.18)
multiarch_path_component = fp.readline().strip()[](#l1.19)
add_dir_to_list(self.compiler.library_dirs,[](#l1.20)
'/usr/lib/' + multiarch_path_component)[](#l1.21)
add_dir_to_list(self.compiler.include_dirs,[](#l1.22)
'/usr/include/' + multiarch_path_component)[](#l1.23)
finally:[](#l1.24)
os.unlink(tmpfile)[](#l1.25)
+ def detect_modules(self): # Ensure that /usr/local is always used, but the local build # directories (i.e. '.' and 'Include') must be first. See issue # 10520. add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
self.add_multiarch_paths()[](#l1.33)
# Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files.