Patchwork Globally disable PKG_CONFIG_PATH

login
register
mail settings
Submitter Arnout Vandecappelle
Date May 11, 2012, 10:18 p.m.
Message ID <1336774711-20504-1-git-send-email-arnout@mind.be>
Download mbox | patch
Permalink /patch/158620/
State Superseded
Headers show

Comments

Arnout Vandecappelle - May 11, 2012, 10:18 p.m.
If PKG_CONFIG_PATH is set in the environment, it allows pkg-config to
look for libraries outside of the buildroot tree.  This is a problem
both for host and target builds.  To avoid it, globally set an empty
PKG_CONFIG_PATH in the environment.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
--
Tested on Nigel's config.  Without this patch, it breaks when I point
PKG_CONFIG_PATH to dbus-1.pc; with this patch, it works.

---
 Makefile |    3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/Makefile b/Makefile
index 96f9412..99e0a71 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,9 @@  HOSTNM:=$(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTFC HOSTLD
 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
 
+# Make sure pkg-config doesn't look outside the buildroot tree
+unexport PKG_CONFIG_PATH
+
 # bash prints the name of the directory on 'cd <dir>' if CDPATH is
 # set, so unset it here to not cause problems. Notice that the export
 # line doesn't affect the environment of $(shell ..) calls, so