diff options
author | Kristian Monsen <kristianm@google.com> | 2011-05-24 16:24:13 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-05-25 14:13:32 +0100 |
commit | 3f50c38dc070f4bb515c1b64450dae14f316474e (patch) | |
tree | 29f309f9534e05c47244eedb438fc612578d133b /build/linux/.svn/text-base/pkg-config-wrapper.svn-base | |
parent | e23bef148f7be2bdf9c3cb2cd3aa5ceebf1190fb (diff) | |
download | external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.zip external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.gz external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.bz2 |
Merge Chromium at r10.0.634.0: Initial merge by git.
Change-Id: Iac2af492818d119bcc2562eb5fdabf5ab0b6df9c
Diffstat (limited to 'build/linux/.svn/text-base/pkg-config-wrapper.svn-base')
-rw-r--r-- | build/linux/.svn/text-base/pkg-config-wrapper.svn-base | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/build/linux/.svn/text-base/pkg-config-wrapper.svn-base b/build/linux/.svn/text-base/pkg-config-wrapper.svn-base new file mode 100644 index 0000000..4b5455b --- /dev/null +++ b/build/linux/.svn/text-base/pkg-config-wrapper.svn-base @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This program wraps around pkg-config to generate the correct include and +# library paths when cross-compiling using a sysroot. +# The assumption is that the sysroot contains the .pc files in usr/lib/pkgconfig +# and usr/share/pkgconfig (relative to the sysroot) and that they output paths +# relative to some parent path of the sysroot. +# This assumption is valid for a range of sysroots, in particular: a +# LSB-compliant root filesystem mounted at the sysroot, and a board build +# directory of a Chromium OS chroot. + +root="$1" +if [ -z "$root" ] +then + echo "usage: $0 /path/to/sysroot [pkg-config-arguments] package" >&2 + exit 1 +fi + +rewrite=`dirname $0`/rewrite_dirs.py +package=${!#} + +shift +config_path=$root/usr/lib/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, +# /path/to/chroot/build/x86-generic/usr/lib/pkgconfig/pkg.pc may have all paths +# relative to /path/to/chroot (i.e. prefix=/build/x86-generic/usr) instead of +# 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 "$@"` +echo "$result"| $rewrite --sysroot "$root" --strip-prefix "$prefix" |