dependencies: allow overriding pkg-config with PKG_CONFIG in check_pkgconfig

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
pull/1086/head
Marc-Antoine Perennou 8 years ago
parent f3bd0d1491
commit e9b2084592
  1. 9
      mesonbuild/dependencies.py

@ -229,12 +229,17 @@ class PkgConfigDependency(Dependency):
def check_pkgconfig(self):
try:
p = subprocess.Popen(['pkg-config', '--version'], stdout=subprocess.PIPE,
evar = 'PKG_CONFIG'
if evar in os.environ:
pkgbin = os.environ[evar].strip()
else:
pkgbin = 'pkg-config'
p = subprocess.Popen([pkgbin, '--version'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()[0]
if p.returncode == 0:
if not self.silent:
mlog.log('Found pkg-config:', mlog.bold(shutil.which('pkg-config')),
mlog.log('Found pkg-config:', mlog.bold(shutil.which(pkgbin)),
'(%s)' % out.decode().strip())
PkgConfigDependency.pkgconfig_found = True
return

Loading…
Cancel
Save