Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
build: don't swallow pkg-config warnings
  • Loading branch information
bnoordhuis committed Jun 7, 2019
commit aa5e4cc49c15b6af8ac68907459bc5e6812b5253
8 changes: 5 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,18 +628,20 @@ def pkg_config(pkg):
Returns ("-l flags", "-I flags", "-L flags", "version")
otherwise (None, None, None, None)"""
pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
args = [] # Print pkg-config warnings on first round.
retval = ()
for flag in ['--libs-only-l', '--cflags-only-I',
'--libs-only-L', '--modversion']:
args += [flag, pkg]
try:
proc = subprocess.Popen(
shlex.split(pkg_config) + ['--silence-errors', flag, pkg],
stdout=subprocess.PIPE)
proc = subprocess.Popen(shlex.split(pkg_config) + args,
stdout=subprocess.PIPE)
val = proc.communicate()[0].strip()
except OSError as e:
if e.errno != errno.ENOENT: raise e # Unexpected error.
return (None, None, None, None) # No pkg-config/pkgconf installed.
retval += (val,)
args = ['--silence-errors']
return retval


Expand Down