Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix pkg-config handling to make cross-compiling work #4430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
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
setupext: respect $PKG_CONFIG
When cross-compiling, it is common to set the PKG_CONFIG env var to a
custom pkg-config that knows about the target.  Make sure we respect
that just like the standard pkg-config tools suggest (pkg.m4).  If it
isn't set, we use the same default as today -- "pkg-config".
  • Loading branch information
vapier committed May 15, 2015
commit 08d26a80859023963bc2ffb41a0b6aed942685a9
7 changes: 4 additions & 3 deletions 7 setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ def __init__(self):
self.has_pkgconfig = False
else:
self.set_pkgconfig_path()
status, output = getstatusoutput("pkg-config --help")
self.pkgconfig = os.environ.get('PKG_CONFIG', 'pkg-config')
status, output = getstatusoutput("%s --help" % self.pkgconfig)
self.has_pkgconfig = (status == 0)
if not self.has_pkgconfig:
print("IMPORTANT WARNING:")
Expand Down Expand Up @@ -286,7 +287,7 @@ def setup_extension(self, ext, package, default_include_dirs=[],

executable = alt_exec
if self.has_pkgconfig:
executable = 'pkg-config {0}'.format(package)
executable = '%s %s' % (self.pkgconfig, package)

use_defaults = True

Expand Down Expand Up @@ -330,7 +331,7 @@ def get_version(self, package):
return None

status, output = getstatusoutput(
"pkg-config %s --modversion" % (package))
'%s %s --modversion' % (self.pkgconfig, package))
if status == 0:
return output
return None
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.