Only default to dpkg-architecture output in Debian derivatives

pull/940/merge
Jouni Kosonen 8 years ago
parent 263cb6a5f0
commit 1ed3317a8b
  1. 20
      mesonbuild/mesonlib.py

@ -165,15 +165,17 @@ def version_compare(vstr1, vstr2):
return cmpop(varr1, varr2)
def default_libdir():
try:
pc = subprocess.Popen(['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
(stdo, _) = pc.communicate()
if pc.returncode == 0:
archpath = stdo.decode().strip()
return 'lib/' + archpath
except Exception:
pass
if is_debianlike():
try:
pc = subprocess.Popen(['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
(stdo, _) = pc.communicate()
if pc.returncode == 0:
archpath = stdo.decode().strip()
return 'lib/' + archpath
except Exception:
pass
if os.path.isdir('/usr/lib64'):
return 'lib64'
return 'lib'

Loading…
Cancel
Save