1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
# Copyright (c) 2006-2008 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.
import os
Import(['env'])
env = env.Clone()
env_res = env.Clone()
# We use the SCons addRepository() call (an internal API that will
# at some point be made public) to "back" the build directory
# hierarchy with the source directory hierarchies in which we want to
# find the source .cpp and .h files. Think of this kind of like
# Make's VPATH, but applied to entire directory hierarchies. The
# upshot is that when searching for any file (source or target),
# SCons will search the subdirectory hierarchies under the following
# paths:
#
# webkit/Hammer/port/
# webkit/port/
# third_party/WebKit/WebCore/
#
# SCons will replicate the compiler and linker -I and -L options so
# that the tools will find the right .h and library files. This comes
# at the cost of tripling the number of -I or -L options on a command
# line, but with the benefit that the build should "just work"
# regardless of which tree the file lives in, and regardless of whether
# or not the file involved is a generated file or checked-in source.
#
# (Note that because the build/SConscript.main file also calls
# addRepository() for the entire $OBJ_ROOT tree, that adds an
# extra -I or -L option for the webkit/port/ subdirectory, after the
# third_party/WebKit/WebCore/ in the above list. We'd like to
# eliminate that in the future, but that will require some
# deeper magic, and maybe a SCons modification.)
port_dir = env.Dir('$WEBKIT_DIR/port')
port_dir.addRepository(env.Dir('$CHROME_SRC_DIR/webkit/port'))
port_dir.addRepository(env.Dir('$CHROME_SRC_DIR/third_party/WebKit/WebCore'))
if env.Bit('windows'):
env['WEBKIT_PLATFORM_SUBDIR'] = 'win'
elif env.Bit('mac'):
env['WEBKIT_PLATFORM_SUBDIR'] = 'mac'
env.Append(
CCFLAGS = [
'-Wno-reorder',
'-Wno-unused',
],
)
env.Prepend(
CPPPATH = [env.subst(x) for x in [
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/platform/graphics/cg',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/loader/archive/cf',
]]
)
elif env.Bit('linux'):
env.Append(
CPPDEFINES = [
# We want webkit to use pthreads rather than gthread.
'WTF_USE_PTHREADS=1',
],
)
if env.Bit('posix'):
env.Append(
CCFLAGS = [
'-Wno-parentheses',
],
)
env.Append(
WEBCORE_DIR = '$THIRD_PARTY_WEBKIT_DIR/WebCore',
PENDING_DIR = "$WEBKIT_DIR/pending",
PORT_DIR = "$WEBKIT_DIR/port",
JAVASCRIPTCORE_DIR = "$THIRD_PARTY_WEBKIT_DIR/JavaScriptCore",
WTF_DIR = "$JAVASCRIPTCORE_DIR/wtf",
KJS_DIR = "$JAVASCRIPTCORE_DIR/kjs",
PCRE_DIR = "$JAVASCRIPTCORE_DIR/pcre",
V8BINDINGS_DIR = "$WEBKIT_DIR/V8Bindings",
DERIVED_DIR = env.Dir("$WEBKIT_DIR/V8Bindings/DerivedSources"),
SHARED_DIR = env.Dir("$WEBKIT_DIR/V8Bindings/SharedSources"),
WEBKIT_DIR_PORT_INC = env.Dir("$CHROME_SRC_DIR/webkit/port"),
)
env.Prepend(
CPPPATH = [env.subst(x) for x in [
# We put our grit generated headers in a common place. This matches
# what we do in Visual Studios.
'$TARGET_ROOT/grit_derived_sources',
'$WEBKIT_DIR/build/JSConfig/WebCore',
# TODO(sgk): This directory was at this point in the /I list
# in the Visual Studio build of the merged webkit. It breaks
# the Linux build because of the pthread.h file there.
# Leaving it out doesn't obviously break the Windows build,
# but for now I'm leaving it commented out here in case it
# introduced any hidden problems.
#'$WEBKIT_DIR/build/JavaScriptCore',
'$WEBKIT_DIR_PORT_INC/platform/image-decoders',
'$WEBKIT_DIR_PORT_INC/platform/image-decoders/bmp',
'$WEBKIT_DIR_PORT_INC/platform/image-decoders/gif',
'$WEBKIT_DIR_PORT_INC/platform/image-decoders/ico',
'$WEBKIT_DIR_PORT_INC/platform/image-decoders/jpeg',
'$WEBKIT_DIR_PORT_INC/platform/image-decoders/png',
'$WEBKIT_DIR_PORT_INC/platform/image-decoders/xbm',
'$ZLIB_DIR',
'$LIBPNG_DIR',
'$LIBJPEG_DIR',
'$LIBXSLT_DIR',
'$LIBXML_DIR/include',
'$LIBXML_DIR/DerivedSources/include',
'$ICU38_DIR/public/common',
'$ICU38_DIR/public/i18n',
'$SKIA_DIR/include',
'$SKIA_DIR/include/corecg',
'$SKIA_DIR/ext',
'$SKIA_DIR/platform',
'$NPAPI_DIR',
'$V8_DIR/include',
'$WEBKIT_DIR/V8Bindings/DerivedSources',
'$WEBKIT_DIR/V8Bindings/SharedSources',
'$WEBKIT_DIR/pending',
'$WEBKIT_DIR_PORT_INC/bindings/v8',
'$WEBKIT_DIR_PORT_INC/css',
'$WEBKIT_DIR_PORT_INC/dom',
'$WEBKIT_DIR_PORT_INC/history',
'$WEBKIT_DIR_PORT_INC/page/chromium',
'$WEBKIT_DIR_PORT_INC/platform',
'$WEBKIT_DIR_PORT_INC/platform/animation',
'$WEBKIT_DIR_PORT_INC/platform/chromium',
'$WEBKIT_DIR_PORT_INC/platform/graphics',
'$WEBKIT_DIR_PORT_INC/platform/graphics/chromium',
'$WEBKIT_DIR_PORT_INC/platform/graphics/skia',
'$WEBKIT_DIR_PORT_INC/platform/graphics/transforms',
'$WEBKIT_DIR_PORT_INC/platform/$WEBKIT_PLATFORM_SUBDIR',
'$WEBKIT_DIR_PORT_INC/platform/network/chromium',
'$WEBKIT_DIR_PORT_INC/rendering',
'$JAVASCRIPTCORE_DIR',
'$JAVASCRIPTCORE_DIR/wtf',
# Directories in third_party/WebKit/Webcore that we pull headers
# from. We don't have to list directories that are listed in the
# $WEBKIT_DIR_PORT_INC section above because they automatically fall
# back to third_party/WebKit/Webcore.
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/editing',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/html',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/inspector',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/loader',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/loader/appcache',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/loader/archive',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/loader/icon',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/page',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/page/animation',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/platform/network',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/platform/sql',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/platform/text',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/plugins',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/rendering/style',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/storage',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/style',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/svg',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/svg/animation',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/svg/graphics',
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/xml',
'$CHROME_SRC_DIR',
]],
)
env.Append(
CPPDEFINES = [
'U_STATIC_IMPLEMENTATION',
'_SCL_SECURE_NO_DEPRECATE',
'_SCL_SECURE_NO_WARNINGS',
['ENABLE_DASHBOARD_SUPPORT', '0'],
['ENABLE_JAVASCRIPT_DEBUGGER', '0'],
['ENABLE_JSC_MULTIPLE_THREADS', '0'],
['ENABLE_ICONDATABASE', '0'],
['ENABLE_DATABASE', '1'],
['ENABLE_XSLT', '1'],
['ENABLE_XPATH', '1'],
['ENABLE_SVG', '1'],
['ENABLE_SVG_ANIMATION', '1'],
['ENABLE_SVG_AS_IMAGE', '1'],
['ENABLE_SVG_USE', '1'],
['ENABLE_SVG_FOREIGN_OBJECT', '1'],
['ENABLE_SVG_FONTS', '1'],
['WEBCORE_NAVIGATOR_PLATFORM', '"\\"Win32\\""'],
'USE_GOOGLE_URL_LIBRARY',
['BUILDING_CHROMIUM__', '1'],
'CHROMIUM_BUILD',
'_SECURE_ATL',
'LIBXSLT_STATIC',
'LIBXML_STATIC',
'PNG_USER_CONFIG',
'CHROME_PNG_WRITE_SUPPORT',
['__PRETTY_FUNCTION__', '__FUNCTION__'],
'DISABLE_ACTIVEX_TYPE_CONVERSION_MPLAYER2',
'__STD_C',
['USE_SYSTEM_MALLOC', '1'],
],
)
# This addRepository call causes our webkit/port include paths to include both
# webkit/port and third_party/WebKit/WebCore.
webkit_port_inc = env.Dir("$WEBKIT_DIR_PORT_INC")
webkit_port_inc.addRepository(
env.Dir('$CHROME_SRC_DIR/third_party/WebKit/WebCore'))
# This list is the SConscripts that work on Windows and Linux.
sconscript_dirs = env.ChromiumLoadComponentSConscripts(
LOAD_NAMES = ['webkit'],
port = 'SConscript.port',
JavaScriptCore_pcre = 'SConscript.javascriptcore_pcre',
WebCore_config_h = 'build/JSConfig/SConscript',
JavaScriptCore = 'build/JavaScriptCore/SConscript',
webkit_strings = 'build/localized_strings/SConscript',
bindings = 'build/port/SConscript',
V8Bindings = 'build/V8Bindings/SConscript',
WebCore = 'build/WebCore/SConscript',
default_plugin = 'default_plugin/SConscript',
glue = 'glue/SConscript',
npapi_test_plugin = 'glue/plugins/test/SConscript',
npapi_layout_test_plugin = 'tools/npapi_layout_test_plugin/SConscript',
test_shell = 'tools/test_shell/SConscript',
)
if env.Bit('windows'):
# These extra dirs aren't win32-specific, they're just the dirs that
# haven't yet been made portable.
sconscript_dirs.extend(env.ChromiumLoadComponentSConscripts(
LOAD_NAMES = ['webkit'],
activex_shim = 'activex_shim/SConscript',
npaxshim = 'activex_shim_dll/SConscript',
))
env.Append(
CPPDEFINES = [
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_NONSTDC_NO_WARNINGS',
'_CRT_NONSTDC_NO_DEPRECATE',
['CRASH', '__debugbreak'],
])
env.Prepend(
CPPPATH = [
# Windows precompiled headers are here
'$WEBKIT_DIR/build',
'$JAVASCRIPTCORE_DIR/os-win32',
])
else:
env.Append(
CXXFLAGS = ['-Wno-multichar'],
)
env.SConscript(sconscript_dirs, exports=['env', 'env_res'])
# Setup alias for all webkit related targets.
# We'd like to do this as follows, but it leads to out-of-memory
# errors when SCons tries to use the entire contents of the
# directory tree as a huge content-signature string.
# Instead we're going to let all the subsidiary SConscript files
# add their own individual targets to the 'webkit' Alias.
#env.Alias('webkit', ['.', '$DESTINATION_ROOT/icudt38.dll'])
if env.Bit('windows'):
env.Alias('webkit', ['$DESTINATION_ROOT/icudt38.dll'])
version = env.Command('$WEBKIT_DIR/build/WebCore/webkit_version.h',
['$WEBCORE_DIR/Configurations/Version.xcconfig',
'$CHROME_SRC_DIR/webkit/build/webkit_version.py'],
"$PYTHON ${SOURCES[1]} ${SOURCES[0]} ${TARGET.dir}")
env.AlwaysBuild(version)
|