Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Unified Diff: build/linux/pkg-config-wrapper

Issue 1580643002: Use PKG_CONFIG_LIBDIR to force pkg-config to use sysroot only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_pkg_config
Patch Set: ; Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/linux/pkg-config.py ('k') | build/linux/sysroot_scripts/sysroot-creator.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/linux/pkg-config-wrapper
diff --git a/build/linux/pkg-config-wrapper b/build/linux/pkg-config-wrapper
index 2afb22ba7c5ed0aa3c952b106887f6fc002d2566..2512b38837394e235eacd0edbf99cbcbdb6d8c20 100755
--- a/build/linux/pkg-config-wrapper
+++ b/build/linux/pkg-config-wrapper
@@ -15,6 +15,9 @@
# the PKG_CONFIG_PATH environment variable- these will be prepended to the
# generated paths.
+set -o nounset
+set -o errexit
+
root="$1"
shift
target_arch="$1"
@@ -31,13 +34,7 @@ fi
rewrite=`dirname $0`/rewrite_dirs.py
package=${!#}
-config_path=$root/usr/$libpath/pkgconfig:$root/usr/share/pkgconfig
-
-# prepend any paths specified by the environment
-if [ -n "$PKG_CONFIG_PATH" ]
-then
- config_path="$PKG_CONFIG_PATH:$config_path"
-fi
+libdir=$root/usr/$libpath/pkgconfig:$root/usr/share/pkgconfig
set -e
# Some sysroots, like the Chromium OS ones, may generate paths that are not
@@ -47,6 +44,6 @@ set -e
# relative to /path/to/chroot/build/x86-generic (i.e prefix=/usr).
# To support this correctly, it's necessary to extract the prefix to strip from
# pkg-config's |prefix| variable.
-prefix=`PKG_CONFIG_PATH=$config_path pkg-config --variable=prefix "$package" | sed -e 's|/usr$||'`
-result=`PKG_CONFIG_PATH=$config_path pkg-config "$@"`
+prefix=`PKG_CONFIG_LIBDIR=$libdir pkg-config --variable=prefix "$package" | sed -e 's|/usr$||'`
+result=`PKG_CONFIG_LIBDIR=$libdir pkg-config "$@"`
echo "$result"| $rewrite --sysroot "$root" --strip-prefix "$prefix"
« no previous file with comments | « build/config/linux/pkg-config.py ('k') | build/linux/sysroot_scripts/sysroot-creator.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698