Fix use of 'sysroot' variable in harfbuzz.gyp

The sysroot variable is set conditionally in common.gypi
but not at the nesting level required for other conditional
to depend on it like the one in hardbuzz does.  This means
that sysroot always appeared to be empty to harfbuzz.gyp,
and hence the special handling for ARM linux was required.
This change moves the setting of 'sysroot' up one level of
nesting and defines 'pkg-config' in common.gypi so it can
be shared.

This is the third attempt at a landing. First attempt was
reverted: https://codereview.chromium.org/1151753002

This is a re-land of the second attempt which was
reverted speculatively (wrongly as it turned out):
https://codereview.chromium.org/1158283003

TBR=cpu

Review URL: https://codereview.chromium.org/1146303007

Cr-Original-Commit-Position: refs/heads/master@{#332982}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: dea1c634b5328b1e171ba22698fb7027f338453f
This commit is contained in:
sbc 2015-06-04 18:13:40 -07:00 коммит произвёл Commit bot
Родитель 374051ceb6
Коммит 6ecf098a2f
2 изменённых файлов: 34 добавлений и 36 удалений

Просмотреть файл

@ -85,6 +85,11 @@
# Enable top chrome material design.
'enable_topchrome_md%' : 0,
# Force building against pre-built sysroot image on linux. By default
# the sysroot image is only used for Official builds or when cross
# compiling to arm or mips.
'use_sysroot%': 0,
# Override buildtype to select the desired build flavor.
# Dev - everyday build for development/testing
# Official - release build (generally implies additional processing)
@ -177,7 +182,6 @@
# The system root for cross-compiles. Default: none.
'sysroot%': '',
'use_sysroot%': 0,
'chroot_cmd%': '',
# The system libdir used for this ABI.
@ -282,6 +286,27 @@
['target_arch=="mipsel"', {
'mips_arch_variant%': 'r1',
}],
['OS=="linux" and target_arch=="arm" and chromeos==0', {
# sysroot needs to be an absolute path otherwise it generates
# incorrect results when passed to pkg-config
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
}], # OS=="linux" and target_arch=="arm" and chromeos==0
['OS=="linux" and ((branding=="Chrome" and buildtype=="Official" and chromeos==0) or use_sysroot==1)' , {
'conditions': [
['target_arch=="x64"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
}],
['target_arch=="ia32"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
}],
],
}], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
['OS=="linux" and target_arch=="mipsel"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
}],
],
},
@ -933,28 +958,6 @@
'enable_settings_app%': 0,
}],
['OS=="linux" and target_arch=="arm" and chromeos==0', {
# sysroot needs to be an absolute path otherwise it generates
# incorrect results when passed to pkg-config
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot',
}], # OS=="linux" and target_arch=="arm" and chromeos==0
['OS=="linux" and ((branding=="Chrome" and buildtype=="Official" and chromeos==0) or use_sysroot==1)' , {
'conditions': [
['target_arch=="x64"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_amd64-sysroot',
}],
['target_arch=="ia32"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_i386-sysroot',
}],
],
}], # OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0
['OS=="linux" and target_arch=="mipsel"', {
'sysroot%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/sysroot',
'CXX%': '<!(cd <(DEPTH) && pwd -P)/mipsel-sysroot/bin/mipsel-linux-gnu-gcc',
}],
# Whether tests targets should be run, archived or just have the
# dependencies verified. All the tests targets have the '_run' suffix,
# e.g. base_unittests_run runs the target base_unittests. The test
@ -1009,6 +1012,12 @@
}, {
'sas_dll_path%': '<(DEPTH)/third_party/platformsdk_win7/files/redist/x86',
}],
['sysroot!=""', {
'pkg-config': '<(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
}, {
'pkg-config': 'pkg-config'
}],
],
# Setting this to '0' will cause V8's startup snapshot to be
@ -1109,7 +1118,7 @@
'chromecast%': '<(chromecast)',
'enable_viewport%': '<(enable_viewport)',
'enable_hidpi%': '<(enable_hidpi)',
'enable_topchrome_md%': '<(enable_topchrome_md)',
'enable_topchrome_md%': '<(enable_topchrome_md)',
'image_loader_extension%': '<(image_loader_extension)',
'fastbuild%': '<(fastbuild)',
'dont_embed_build_metadata%': '<(dont_embed_build_metadata)',
@ -1120,6 +1129,7 @@
'arm_neon%': '<(arm_neon)',
'arm_neon_optional%': '<(arm_neon_optional)',
'sysroot%': '<(sysroot)',
'pkg-config%': '<(pkg-config)',
'chroot_cmd%': '<(chroot_cmd)',
'system_libdir%': '<(system_libdir)',
'component%': '<(component)',
@ -1598,10 +1608,6 @@
'nacl_untrusted_build%': 0,
'use_allocator%': 'none',
}],
['OS=="linux" and target_arch=="mipsel"', {
'sysroot%': '<(sysroot)',
'CXX%': '<(CXX)',
}],
# Use a 64-bit linker to avoid running out of address space. The
# buildbots should have a 64-bit kernel and a 64-bit libc installed.
['host_arch=="ia32" and target_arch=="ia32"', {

Просмотреть файл

@ -4,14 +4,6 @@
{
'variables': {
'conditions': [
['sysroot!=""', {
'pkg-config': '<(chroot_cmd) ./pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
}, {
'pkg-config': 'pkg-config',
}],
],
# If any of the linux_link_FOO below are set to 1, then the corresponding
# target will be linked against the FOO library (either dynamically or
# statically, depending on the pkg-config files), as opposed to loading the