Merge pull request #6896 from sebastic/tiff-multiarch

Handle more than one directory returned by pkg-config
This commit is contained in:
Andrew Murray 2023-01-29 18:40:06 +11:00 committed by GitHub
commit 6a700693a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,18 +263,18 @@ def _pkg_config(name):
if not DEBUG: if not DEBUG:
command_libs.append("--silence-errors") command_libs.append("--silence-errors")
command_cflags.append("--silence-errors") command_cflags.append("--silence-errors")
libs = ( libs = re.split(
r"(^|\s+)-L",
subprocess.check_output(command_libs, stderr=stderr) subprocess.check_output(command_libs, stderr=stderr)
.decode("utf8") .decode("utf8")
.strip() .strip(),
.replace("-L", "") )[::2][1:]
) cflags = re.split(
cflags = ( r"(^|\s+)-I",
subprocess.check_output(command_cflags) subprocess.check_output(command_cflags, stderr=stderr)
.decode("utf8") .decode("utf8")
.strip() .strip(),
.replace("-I", "") )[::2][1:]
)
return libs, cflags return libs, cflags
except Exception: except Exception:
pass pass
@ -473,8 +473,12 @@ class pil_build_ext(build_ext):
else: else:
lib_root = include_root = root lib_root = include_root = root
_add_directory(library_dirs, lib_root) if lib_root is not None:
_add_directory(include_dirs, include_root) for lib_dir in lib_root:
_add_directory(library_dirs, lib_dir)
if include_root is not None:
for include_dir in include_root:
_add_directory(include_dirs, include_dir)
# respect CFLAGS/CPPFLAGS/LDFLAGS # respect CFLAGS/CPPFLAGS/LDFLAGS
for k in ("CFLAGS", "CPPFLAGS", "LDFLAGS"): for k in ("CFLAGS", "CPPFLAGS", "LDFLAGS"):