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
Prev Previous commit
setupext: do not hardcode system -I/-L paths when pkg-config is avail…
…able

If we have pkg-config, then there's no need to hardcode the system -I/-L
paths as the pkg-config files will give us all the info we need.
  • Loading branch information
vapier committed May 16, 2015
commit 43af6b9b64953eef1a1c1f14b32ad3f667da5954
19 changes: 10 additions & 9 deletions 19 setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def make_extension(name, files, *args, **kwargs):
"""
Make a new extension. Automatically sets include_dirs and
library_dirs to the base directories appropriate for this
platform.
platform when pkg-config is not available.

`name` is the name of the extension.

Expand All @@ -228,14 +228,15 @@ def make_extension(name, files, *args, **kwargs):
`distutils.core.Extension` constructor.
"""
ext = DelayedExtension(name, files, *args, **kwargs)
for dir in get_base_dirs():
include_dir = os.path.join(dir, 'include')
if os.path.exists(include_dir):
ext.include_dirs.append(include_dir)
for lib in ('lib', 'lib64'):
lib_dir = os.path.join(dir, lib)
if os.path.exists(lib_dir):
ext.library_dirs.append(lib_dir)
if not self.has_pkgconfig:
for dir in get_base_dirs():
include_dir = os.path.join(dir, 'include')
if os.path.exists(include_dir):
ext.include_dirs.append(include_dir)
for lib in ('lib', 'lib64'):
lib_dir = os.path.join(dir, lib)
if os.path.exists(lib_dir):
ext.library_dirs.append(lib_dir)
ext.include_dirs.append('.')

return ext
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.