OLD | NEW |
| (Empty) |
1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 Import('env') | |
6 | |
7 env = env.Clone() | |
8 | |
9 | |
10 cygwin = env.Dir('$CHROME_SRC_DIR/third_party/cygwin/bin') | |
11 cygwin_posix = cygwin.abspath.replace('\\', '/') | |
12 env.PrependENVPath('PATH', cygwin_posix) | |
13 | |
14 | |
15 hash_table_cmd = '$PERL $CREATE_HASH_TABLE $SOURCE $CREATE_HASH_TABLE_FLAGS > $T
ARGET' | |
16 | |
17 env.Replace( | |
18 CREATE_HASH_TABLE_COM = hash_table_cmd, | |
19 CREATE_HASH_TABLE = env.File('$CHROME_SRC_DIR/third_party/WebKit/J
avaScriptCore/create_hash_table'), | |
20 CREATE_HASH_TABLE_FLAGS = '-i', | |
21 ) | |
22 | |
23 # TODO(erg): Temporarily disabling JSC building since it's changed heavily | |
24 # during the merge; I am also not sure we want/need to build it when building | |
25 # V8... | |
26 # | |
27 # We still need to build the pieces of pcre so we can't just drop this | |
28 # SConscript file though... <http://crbug.com/3043> | |
29 # env['BUILDERS']['Lookup_Table_h'] = Builder(action = '$CREATE_HASH_TABLE_COM', | |
30 # suffix = '.lut.h', | |
31 # src_suffix = '.cpp') | |
32 # | |
33 # inputs = [ | |
34 # 'array_object', | |
35 # 'date_object', | |
36 # 'math_object', | |
37 # 'number_object', | |
38 # 'regexp_object', | |
39 # 'string_object', | |
40 # ] | |
41 # | |
42 # for i in inputs: | |
43 # env.Lookup_Table_h(i, '$KJS_DIR/%s.cpp' % i) | |
44 # | |
45 # env.Lookup_Table_h('lexer', '$KJS_DIR/keywords.table', | |
46 # CREATE_HASH_TABLE_FLAGS='') | |
47 | |
48 # TODO(bradnelson): sucks, needs relative path | |
49 env.Command('$WEBKIT_DIR/port/JavaScriptCore/chartables.c', | |
50 '$PCRE_DIR/dftables', | |
51 '$PERL $CHROME_SRC_DIR/third_party/WebKit/JavaScriptCore/pcre/dftabl
es ' + \ | |
52 '${TARGET.posix}') | |
53 | |
54 # We'd like to do this as follows: | |
55 #env.CXXFile('grammar.cpp', '$KJS_DIR/grammar.y') | |
56 # but SCons has a HARD-WIRED notion that the source must be a .yy file. | |
57 # TODO(bradnelson): not sure why YACCCOM is needed, but fails without | |
58 cpp = env.Command(['Grammar.cpp', 'Grammar.h'], | |
59 '$JAVASCRIPTCORE_DIR/parser/Grammar.y', | |
60 '$YACCCOM', | |
61 YACCCOM = '$YACC $YACCFLAGS -o $TARGET $SOURCES', | |
62 YACCFLAGS = '-d -p kjsyy') | |
63 env.AddPostAction(cpp, Move('${TARGETS[1]}', '${TARGET.dir}/Grammar.hpp')) | |
64 | |
65 copies = [ | |
66 'API/APICast.h', | |
67 'API/JSBase.h', | |
68 'API/JSValueRef.h', | |
69 'API/JSObjectRef.h', | |
70 'API/JSRetainPtr.h', | |
71 'API/JSContextRef.h', | |
72 'API/JSStringRef.h', | |
73 'API/JSStringRefCF.h', | |
74 'API/JSStringRefBSTR.h', | |
75 'API/JavaScriptCore.h', | |
76 # NOTE: these work ok for now with relative paths because they are concated | |
77 # with JAVASCRIPT_CORE_DIR down below. | |
78 '../WebCore/bridge/npruntime.h', | |
79 '../WebCore/bridge/runtime.h', | |
80 '../WebCore/bridge/NP_jsobject.h', | |
81 '../WebCore/bridge/npruntime_internal.h', | |
82 '../WebCore/bridge/npruntime_impl.h', | |
83 '../WebCore/bridge/runtime_object.h', | |
84 '../WebCore/bridge/runtime_root.h', | |
85 'runtime/Collector.h', | |
86 'wtf/HashCountedSet.h', | |
87 ] | |
88 | |
89 JSCORE_OUT = '$WEBKIT_DIR/scons/WebCore/JavaScriptCore' | |
90 | |
91 for c in copies: | |
92 i = env.Install(JSCORE_OUT, '$JAVASCRIPTCORE_DIR/' + c) | |
93 env.Alias('webkit', i) | |
94 | |
95 # Stuff for WTF | |
96 env = env.Clone( | |
97 CPPPATH = [ | |
98 '$JAVASCRIPTCORE_DIR', | |
99 '$WTF_DIR', | |
100 '$JAVASCRIPTCORE_DIR/API', | |
101 '$JAVASCRIPTCORE_DIR/bindings', | |
102 '$JAVASCRIPTCORE_DIR/bindings/c', | |
103 '$JAVASCRIPTCORE_DIR/bindings/jni', | |
104 '$WEBKIT_DIR/pending', | |
105 '$JAVASCRIPTCORE_DIR/wtf', | |
106 '$ICU38_DIR/public/common', | |
107 '$ICU38_DIR/public/i18n', | |
108 '$WEBKIT_DIR', | |
109 '$CHROME_SRC_DIR', | |
110 ], | |
111 ) | |
112 | |
113 env.Append( | |
114 CPPDEFINES = [ | |
115 '__STD_C', | |
116 'U_STATIC_IMPLEMENTATION', | |
117 ], | |
118 CPPPATH = [ | |
119 '$WTF_DIR/unicode', | |
120 ], | |
121 ) | |
122 | |
123 if env.Bit('windows'): | |
124 env.Append( | |
125 CPPPATH = [ | |
126 # Windows workarounds to not having pthread.h and sched.h | |
127 '$WEBKIT_DIR/build/JavaScriptCore', | |
128 # Windows workarounds to not having stdint.h | |
129 '$JAVASCRIPTCORE_DIR/os-win32', | |
130 ], | |
131 CPPDEFINES = [ | |
132 'CRASH=__debugbreak', | |
133 ], | |
134 CCFLAGS = [ | |
135 '/TP', | |
136 | |
137 '/Wp64', | |
138 | |
139 '/wd4127', | |
140 '/wd4355', | |
141 '/wd4510', | |
142 '/wd4512', | |
143 '/wd4610', | |
144 '/wd4706', | |
145 ], | |
146 ) | |
147 | |
148 wtf_inputs = [ | |
149 '$WTF_DIR/ByteArray.cpp', | |
150 '$WTF_DIR/Assertions.cpp', | |
151 '$WTF_DIR/chromium/MainThreadChromium.cpp', | |
152 '$WTF_DIR/dtoa.cpp', | |
153 '$WTF_DIR/FastMalloc.cpp', | |
154 '$WTF_DIR/HashTable.cpp', | |
155 '$WTF_DIR/MainThread.cpp', | |
156 '$WTF_DIR/RandomNumber.cpp', | |
157 '$WTF_DIR/RefCountedLeakCounter.cpp', | |
158 '$WTF_DIR/Threading.cpp', | |
159 '$WTF_DIR/ThreadingPthreads.cpp', | |
160 '$WTF_DIR/TCSystemAlloc.cpp', | |
161 '$WTF_DIR/unicode/UTF8.cpp', | |
162 '$WTF_DIR/unicode/icu/CollatorICU.cpp', | |
163 ] | |
164 | |
165 if env.Bit('windows'): | |
166 wtf_inputs.extend([ | |
167 '$WTF_DIR/ThreadingWin.cpp', | |
168 '$WTF_DIR/ThreadSpecificWin.cpp', | |
169 ]) | |
170 elif env.Bit('linux'): | |
171 # Re-add the include path for glib.h because it got lost when cloning the | |
172 # environment. | |
173 env.ParseConfig('pkg-config --cflags --libs glib-2.0') | |
174 | |
175 | |
176 env.ChromeLibrary('WTF', wtf_inputs) | |
177 | |
178 env.ChromeMSVSProject('$WEBKIT_DIR/build/JavaScriptCore/WTF.vcproj', | |
179 guid='{AA8A5A85-592B-4357-BC60-E0E91E026AF6}') | |
OLD | NEW |