Skip to content

Commit 88994dd

Browse files
Add dependency to ICU 4.6
We use the patched version from the chromium project, as it already has a gyp file and allows for using the system icu instead of the bundled version if desired. This is in preparation of bringing in v8-i18n. [email protected] BUG=v8:2745 Review URL: https://codereview.chromium.org/17850002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@15402 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent 3cff848 commit 88994dd

File tree

5 files changed

+202
-0
lines changed

5 files changed

+202
-0
lines changed

DEPS

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ deps = {
66
# Remember to keep the revision in sync with the Makefile.
77
"v8/build/gyp":
88
"http://gyp.googlecode.com/svn/trunk@1656",
9+
10+
"v8/third_party/icu":
11+
"https://src.chromium.org/chrome/trunk/deps/third_party/icu46@205936",
912
}
1013

1114
deps_os = {

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -392,3 +392,6 @@ $(ENVFILE).new:
392392
dependencies:
393393
svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \
394394
--revision 1656
395+
svn checkout --force \
396+
https://src.chromium.org/chrome/trunk/deps/third_party/icu46 \
397+
third_party/icu --revision 205936

build/shim_headers.gypi

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright 2013 the V8 project authors. All rights reserved.
2+
# Redistribution and use in source and binary forms, with or without
3+
# modification, are permitted provided that the following conditions are
4+
# met:
5+
#
6+
# * Redistributions of source code must retain the above copyright
7+
# notice, this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above
9+
# copyright notice, this list of conditions and the following
10+
# disclaimer in the documentation and/or other materials provided
11+
# with the distribution.
12+
# * Neither the name of Google Inc. nor the names of its
13+
# contributors may be used to endorse or promote products derived
14+
# from this software without specific prior written permission.
15+
#
16+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
28+
# This file is meant to be included into a target to handle shim headers
29+
# in a consistent manner. To use this the following variables need to be
30+
# defined:
31+
# headers_root_path: string: path to directory containing headers
32+
# header_filenames: list: list of header file names
33+
34+
{
35+
'variables': {
36+
'shim_headers_path': '<(SHARED_INTERMEDIATE_DIR)/shim_headers/<(_target_name)/<(_toolset)',
37+
'shim_generator_additional_args%': [],
38+
},
39+
'include_dirs++': [
40+
'<(shim_headers_path)',
41+
],
42+
'all_dependent_settings': {
43+
'include_dirs+++': [
44+
'<(shim_headers_path)',
45+
],
46+
},
47+
'actions': [
48+
{
49+
'variables': {
50+
'generator_path': '<(DEPTH)/tools/generate_shim_headers/generate_shim_headers.py',
51+
'generator_args': [
52+
'--headers-root', '<(headers_root_path)',
53+
'--output-directory', '<(shim_headers_path)',
54+
'<@(shim_generator_additional_args)',
55+
'<@(header_filenames)',
56+
],
57+
},
58+
'action_name': 'generate_<(_target_name)_shim_headers',
59+
'inputs': [
60+
'<(generator_path)',
61+
],
62+
'outputs': [
63+
'<!@pymod_do_main(generate_shim_headers <@(generator_args) --outputs)',
64+
],
65+
'action': ['python',
66+
'<(generator_path)',
67+
'<@(generator_args)',
68+
'--generate',
69+
],
70+
'message': 'Generating <(_target_name) shim headers.',
71+
},
72+
],
73+
}

build/standalone.gypi

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
{
3131
'variables': {
3232
'component%': 'static_library',
33+
'clang%': 0,
3334
'visibility%': 'hidden',
3435
'v8_enable_backtrace%': 0,
3536
'msvs_multi_core_compile%': '1',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#!/usr/bin/env python
2+
#
3+
# Copyright 2013 the V8 project authors. All rights reserved.
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions are
6+
# met:
7+
#
8+
# * Redistributions of source code must retain the above copyright
9+
# notice, this list of conditions and the following disclaimer.
10+
# * Redistributions in binary form must reproduce the above
11+
# copyright notice, this list of conditions and the following
12+
# disclaimer in the documentation and/or other materials provided
13+
# with the distribution.
14+
# * Neither the name of Google Inc. nor the names of its
15+
# contributors may be used to endorse or promote products derived
16+
# from this software without specific prior written permission.
17+
#
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
30+
"""
31+
Generates shim headers that mirror the directory structure of bundled headers,
32+
but just forward to the system ones.
33+
34+
This allows seamless compilation against system headers with no changes
35+
to our source code.
36+
"""
37+
38+
39+
import optparse
40+
import os.path
41+
import sys
42+
43+
44+
def GeneratorMain(argv):
45+
parser = optparse.OptionParser()
46+
parser.add_option('--headers-root', action='append')
47+
parser.add_option('--define', action='append')
48+
parser.add_option('--output-directory')
49+
parser.add_option('--prefix', default='')
50+
parser.add_option('--use-include-next', action='store_true')
51+
parser.add_option('--outputs', action='store_true')
52+
parser.add_option('--generate', action='store_true')
53+
54+
options, args = parser.parse_args(argv)
55+
56+
if not options.headers_root:
57+
parser.error('Missing --headers-root parameter.')
58+
if not options.output_directory:
59+
parser.error('Missing --output-directory parameter.')
60+
if not args:
61+
parser.error('Missing arguments - header file names.')
62+
63+
source_tree_root = os.path.abspath(
64+
os.path.join(os.path.dirname(__file__), '..', '..'))
65+
66+
for root in options.headers_root:
67+
target_directory = os.path.join(
68+
options.output_directory,
69+
os.path.relpath(root, source_tree_root))
70+
if options.generate and not os.path.exists(target_directory):
71+
os.makedirs(target_directory)
72+
73+
for header_spec in args:
74+
if ';' in header_spec:
75+
(header_filename,
76+
include_before,
77+
include_after) = header_spec.split(';', 2)
78+
else:
79+
header_filename = header_spec
80+
include_before = ''
81+
include_after = ''
82+
if options.outputs:
83+
yield os.path.join(target_directory, header_filename)
84+
if options.generate:
85+
with open(os.path.join(target_directory, header_filename), 'w') as f:
86+
if options.define:
87+
for define in options.define:
88+
key, value = define.split('=', 1)
89+
# This non-standard push_macro extension is supported
90+
# by compilers we support (GCC, clang).
91+
f.write('#pragma push_macro("%s")\n' % key)
92+
f.write('#undef %s\n' % key)
93+
f.write('#define %s %s\n' % (key, value))
94+
95+
if include_before:
96+
for header in include_before.split(':'):
97+
f.write('#include %s\n' % header)
98+
99+
include_target = options.prefix + header_filename
100+
if options.use_include_next:
101+
f.write('#include_next <%s>\n' % include_target)
102+
else:
103+
f.write('#include <%s>\n' % include_target)
104+
105+
if include_after:
106+
for header in include_after.split(':'):
107+
f.write('#include %s\n' % header)
108+
109+
if options.define:
110+
for define in options.define:
111+
key, value = define.split('=', 1)
112+
# This non-standard pop_macro extension is supported
113+
# by compilers we support (GCC, clang).
114+
f.write('#pragma pop_macro("%s")\n' % key)
115+
116+
117+
def DoMain(argv):
118+
return '\n'.join(GeneratorMain(argv))
119+
120+
121+
if __name__ == '__main__':
122+
DoMain(sys.argv[1:])

0 commit comments

Comments
 (0)