Skip to content

Commit 25f2220

Browse files
mobenkeszybz
authored andcommitted
setup.py: respect ${PKG_CONFIG} if set (#18)
1 parent 44acd1c commit 25f2220

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ def call(*cmd):
2929

3030
def pkgconfig(package, **kw):
3131
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
32-
status, result = call('pkg-config', '--libs', '--cflags', package)
32+
pkgconf = os.getenv('PKG_CONFIG', 'pkg-config')
33+
status, result = call(pkgconf, '--libs', '--cflags', package)
3334
if status != 0:
3435
return status, result
3536
for token in result.split():
3637
kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
37-
version = check_output(['pkg-config', '--modversion', package],
38+
version = check_output([pkgconf, '--modversion', package],
3839
universal_newlines=True).strip()
3940
pair = (package.replace('-', '_').upper() + '_VERSION', version)
4041
defines = kw.setdefault('define_macros', [])

0 commit comments

Comments
 (0)