Skip to content

Commit

Permalink
build: allow passing multiple libs to pkg_config
Browse files Browse the repository at this point in the history
Sometimes it's necessary to pass multiple library names to pkg-config,
e.g. the brotli shared libraries can be pulled in with
    pkg-config libbrotlienc libbrotlidec

Update the code to handle both, strings (as used so far), and lists
of strings.

Signed-off-by: André Draszik <git@andred.net>

PR-URL: #32046
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
andred authored and codebytere committed Mar 30, 2020
1 parent efd20f0 commit 6605bba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,11 @@ def pkg_config(pkg):
retval = ()
for flag in ['--libs-only-l', '--cflags-only-I',
'--libs-only-L', '--modversion']:
args += [flag, pkg]
args += [flag]
if isinstance(pkg, list):
args += pkg
else:
args += [pkg]
try:
proc = subprocess.Popen(shlex.split(pkg_config) + args,
stdout=subprocess.PIPE)
Expand Down

0 comments on commit 6605bba

Please sign in to comment.