diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 01:53:01 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 01:53:01 +0000 |
commit | ee28c9fa1dc4b7d092ddea96e2c19d41970e18bb (patch) | |
tree | 68f4f01503522cec6442f03198ee2acf3ec01827 /build/linux/system.gyp | |
parent | 60f2ea2a43fd576f8e88ae85929a423f686889b0 (diff) | |
download | chromium_src-ee28c9fa1dc4b7d092ddea96e2c19d41970e18bb.zip chromium_src-ee28c9fa1dc4b7d092ddea96e2c19d41970e18bb.tar.gz chromium_src-ee28c9fa1dc4b7d092ddea96e2c19d41970e18bb.tar.bz2 |
linux: improve support for cross-compiling
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: svn://svn.chromium.org/chrome/trunk/src@25418 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/linux/system.gyp')
-rw-r--r-- | build/linux/system.gyp | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/build/linux/system.gyp b/build/linux/system.gyp index e10c905..7b6d82c 100644 --- a/build/linux/system.gyp +++ b/build/linux/system.gyp @@ -3,21 +3,33 @@ # found in the LICENSE file. { + 'variables' : { + 'includes': [ + '../common.gypi', + ], + 'conditions': [ + ['sysroot!=""', { + 'pkg-config': './pkg-config-wrapper "<(sysroot)"', + }, { + 'pkg-config': 'pkg-config' + }], + ], + }, 'targets': [ { 'target_name': 'gtk', 'type': 'settings', 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags gtk+-2.0 gthread-2.0)', + '<!@(<(pkg-config) --cflags gtk+-2.0 gthread-2.0)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l gtk+-2.0 gthread-2.0)', + '<!@(<(pkg-config) --libs-only-l gtk+-2.0 gthread-2.0)', ], }, }, @@ -26,15 +38,15 @@ 'type': 'settings', 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags nss)', + '<!@(<(pkg-config) --cflags nss)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other nss)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l nss)', + '<!@(<(pkg-config) --libs-only-l nss)', ], }, }, @@ -43,15 +55,15 @@ 'type': 'settings', 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags freetype2)', + '<!@(<(pkg-config) --cflags freetype2)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other freetype2)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l freetype2)', + '<!@(<(pkg-config) --libs-only-l freetype2)', ], }, }, @@ -60,15 +72,15 @@ 'type': 'settings', 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags fontconfig)', + '<!@(<(pkg-config) --cflags fontconfig)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other fontconfig)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l fontconfig)', + '<!@(<(pkg-config) --libs-only-l fontconfig)', ], }, }, @@ -77,15 +89,15 @@ 'type': 'settings', 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags gdk-2.0)', + '<!@(<(pkg-config) --cflags gdk-2.0)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other gdk-2.0)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l gdk-2.0)', + '<!@(<(pkg-config) --libs-only-l gdk-2.0)', ], }, }, @@ -94,15 +106,15 @@ 'type': 'settings', 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags gconf-2.0)', + '<!@(<(pkg-config) --cflags gconf-2.0)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other gconf-2.0)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l gconf-2.0)', + '<!@(<(pkg-config) --libs-only-l gconf-2.0)', ], }, }, @@ -111,15 +123,15 @@ 'type': 'settings', 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags x11)', + '<!@(<(pkg-config) --cflags x11)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other x11)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other x11)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l x11)', + '<!@(<(pkg-config) --libs-only-l x11)', ], }, }, @@ -131,15 +143,15 @@ # 'type': 'settings', # 'direct_dependent_settings': { # 'cflags': [ -# '<!@(pkg-config --cflags gnome-keyring-1)', +# '<!@(<(pkg-config) --cflags gnome-keyring-1)', # ], # }, # 'link_settings': { # 'ldflags': [ -# '<!@(pkg-config --libs-only-L --libs-only-other gnome-keyring-1)', +# '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)', # ], # 'libraries': [ -# '<!@(pkg-config --libs-only-l gnome-keyring-1)', +# '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)', # ], # }, # }, @@ -148,15 +160,15 @@ # 'type': 'settings', # 'direct_dependent_settings': { # 'cflags': [ -# '<!@(pkg-config --cflags dbus-glib-1)', +# '<!@(<(pkg-config) --cflags dbus-glib-1)', # ], # }, # 'link_settings': { # 'ldflags': [ -# '<!@(pkg-config --libs-only-L --libs-only-other dbus-glib-1)', +# '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-glib-1)', # ], # 'libraries': [ -# '<!@(pkg-config --libs-only-l dbus-glib-1)', +# '<!@(<(pkg-config) --libs-only-l dbus-glib-1)', # ], # }, # }, |