295ee2ca6c5105cec40d4881856245ec654343f1
[WebKit-https.git] / JavaScriptCore / JavaScriptCore.pri
1 # JavaScriptCore - Qt4 build info
2 VPATH += $$PWD
3
4 CONFIG(debug, debug|release) {
5     isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = generated$${QMAKE_DIR_SEP}debug
6     OBJECTS_DIR = obj/debug
7 } else { # Release
8     isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = generated$${QMAKE_DIR_SEP}release
9     OBJECTS_DIR = obj/release
10 }
11
12 INCLUDEPATH = \
13     $$PWD \
14     $$PWD/.. \
15     $$PWD/assembler \
16     $$PWD/bytecode \
17     $$PWD/bytecompiler \
18     $$PWD/debugger \
19     $$PWD/interpreter \
20     $$PWD/jit \
21     $$PWD/parser \
22     $$PWD/profiler \
23     $$PWD/runtime \
24     $$PWD/wrec \
25     $$PWD/wtf \
26     $$PWD/wtf/unicode \
27     $$PWD/yarr \
28     $$PWD/API \
29     $$PWD/ForwardingHeaders \
30     $$GENERATED_SOURCES_DIR \
31     $$INCLUDEPATH
32
33 DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
34
35 GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}
36 win32-* {
37     LIBS += -lwinmm
38 }
39 contains(JAVASCRIPTCORE_JIT,yes) {
40     DEFINES+=ENABLE_JIT=1
41     DEFINES+=ENABLE_YARR_JIT=1
42     DEFINES+=ENABLE_YARR=1
43 }
44 contains(JAVASCRIPTCORE_JIT,no) {
45     DEFINES+=ENABLE_JIT=0
46     DEFINES+=ENABLE_YARR_JIT=0
47     DEFINES+=ENABLE_YARR=0
48 }
49
50 # In debug mode JIT disabled until crash fixed
51 win32-* {
52     CONFIG(debug):!contains(DEFINES, ENABLE_JIT=1): DEFINES+=ENABLE_JIT=0
53 }
54
55 # Rules when JIT enabled (not disabled)
56 !contains(DEFINES, ENABLE_JIT=0) {
57     linux-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
58         QMAKE_CXXFLAGS += -fno-stack-protector
59         QMAKE_CFLAGS += -fno-stack-protector
60     }
61 }
62
63 wince* {
64     SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.c
65     DEFINES += WINCEBASIC
66 }
67
68 include(pcre/pcre.pri)
69
70 LUT_FILES += \
71     runtime/DatePrototype.cpp \
72     runtime/JSONObject.cpp \
73     runtime/NumberConstructor.cpp \
74     runtime/StringPrototype.cpp \
75     runtime/ArrayPrototype.cpp \
76     runtime/MathObject.cpp \
77     runtime/RegExpConstructor.cpp \
78     runtime/RegExpObject.cpp
79
80 KEYWORDLUT_FILES += \
81     parser/Keywords.table
82
83 JSCBISON += \
84     parser/Grammar.y
85
86 SOURCES += \
87     wtf/Assertions.cpp \
88     wtf/ByteArray.cpp \
89     wtf/HashTable.cpp \
90     wtf/MainThread.cpp \
91     wtf/RandomNumber.cpp \
92     wtf/RefCountedLeakCounter.cpp \
93     wtf/TypeTraits.cpp \
94     wtf/unicode/CollatorDefault.cpp \
95     wtf/unicode/icu/CollatorICU.cpp \
96     wtf/unicode/UTF8.cpp \
97     API/JSBase.cpp \
98     API/JSCallbackConstructor.cpp \
99     API/JSCallbackFunction.cpp \
100     API/JSCallbackObject.cpp \
101     API/JSClassRef.cpp \
102     API/JSContextRef.cpp \
103     API/JSObjectRef.cpp \
104     API/JSStringRef.cpp \
105     API/JSValueRef.cpp \
106     API/OpaqueJSString.cpp \
107     runtime/InitializeThreading.cpp \
108     runtime/JSGlobalData.cpp \
109     runtime/JSGlobalObject.cpp \
110     runtime/JSStaticScopeObject.cpp \
111     runtime/JSVariableObject.cpp \
112     runtime/JSActivation.cpp \
113     runtime/JSNotAnObject.cpp \
114     runtime/JSONObject.cpp \
115     runtime/LiteralParser.cpp \
116     runtime/MarkStack.cpp \
117     runtime/TimeoutChecker.cpp \
118     bytecode/CodeBlock.cpp \
119     bytecode/StructureStubInfo.cpp \
120     bytecode/JumpTable.cpp \
121     assembler/ARMAssembler.cpp \
122     assembler/MacroAssemblerARM.cpp \
123     jit/JIT.cpp \
124     jit/JITCall.cpp \
125     jit/JITArithmetic.cpp \
126     jit/JITOpcodes.cpp \
127     jit/JITPropertyAccess.cpp \
128     jit/ExecutableAllocator.cpp \
129     jit/JITStubs.cpp \
130     bytecompiler/BytecodeGenerator.cpp \
131     runtime/ExceptionHelpers.cpp \
132     runtime/JSPropertyNameIterator.cpp \
133     interpreter/Interpreter.cpp \
134     bytecode/Opcode.cpp \
135     bytecode/SamplingTool.cpp \
136     yarr/RegexCompiler.cpp \
137     yarr/RegexInterpreter.cpp \
138     yarr/RegexJIT.cpp \
139     interpreter/RegisterFile.cpp
140
141 symbian {
142     SOURCES += jit/ExecutableAllocatorSymbian.cpp \
143               runtime/MarkStackSymbian.cpp
144 } else {
145     win32-*|wince* {
146         SOURCES += jit/ExecutableAllocatorWin.cpp \
147                   runtime/MarkStackWin.cpp
148     } else {
149         SOURCES += jit/ExecutableAllocatorPosix.cpp \
150                   runtime/MarkStackPosix.cpp
151     }
152 }
153
154 !contains(DEFINES, USE_SYSTEM_MALLOC) {
155     SOURCES += wtf/TCSystemAlloc.cpp
156 }
157
158 # AllInOneFile.cpp helps gcc analize and optimize code
159 # Other compilers may be able to do this at link time
160 SOURCES += \
161     runtime/ArgList.cpp \
162     runtime/Arguments.cpp \
163     runtime/ArrayConstructor.cpp \
164     runtime/ArrayPrototype.cpp \
165     runtime/BooleanConstructor.cpp \
166     runtime/BooleanObject.cpp \
167     runtime/BooleanPrototype.cpp \
168     runtime/CallData.cpp \
169     runtime/Collector.cpp \
170     runtime/CommonIdentifiers.cpp \
171     runtime/ConstructData.cpp \
172     wtf/CurrentTime.cpp \
173     runtime/DateConstructor.cpp \
174     runtime/DateConversion.cpp \
175     runtime/DateInstance.cpp \
176     runtime/DatePrototype.cpp \
177     debugger/Debugger.cpp \
178     debugger/DebuggerCallFrame.cpp \
179     debugger/DebuggerActivation.cpp \
180     wtf/dtoa.cpp \
181     runtime/Error.cpp \
182     runtime/ErrorConstructor.cpp \
183     runtime/ErrorInstance.cpp \
184     runtime/ErrorPrototype.cpp \
185     interpreter/CallFrame.cpp \
186     runtime/Executable.cpp \
187     runtime/FunctionConstructor.cpp \
188     runtime/FunctionPrototype.cpp \
189     runtime/GetterSetter.cpp \
190     runtime/GlobalEvalFunction.cpp \
191     runtime/Identifier.cpp \
192     runtime/InternalFunction.cpp \
193     runtime/Completion.cpp \
194     runtime/JSArray.cpp \
195     runtime/JSAPIValueWrapper.cpp \
196     runtime/JSByteArray.cpp \
197     runtime/JSCell.cpp \
198     runtime/JSFunction.cpp \
199     runtime/JSGlobalObjectFunctions.cpp \
200     runtime/JSImmediate.cpp \
201     runtime/JSLock.cpp \
202     runtime/JSNumberCell.cpp \
203     runtime/JSObject.cpp \
204     runtime/JSString.cpp \
205     runtime/JSValue.cpp \
206     runtime/JSWrapperObject.cpp \
207     parser/Lexer.cpp \
208     runtime/Lookup.cpp \
209     runtime/MathObject.cpp \
210     runtime/NativeErrorConstructor.cpp \
211     runtime/NativeErrorPrototype.cpp \
212     parser/Nodes.cpp \
213     runtime/NumberConstructor.cpp \
214     runtime/NumberObject.cpp \
215     runtime/NumberPrototype.cpp \
216     runtime/ObjectConstructor.cpp \
217     runtime/ObjectPrototype.cpp \
218     runtime/Operations.cpp \
219     parser/Parser.cpp \
220     parser/ParserArena.cpp \
221     runtime/PropertyDescriptor.cpp \
222     runtime/PropertyNameArray.cpp \
223     runtime/PropertySlot.cpp \
224     runtime/PrototypeFunction.cpp \
225     runtime/RegExp.cpp \
226     runtime/RegExpConstructor.cpp \
227     runtime/RegExpObject.cpp \
228     runtime/RegExpPrototype.cpp \
229     runtime/ScopeChain.cpp \
230     runtime/SmallStrings.cpp \
231     runtime/StringConstructor.cpp \
232     runtime/StringObject.cpp \
233     runtime/StringPrototype.cpp \
234     runtime/Structure.cpp \
235     runtime/StructureChain.cpp \
236     runtime/UString.cpp \
237     profiler/HeavyProfile.cpp \
238     profiler/Profile.cpp \
239     profiler/ProfileGenerator.cpp \
240     profiler/ProfileNode.cpp \
241     profiler/Profiler.cpp \
242     profiler/TreeProfile.cpp \
243     wtf/DateMath.cpp \
244     wtf/FastMalloc.cpp \
245     wtf/Threading.cpp \
246     wtf/qt/MainThreadQt.cpp
247
248 !contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
249     SOURCES += wtf/qt/ThreadingQt.cpp
250 } else {
251     DEFINES += ENABLE_JSC_MULTIPLE_THREADS=0
252     SOURCES += wtf/ThreadingNone.cpp
253 }
254
255 # GENERATOR 1-A: LUT creator
256 lut.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.lut.h
257 lut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
258 lut.depend = ${QMAKE_FILE_NAME}
259 lut.input = LUT_FILES
260 lut.CONFIG += no_link
261 addExtraCompiler(lut)
262
263 # GENERATOR 1-B: particular LUT creator (for 1 file only)
264 keywordlut.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Lexer.lut.h
265 keywordlut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
266 keywordlut.depend = ${QMAKE_FILE_NAME}
267 keywordlut.input = KEYWORDLUT_FILES
268 keywordlut.CONFIG += no_link
269 addExtraCompiler(keywordlut)
270
271 # GENERATOR 2: bison grammar
272 jscbison.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.cpp
273 jscbison.commands = bison -d -p jscyy ${QMAKE_FILE_NAME} -o $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c && $(MOVE) $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c ${QMAKE_FILE_OUT} && $(MOVE) $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.h $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.h
274 jscbison.depend = ${QMAKE_FILE_NAME}
275 jscbison.input = JSCBISON
276 jscbison.variable_out = GENERATED_SOURCES
277 jscbison.dependency_type = TYPE_C
278 jscbison.CONFIG = target_predeps
279 addExtraCompilerWithHeader(jscbison)
280