Skip to content

Commit

Permalink
Merge pull request #3928 from chewi/master
Browse files Browse the repository at this point in the history
Respect the PKG_CONFIG environment variable when building
  • Loading branch information
hugovk committed Jul 1, 2019
2 parents 555e305 + 15cd8ed commit 7585136
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setup.py
Expand Up @@ -242,8 +242,9 @@ def get_version():

def _pkg_config(name):
try:
command_libs = ["pkg-config", "--libs-only-L", name]
command_cflags = ["pkg-config", "--cflags-only-I", name]
command = os.environ.get("PKG_CONFIG", "pkg-config")
command_libs = [command, "--libs-only-L", name]
command_cflags = [command, "--cflags-only-I", name]
if not DEBUG:
command_libs.append("--silence-errors")
command_cflags.append("--silence-errors")
Expand Down Expand Up @@ -347,7 +348,7 @@ def build_extensions(self):
_add_directory(include_dirs, "src/libImaging")

pkg_config = None
if _cmd_exists("pkg-config"):
if _cmd_exists(os.environ.get("PKG_CONFIG", "pkg-config")):
pkg_config = _pkg_config

#
Expand Down

0 comments on commit 7585136

Please sign in to comment.