source: webkit/trunk/JavaScriptCore/JavaScriptCore.scons@ 38497

Last change on this file since 38497 was 38497, checked in by [email protected], 17 years ago

2008-11-17 Geoffrey Garen <[email protected]>

Not reviewed.


Try to fix a few more builds.

File size: 6.8 KB
Line 
1import os
2import sys
3from subprocess import Popen, PIPE
4
5# The keys in sources are the paths to the directories
6# the values are an array of source files in those directories to compile
7sources = {}
8sources['API'] = [
9 'API/JSBase.cpp',
10 'API/JSCallbackConstructor.cpp',
11 'API/JSCallbackFunction.cpp',
12 'API/JSCallbackObject.cpp',
13 'API/JSClassRef.cpp',
14 'API/JSContextRef.cpp',
15 'API/JSObjectRef.cpp',
16 'API/JSProfilerPrivate.cpp',
17 'API/JSStringRef.cpp',
18 'API/JSValueRef.cpp',
19 'API/OpaqueJSString.cpp',
20]
21sources['bytecompiler'] = [
22 'bytecompiler/BytecodeGenerator.cpp',
23]
24sources['debugger'] = [
25 'debugger/Debugger.cpp',
26 'debugger/DebuggerCallFrame.cpp',
27]
28sources['parser'] = [
29 'parser/Lexer.cpp',
30 'parser/Nodes.cpp',
31 'parser/Parser.cpp',
32]
33sources['pcre'] = [
34 'pcre/pcre_compile.cpp',
35 'pcre/pcre_exec.cpp',
36 'pcre/pcre_tables.cpp',
37 'pcre/pcre_ucp_searchfuncs.cpp',
38 'pcre/pcre_xclass.cpp',
39]
40sources['profiler'] = [
41 'profiler/HeavyProfile.cpp',
42 'profiler/Profile.cpp',
43 'profiler/ProfileGenerator.cpp',
44 'profiler/ProfileNode.cpp',
45 'profiler/Profiler.cpp',
46 'profiler/TreeProfile.cpp',
47]
48sources['runtime'] = [
49 'runtime/ArgList.cpp',
50 'runtime/Arguments.cpp',
51 'runtime/ArrayConstructor.cpp',
52 'runtime/ArrayPrototype.cpp',
53 'runtime/BooleanConstructor.cpp',
54 'runtime/BooleanObject.cpp',
55 'runtime/BooleanPrototype.cpp',
56 'runtime/CallData.cpp',
57 'runtime/Collector.cpp',
58 'runtime/CommonIdentifiers.cpp',
59 'runtime/ConstructData.cpp',
60 'runtime/DateConstructor.cpp',
61 'runtime/DateInstance.cpp',
62 'runtime/DateMath.cpp',
63 'runtime/DatePrototype.cpp',
64 'runtime/Error.cpp',
65 'runtime/ErrorConstructor.cpp',
66 'runtime/ErrorInstance.cpp',
67 'runtime/ErrorPrototype.cpp',
68 'runtime/ExecState.cpp',
69 'runtime/FunctionConstructor.cpp',
70 'runtime/FunctionPrototype.cpp',
71 'runtime/GetterSetter.cpp',
72 'runtime/GlobalEvalFunction.cpp',
73 'runtime/Identifier.cpp',
74 'runtime/InitializeThreading.cpp',
75 'runtime/InternalFunction.cpp',
76 'runtime/interpreter.cpp',
77 'runtime/JSActivation.cpp',
78 'runtime/JSArray.cpp',
79 'runtime/JSCell.cpp',
80 'runtime/JSFunction.cpp',
81 'runtime/JSGlobalData.cpp',
82 'runtime/JSGlobalObject.cpp',
83 'runtime/JSGlobalObjectFunctions.cpp',
84 'runtime/JSImmediate.cpp',
85 'runtime/JSLock.cpp',
86 'runtime/JSNotAnObject.cpp',
87 'runtime/JSNumberCell.cpp',
88 'runtime/JSObject.cpp',
89 'runtime/JSPropertyNameIterator.cpp',
90 'runtime/JSStaticScopeObject.cpp',
91 'runtime/JSString.cpp',
92 'runtime/JSValue.cpp',
93 'runtime/JSVariableObject.cpp',
94 'runtime/JSWrapperObject.cpp',
95 'runtime/Lookup.cpp',
96 'runtime/MathObject.cpp',
97 'runtime/NativeErrorConstructor.cpp',
98 'runtime/NativeErrorPrototype.cpp',
99 'runtime/NumberConstructor.cpp',
100 'runtime/NumberObject.cpp',
101 'runtime/NumberPrototype.cpp',
102 'runtime/ObjectConstructor.cpp',
103 'runtime/ObjectPrototype.cpp',
104 'runtime/Operations.cpp',
105 'runtime/PropertyNameArray.cpp',
106 'runtime/PropertySlot.cpp',
107 'runtime/PrototypeFunction.cpp',
108 'runtime/RegExp.cpp',
109 'runtime/RegExpConstructor.cpp',
110 'runtime/RegExpObject.cpp',
111 'runtime/RegExpPrototype.cpp',
112 'runtime/ScopeChain.cpp',
113 'runtime/SmallStrings.cpp',
114 'runtime/StringConstructor.cpp',
115 'runtime/StringObject.cpp',
116 'runtime/StringPrototype.cpp',
117 'runtime/Structure.cpp',
118 'runtime/StructureChain.cpp',
119 'runtime/UString.cpp',
120]
121sources['VM'] = [
122 'VM/CodeBlock.cpp',
123 'VM/CTI.cpp',
124 'VM/ExceptionHelpers.cpp',
125 'VM/Machine.cpp',
126 'VM/Opcode.cpp',
127 'VM/RegisterFile.cpp',
128 'VM/SamplingTool.cpp',
129]
130sources['wrec'] = [
131 'wrec/CharacterClassConstructor.cpp',
132 'wrec/WREC.cpp'
133]
134sources['wtf'] = [
135 'wtf/Assertions.cpp',
136 'wtf/FastMalloc.cpp',
137 'wtf/HashTable.cpp',
138 'wtf/MainThread.cpp',
139 'wtf/RefCountedLeakCounter.cpp',
140 'wtf/TCSystemAlloc.cpp',
141 'wtf/dtoa.cpp',
142]
143sources['wtf/unicode'] = [
144 'wtf/unicode/CollatorDefault.cpp',
145 'wtf/unicode/UTF8.cpp',
146]
147sources['wtf/unicode/icu'] = [
148 'wtf/unicode/icu/CollatorICU.cpp',
149]
150
151env = Environment()
152
153if env['PLATFORM'] == 'darwin':
154 sources['API'].append('API/JSStringRefCF.cpp')
155 sources['profiler'].append('profiler/ProfilerServer.mm')
156 sources['wtf'].append('wtf/ThreadingPthreads.cpp')
157 sources['wtf/mac'] = ['wtf/mac/MainThreadMac.mm']
158elif env['PLATFORM'] == 'win32':
159 sources['API'].append('API/JSStringRefBSTR.cpp')
160 sources['wtf'].append('wtf/ThreadingWin.cpp')
161 sources['wtf/win'] = ['wtf/win/MainThreadWin.cpp']
162
163
164derived_sources_path = 'DerivedSources/JavaScriptCore/'
165def DerivedSources(path):
166 return derived_sources_path + path
167
168derived_sources_results = map(DerivedSources, [
169 'ArrayPrototype.lut.h',
170 'DatePrototype.lut.h',
171 'MathObject.lut.h',
172 'NumberConstructor.lut.h',
173 'RegExpConstructor.lut.h',
174 'RegExpObject.lut.h',
175 'StringPrototype.lut.h'
176 'chartables.c',
177 'grammar.cpp',
178 'grammar.h',
179 'lexer.lut.h',
180])
181
182derived_sources_sources = [
183 'runtime/ArrayPrototype.cpp',
184 'runtime/DatePrototype.cpp',
185 'runtime/MathObject.cpp',
186 'runtime/NumberConstructor.cpp',
187 'runtime/RegExpConstructor.cpp',
188 'runtime/RegExpObject.cpp',
189 'runtime/StringPrototype.cpp',
190 'parser/Grammar.y',
191 'parser/Lexer.cpp',
192]
193
194# Generate DerivedSources
195env.Command(derived_sources_results, derived_sources_sources, './make-generated-sources.sh')
196sources[derived_sources_path] = [DerivedSources('grammar.cpp')]
197
198# Handle os-version specific build settings
199if env['PLATFORM'] == 'darwin':
200 version_pieces = Popen(["sw_vers", "-productVersion"], stdout = PIPE).communicate()[0].split('.')
201 if map(int, version_pieces)[:2] > (10, 5):
202 # Dtrace doesn't exist in Tiger, and was broken in Leopard
203 env.Command(DerivedSources('TracingDtrace.h'), 'runtime/Tracing.d', '/usr/sbin/dtrace -h -o $TARGET -s $SOURCE')
204
205# This build file builds the Chromium port for now, support for
206# others could be added later.
207env['CPPDEFINES'] = 'BUILDING_CHROMIUM__'
208
209# Scons out-of-the-box only supports precompiled headers for MSVC
210# remove this when we fix Scons to understand GCC precompiled headers
211if env['CC'] == 'gcc':
212 env['CCFLAGS'] = '-include JavaScriptCorePrefix.h'
213env['PCH'] = 'JavaScriptCorePrefix.h'
214
215if env['PLATFORM'] == 'darwin':
216 env['FRAMEWORKS'] = ['CoreFoundation', 'Foundation']
217 env['LIBS'] = ['icucore']
218
219include_paths = ['.', '..', 'ForwardingHeaders', 'icu'] + sources.keys()
220env['CPPPATH'] = include_paths
221env.SharedLibrary("JavaScriptCore", sources.values())
222
223
224# Build the jsc testing shell
225shell_sources = ['jsc.cpp']
226build_directory = '.' # This should be changed to point to wherever JavaScriptCore gets built to
227
228env = Environment(CPPPATH = include_paths, LIBS = ['JavaScriptCore', 'edit'], LIBPATH = [build_directory])
229env.Program('jsc', shell_sources)
Note: See TracBrowser for help on using the repository browser.