Index: build/linux/pkg-config-wrapper |
diff --git a/build/linux/pkg-config-wrapper b/build/linux/pkg-config-wrapper |
index 4b5455b8e9a0522822b6151268d06735c9dbe448..0067661a9ba5191e8f425eba2da55d37665567af 100755 |
--- a/build/linux/pkg-config-wrapper |
+++ b/build/linux/pkg-config-wrapper |
@@ -13,17 +13,27 @@ |
# directory of a Chromium OS chroot. |
root="$1" |
-if [ -z "$root" ] |
+shift |
+target_arch="$1" |
+shift |
+ |
+if [ -z "$root" -o -z "$target_arch" ] |
then |
- echo "usage: $0 /path/to/sysroot [pkg-config-arguments] package" >&2 |
+ echo "usage: $0 /path/to/sysroot target_arch [pkg-config-arguments] package" >&2 |
exit 1 |
fi |
+if [ "$target_arch" = "x64" ] |
+then |
+ libpath="lib64" |
+else |
+ libpath="lib" |
+fi |
+ |
rewrite=`dirname $0`/rewrite_dirs.py |
package=${!#} |
-shift |
-config_path=$root/usr/lib/pkgconfig:$root/usr/share/pkgconfig |
+config_path=$root/usr/$libpath/pkgconfig:$root/usr/share/pkgconfig |
set -e |
# Some sysroots, like the Chromium OS ones, may generate paths that are not |
# relative to the sysroot. For example, |