Merge pull request #3928 from chewi/master

Respect the PKG_CONFIG environment variable when building
This commit is contained in:
Hugo 2019-07-01 08:31:20 +03:00 committed by GitHub
commit 7585136a3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,8 +242,9 @@ LCMS_ROOT = None
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")
@ -347,7 +348,7 @@ class pil_build_ext(build_ext):
_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
#