diff options
-rwxr-xr-x | build/check_return_value.py | 15 | ||||
-rw-r--r-- | build/common.gypi | 46 | ||||
-rw-r--r-- | third_party/harfbuzz-ng/harfbuzz.gyp | 323 |
3 files changed, 234 insertions, 150 deletions
diff --git a/build/check_return_value.py b/build/check_return_value.py new file mode 100755 index 0000000..6f0daec --- /dev/null +++ b/build/check_return_value.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +# Copyright 2014 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 an arbitrary command and prints "1" if the command ran +successfully.""" + +import subprocess +import sys + +if not subprocess.call(sys.argv[1:]): + print 1 +else: + print 0 diff --git a/build/common.gypi b/build/common.gypi index 4f64932..4cc5eb2 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -35,6 +35,15 @@ # Configure the build for small devices. See crbug.com/318413 'embedded%': 0, + + 'conditions': [ + # Compute the architecture that we're building on. + ['OS=="win" or OS=="mac" or OS=="ios"', { + 'host_arch%': 'ia32', + }, { + 'host_arch%': '<!(python <(DEPTH)/build/linux/detect_host_arch.py)', + }], + ], }, # Copy conditionally-set variables out one scope. 'chromeos%': '<(chromeos)', @@ -43,6 +52,7 @@ 'use_cras%': '<(use_cras)', 'use_ozone%': '<(use_ozone)', 'embedded%': '<(embedded)', + 'host_arch%': '<(host_arch)', # Whether we are using Views Toolkit 'toolkit_views%': 0, @@ -96,13 +106,6 @@ 'desktop_linux%': 0, }], - # Compute the architecture that we're building on. - ['OS=="win" or OS=="mac" or OS=="ios"', { - 'host_arch%': 'ia32', - }, { - 'host_arch%': '<!(python <(DEPTH)/build/linux/detect_host_arch.py)', - }], - # Embedded implies ozone. ['embedded==1', { 'use_ozone%': 1, @@ -113,6 +116,14 @@ }, { 'use_system_fontconfig%': 1, }], + + ['OS=="android"', { + 'target_arch%': 'arm', + }, { + # Default architecture we're building for is the architecture we're + # building on, and possibly sub-architecture (for iOS builds). + 'target_arch%': '<(host_arch)', + }], ], }, # Copy conditionally-set variables out one scope. @@ -130,6 +141,7 @@ 'buildtype%': '<(buildtype)', 'branding%': '<(branding)', 'host_arch%': '<(host_arch)', + 'target_arch%': '<(target_arch)', 'target_subarch%': '', @@ -151,6 +163,10 @@ 'use_goma%': 0, 'gomadir%': '', + # The system root for cross-compiles. Default: none. + 'sysroot%': '', + 'chroot_cmd%': '', + 'conditions': [ # Ash needs Aura. ['use_aura==0', { @@ -221,13 +237,6 @@ ['OS=="ios"', { 'target_subarch%': 'arm32', }], - ['OS=="android"', { - 'target_arch%': 'arm', - }, { - # Default architecture we're building for is the architecture we're - # building on, and possibly sub-architecture (for iOS builds). - 'target_arch%': '<(host_arch)', - }], ], }, @@ -258,6 +267,8 @@ 'buildtype%': '<(buildtype)', 'branding%': '<(branding)', 'arm_version%': '<(arm_version)', + 'sysroot%': '<(sysroot)', + 'chroot_cmd%': '<(chroot_cmd)', # Whether content/chrome is using mojo: see http://crbug.com/353602 'use_mojo%': 0, @@ -286,10 +297,6 @@ # Detect NEON support at run-time. 'arm_neon_optional%': 0, - # The system root for cross-compiles. Default: none. - 'sysroot%': '', - 'chroot_cmd%': '', - # The system libdir used for this ABI. 'system_libdir%': 'lib', @@ -3027,8 +3034,7 @@ }, }, 'conditions': [ - # TODO(jochen): Enable this on chromeos. http://crbug.com/353127 - ['os_posix==1 and chromeos==0', { + ['os_posix==1 and (chromeos==0 or target_arch!="arm")', { 'target_defaults': { 'ldflags': [ '-Wl,--fatal-warnings', diff --git a/third_party/harfbuzz-ng/harfbuzz.gyp b/third_party/harfbuzz-ng/harfbuzz.gyp index ec2b12a..07b3a95 100644 --- a/third_party/harfbuzz-ng/harfbuzz.gyp +++ b/third_party/harfbuzz-ng/harfbuzz.gyp @@ -6,142 +6,205 @@ 'includes': [ '../../build/win_precompile.gypi', ], - 'targets': [ - { - 'target_name': 'harfbuzz-ng', - 'type': 'static_library', - 'defines': [ - 'HAVE_OT', - 'HAVE_ICU', - 'HAVE_ICU_BUILTIN', - 'HB_NO_MT', - ], - 'sources': [ - 'src/hb-atomic-private.hh', - 'src/hb-blob.cc', - 'src/hb-blob.h', - 'src/hb-buffer.cc', - 'src/hb-buffer-deserialize-json.hh', - 'src/hb-buffer-deserialize-text.hh', - 'src/hb-buffer.h', - 'src/hb-buffer-private.hh', - 'src/hb-buffer-serialize.cc', - 'src/hb-cache-private.hh', - 'src/hb-common.cc', - 'src/hb-common.h', - 'src/hb-deprecated.h', - 'src/hb-face.cc', - 'src/hb-face.h', - 'src/hb-face-private.hh', - 'src/hb-fallback-shape.cc', - 'src/hb-font.cc', - 'src/hb-font.h', - 'src/hb-font-private.hh', - 'src/hb.h', - 'src/hb-icu.cc', - 'src/hb-icu.h', - 'src/hb-mutex-private.hh', - 'src/hb-object-private.hh', - 'src/hb-open-file-private.hh', - 'src/hb-open-type-private.hh', - 'src/hb-ot.h', - 'src/hb-ot-head-table.hh', - 'src/hb-ot-hhea-table.hh', - 'src/hb-ot-hmtx-table.hh', - 'src/hb-ot-layout.cc', - 'src/hb-ot-layout-common-private.hh', - 'src/hb-ot-layout-gdef-table.hh', - 'src/hb-ot-layout-gpos-table.hh', - 'src/hb-ot-layout-gsubgpos-private.hh', - 'src/hb-ot-layout-gsub-table.hh', - 'src/hb-ot-layout.h', - 'src/hb-ot-layout-private.hh', - 'src/hb-ot-map.cc', - 'src/hb-ot-map-private.hh', - 'src/hb-ot-maxp-table.hh', - 'src/hb-ot-name-table.hh', - 'src/hb-ot-shape.cc', - 'src/hb-ot-shape-complex-arabic.cc', - 'src/hb-ot-shape-complex-arabic-fallback.hh', - 'src/hb-ot-shape-complex-arabic-table.hh', - 'src/hb-ot-shape-complex-default.cc', - 'src/hb-ot-shape-complex-hangul.cc', - 'src/hb-ot-shape-complex-hebrew.cc', - 'src/hb-ot-shape-complex-indic.cc', - 'src/hb-ot-shape-complex-indic-machine.hh', - 'src/hb-ot-shape-complex-indic-private.hh', - 'src/hb-ot-shape-complex-indic-table.cc', - 'src/hb-ot-shape-complex-myanmar.cc', - 'src/hb-ot-shape-complex-myanmar-machine.hh', - 'src/hb-ot-shape-complex-private.hh', - 'src/hb-ot-shape-complex-sea.cc', - 'src/hb-ot-shape-complex-sea-machine.hh', - 'src/hb-ot-shape-complex-thai.cc', - 'src/hb-ot-shape-complex-tibetan.cc', - 'src/hb-ot-shape-fallback.cc', - 'src/hb-ot-shape-fallback-private.hh', - 'src/hb-ot-shape.h', - 'src/hb-ot-shape-normalize.cc', - 'src/hb-ot-shape-normalize-private.hh', - 'src/hb-ot-shape-private.hh', - 'src/hb-ot-tag.cc', - 'src/hb-ot-tag.h', - 'src/hb-private.hh', - 'src/hb-set.cc', - 'src/hb-set.h', - 'src/hb-set-private.hh', - 'src/hb-shape.cc', - 'src/hb-shape.h', - 'src/hb-shape-plan.cc', - 'src/hb-shape-plan.h', - 'src/hb-shape-plan-private.hh', - 'src/hb-shaper.cc', - 'src/hb-shaper-impl-private.hh', - 'src/hb-shaper-list.hh', - 'src/hb-shaper-private.hh', - 'src/hb-unicode.cc', - 'src/hb-unicode.h', - 'src/hb-unicode-private.hh', - 'src/hb-utf-private.hh', - 'src/hb-version.h', - 'src/hb-warning.cc', - ], - 'include_dirs': [ - 'src', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - 'src', - ], - }, - 'dependencies': [ - '../../third_party/icu/icu.gyp:icuuc', - ], + 'variables': { + 'variables': { 'conditions': [ - ['clang==1', { - 'xcode_settings': { - 'WARNING_CFLAGS': [ - '-Wno-unused-value', - ], - }, - 'cflags': [ - '-Wno-unused-value', - ] + ['sysroot!=""', { + 'pkg-config': '<(chroot_cmd) ../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"', + }, { + 'pkg-config': 'pkg-config' }], - ['OS=="win"', { - # TODO(eae): C4267 on amd64. size_t -> int, size_t -> unsigned int - 'msvs_disabled_warnings': [4267, 4334], - }], - ['OS=="mac"', { + ], + }, + + 'pkg-config': '<(pkg-config)', + + 'conditions': [ + ['OS=="linux" and (buildtype!="Official" or chromeos==1)', { + # Since version 1.31.0, pangoft2 which we depend on pulls in harfbuzz + # anyways. However, we want to have control of the version of harfbuzz + # we use, so don't use system harfbuzz for official builds unless we're + # building chromeos in which case we have the system harfbuzz under + # control as well. + 'use_system_harfbuzz': '<!(python ../../build/check_return_value.py <(pkg-config) --atleast-version=1.31.0 pangoft2)', + }, { + 'use_system_harfbuzz': 0, + }], + ], + }, + 'conditions': [ + ['use_system_harfbuzz==0', { + 'targets': [ + { + 'target_name': 'harfbuzz-ng', + 'type': 'static_library', 'defines': [ - 'HAVE_CORETEXT', + 'HAVE_OT', + 'HAVE_ICU', + 'HAVE_ICU_BUILTIN', + 'HB_NO_MT', ], 'sources': [ - 'src/hb-coretext.cc', - 'src/hb-coretext.h', + 'src/hb-atomic-private.hh', + 'src/hb-blob.cc', + 'src/hb-blob.h', + 'src/hb-buffer.cc', + 'src/hb-buffer-deserialize-json.hh', + 'src/hb-buffer-deserialize-text.hh', + 'src/hb-buffer.h', + 'src/hb-buffer-private.hh', + 'src/hb-buffer-serialize.cc', + 'src/hb-cache-private.hh', + 'src/hb-common.cc', + 'src/hb-common.h', + 'src/hb-deprecated.h', + 'src/hb-face.cc', + 'src/hb-face.h', + 'src/hb-face-private.hh', + 'src/hb-fallback-shape.cc', + 'src/hb-font.cc', + 'src/hb-font.h', + 'src/hb-font-private.hh', + 'src/hb.h', + 'src/hb-icu.cc', + 'src/hb-icu.h', + 'src/hb-mutex-private.hh', + 'src/hb-object-private.hh', + 'src/hb-open-file-private.hh', + 'src/hb-open-type-private.hh', + 'src/hb-ot.h', + 'src/hb-ot-head-table.hh', + 'src/hb-ot-hhea-table.hh', + 'src/hb-ot-hmtx-table.hh', + 'src/hb-ot-layout.cc', + 'src/hb-ot-layout-common-private.hh', + 'src/hb-ot-layout-gdef-table.hh', + 'src/hb-ot-layout-gpos-table.hh', + 'src/hb-ot-layout-gsubgpos-private.hh', + 'src/hb-ot-layout-gsub-table.hh', + 'src/hb-ot-layout.h', + 'src/hb-ot-layout-private.hh', + 'src/hb-ot-map.cc', + 'src/hb-ot-map-private.hh', + 'src/hb-ot-maxp-table.hh', + 'src/hb-ot-name-table.hh', + 'src/hb-ot-shape.cc', + 'src/hb-ot-shape-complex-arabic.cc', + 'src/hb-ot-shape-complex-arabic-fallback.hh', + 'src/hb-ot-shape-complex-arabic-table.hh', + 'src/hb-ot-shape-complex-default.cc', + 'src/hb-ot-shape-complex-hangul.cc', + 'src/hb-ot-shape-complex-hebrew.cc', + 'src/hb-ot-shape-complex-indic.cc', + 'src/hb-ot-shape-complex-indic-machine.hh', + 'src/hb-ot-shape-complex-indic-private.hh', + 'src/hb-ot-shape-complex-indic-table.cc', + 'src/hb-ot-shape-complex-myanmar.cc', + 'src/hb-ot-shape-complex-myanmar-machine.hh', + 'src/hb-ot-shape-complex-private.hh', + 'src/hb-ot-shape-complex-sea.cc', + 'src/hb-ot-shape-complex-sea-machine.hh', + 'src/hb-ot-shape-complex-thai.cc', + 'src/hb-ot-shape-complex-tibetan.cc', + 'src/hb-ot-shape-fallback.cc', + 'src/hb-ot-shape-fallback-private.hh', + 'src/hb-ot-shape.h', + 'src/hb-ot-shape-normalize.cc', + 'src/hb-ot-shape-normalize-private.hh', + 'src/hb-ot-shape-private.hh', + 'src/hb-ot-tag.cc', + 'src/hb-ot-tag.h', + 'src/hb-private.hh', + 'src/hb-set.cc', + 'src/hb-set.h', + 'src/hb-set-private.hh', + 'src/hb-shape.cc', + 'src/hb-shape.h', + 'src/hb-shape-plan.cc', + 'src/hb-shape-plan.h', + 'src/hb-shape-plan-private.hh', + 'src/hb-shaper.cc', + 'src/hb-shaper-impl-private.hh', + 'src/hb-shaper-list.hh', + 'src/hb-shaper-private.hh', + 'src/hb-unicode.cc', + 'src/hb-unicode.h', + 'src/hb-unicode-private.hh', + 'src/hb-utf-private.hh', + 'src/hb-version.h', + 'src/hb-warning.cc', ], - }], + 'include_dirs': [ + 'src', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'src', + ], + }, + 'dependencies': [ + '../../third_party/icu/icu.gyp:icuuc', + ], + 'conditions': [ + ['clang==1', { + 'xcode_settings': { + 'WARNING_CFLAGS': [ + '-Wno-unused-value', + ], + }, + 'cflags': [ + '-Wno-unused-value', + ] + }], + ['OS=="win"', { + # TODO(eae): C4267 on amd64. size_t -> int, size_t -> unsigned int + 'msvs_disabled_warnings': [4267, 4334], + }], + ['OS=="mac"', { + 'defines': [ + 'HAVE_CORETEXT', + ], + 'sources': [ + 'src/hb-coretext.cc', + 'src/hb-coretext.h', + ], + }], + ], + }, ], - }, + }, { # use_system_harfbuzz==1 + 'variables': { + # Check for presence of harfbuzz-icu library, use it if present. + 'harfbuzz_libraries': + '<!(python <(DEPTH)/tools/compile_test/compile_test.py ' + '--code "int main() { return 0; }" ' + '--run-linker ' + '--on-success "harfbuzz harfbuzz-icu" ' + '--on-failure "harfbuzz" ' + '-- -lharfbuzz-icu)', + }, + 'targets': [ + { + 'target_name': 'harfbuzz-ng', + 'type': 'none', + 'cflags': [ + '<!@(<(pkg-config) --cflags <(harfbuzz_libraries))', + ], + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags <(harfbuzz_libraries))', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other <(harfbuzz_libraries))', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l <(harfbuzz_libraries))', + ], + }, + }, + ], + }], ], } |