cpython: bd0f73a9538e (original) (raw)
Mercurial > cpython
changeset 69188:bd0f73a9538e 2.7
Backport for Python 2.7 of issue 11715 support for building Python on multiarch Debian/Ubuntu. [#11715]
Barry Warsaw barry@python.org | |
---|---|
date | Thu, 07 Apr 2011 11:28:11 -0400 |
parents | 2e4cdaffe493 |
children | 6fb033af9310 |
files | setup.py |
diffstat | 1 files changed, 23 insertions(+), 0 deletions(-)[+] [-] setup.py 23 |
line wrap: on
line diff
--- a/setup.py +++ b/setup.py @@ -345,10 +345,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)
if not find_executable('dpkg-architecture'):[](#l1.10)
return[](#l1.11)
tmpfile = os.path.join(self.build_temp, 'multiarch')[](#l1.12)
if not os.path.exists(self.build_temp):[](#l1.13)
os.makedirs(self.build_temp)[](#l1.14)
ret = os.system([](#l1.15)
'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %[](#l1.16)
tmpfile)[](#l1.17)
try:[](#l1.18)
if ret >> 8 == 0:[](#l1.19)
with open(tmpfile) as fp:[](#l1.20)
multiarch_path_component = fp.readline().strip()[](#l1.21)
add_dir_to_list(self.compiler.library_dirs,[](#l1.22)
'/usr/lib/' + multiarch_path_component)[](#l1.23)
add_dir_to_list(self.compiler.include_dirs,[](#l1.24)
'/usr/include/' + multiarch_path_component)[](#l1.25)
finally:[](#l1.26)
os.unlink(tmpfile)[](#l1.27)
+ def detect_modules(self): # Ensure that /usr/local is always used 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.