]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Allow Manual Overriding of pkg-config Lib and Include Dirs
authorW. Felix Handte <w@felixhandte.com>
Tue, 18 Feb 2020 18:17:17 +0000 (13:17 -0500)
committerW. Felix Handte <w@felixhandte.com>
Tue, 18 Feb 2020 18:17:17 +0000 (13:17 -0500)
When the `PCLIBDIR` or `PCINCDIR` is non-empty (either because we succeeded
in removing the prefix, or because it was manually set), we don't need to
perform the check. This lets us trust users who go to the trouble of setting
a manual override, rather than still blindly failing the make.

They'll still be prefixed with `${prefix}/` / `${exec_prefix}/` in the
pkg-config file though.

lib/Makefile

index dbd64994c8334d80dfd0dc56f3435562f7202f29..b067c11a2e5e35379001e9d2c1b57820bb271732 100644 (file)
@@ -227,12 +227,21 @@ INCLUDEDIR  ?= $(includedir)
 PCLIBDIR ?= $(shell echo "$(LIBDIR)" | sed -n -e "s@^$(exec_prefix)\\(/\\|$$\\)@@p")
 PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | sed -n -e "s@^$(prefix)\\(/\\|$$\\)@@p")
 
+ifeq (,$(PCLIBDIR))
+# Additional prefix check is required, since the empty string is technically a
+# valid PCLIBDIR
 ifeq (,$(shell echo "$(LIBDIR)" | sed -n -e "\\@^$(exec_prefix)\\(/\\|$$\\)@ p"))
 $(error configured libdir ($(LIBDIR)) is outside of prefix ($(prefix)), can't generate pkg-config file)
 endif
+endif
+
+ifeq (,$(PCINCDIR))
+# Additional prefix check is required, since the empty string is technically a
+# valid PCINCDIR
 ifeq (,$(shell echo "$(INCLUDEDIR)" | sed -n -e "\\@^$(prefix)\\(/\\|$$\\)@ p"))
 $(error configured includedir ($(INCLUDEDIR)) is outside of exec_prefix ($(exec_prefix)), can't generate pkg-config file)
 endif
+endif
 
 ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
 PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig