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

Side by Side Diff: build/linux/pkg-config-wrapper

Issue 4516002: Fix pkg-config-wrapper to work with chromiumos chroots (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Strip prefix instead of hacking libdir etc. Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | build/linux/rewrite_dirs.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/bash
2 2
3 root="$1" 3 root="$1"
4 if [ -z "$root" ] 4 if [ -z "$root" ]
5 then 5 then
6 echo "usage: $0 /path/to/sysroot [pkg-config-arguments]" >&2 6 echo "usage: $0 /path/to/sysroot [pkg-config-arguments] package" >&2
7 exit 1 7 exit 1
8 fi 8 fi
9 9
10 rewrite=`dirname $0`/rewrite_dirs.py 10 rewrite=`dirname $0`/rewrite_dirs.py
11 package=${!#}
11 12
12 shift 13 shift
13 config_path=$root/usr/lib/pkgconfig:$root/usr/share/pkgconfig 14 config_path=$root/usr/lib/pkgconfig:$root/usr/share/pkgconfig
14 set -e 15 set -e
15 result=`PKG_CONFIG_PATH=$config_path pkg-config --define-variable=prefix=/usr "$ @"` 16 # Some sysroots, like the Chromium OS ones, may generate paths that are not
16 echo "$result"| $rewrite $root 17 # relative to the sysroot. For example,
18 # /path/to/chroot/build/x86-generic/usr/lib/pkgconfig/pkg.pc may have all paths
19 # relative to /path/to/chroot (i.e. prefix=/build/x86-generic/usr) instead of
20 # relative to /path/to/chroot/build/x86-generic (i.e prefix=/usr).
21 # To support this correctly, it's necessary to extract the prefix to strip from
22 # pkg-config's |prefix| variable.
23 prefix=`PKG_CONFIG_PATH=$config_path pkg-config --variable=prefix "$package" | s ed -e 's|/usr$||'`
24 result=`PKG_CONFIG_PATH=$config_path pkg-config "$@"`
25 echo "$result"| $rewrite --sysroot "$root" --strip-prefix "$prefix"
OLDNEW
« no previous file with comments | « no previous file | build/linux/rewrite_dirs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698