http://codereview.chromium.org/4516002/show had to be reverted because it
conflicts with "old style" sysroots that are still used on the arm builders.
This is a cleaner approach that should work there.
The previous approach assumed that all variables in .pc files were relative to |prefix|. It would be a desirable thing to have but in practice a few packages don't follow this and have already dereferenced |prefix| in other variables (e.g. |libdir|). So instead of forcing |prefix|, this version keeps the original one but strips the path before '/usr' (in |prefix|) from all returned paths before prepending the sysroot path.
For example if you have foo.pc:
prefix=/build/board/usr
libdir=/build/board/usr/lib # instead of libdir=${prefix}/lib
Libs: -L${libdir}/foo -lfoo
Then instead of forcing prefix=/usr (which doesn't fix |libdir|), we find the path before '/usr' in prefix ('/build/board'), that we strip from the returned -L flag ('/build/board/usr/lib/foo' -> '/usr/lib/foo') before prepending the sysroot path (-> '/path/to/sysroot/usr/lib/foo').
BUG=None
TEST=build with sysroot=/path/to/chromiumos/chroot/build/x86-generic
Review URL: http://codereview.chromium.org/5105005
git-svn-id: http://src.chromium.org/svn/trunk/src/build@66712 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
When compiling with the new portage build system for Chromium OS,
paths passed in for includes, libraries, etc., are already properly
prefixed with the sysroot and do not need to be again prefixed with
the sysroot.
Review URL: http://codereview.chromium.org/652067
git-svn-id: http://src.chromium.org/svn/trunk/src/build@39655 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This CL adds support for a 'sysroot' GYP define, that should point to the target root filesystem for cross-compilation.
It passes that argument to the compiler and linker which uses it to prefix its hard-coded path (e.g. /usr/include)
It also points pkg-config to look for package configs there, and rewrite the paths to be prefixed by 'sysroot' (since pkg-config doesn't do it itself)
Review URL: http://codereview.chromium.org/199016
git-svn-id: http://src.chromium.org/svn/trunk/src/build@25418 4ff67af0-8c30-449e-8e8b-ad334ec8d88c