2011-02-10 Peter Varga <pvarga@webkit.org>
[WebKit-https.git] / Source / JavaScriptCore / JavaScriptCore.pri
1 # JavaScriptCore - Qt4 build info
2
3 include(../common.pri)
4
5 VPATH += $$PWD
6
7 # Use a config-specific target to prevent parallel builds file clashes on Mac
8 mac: CONFIG(debug, debug|release): JAVASCRIPTCORE_TARGET = jscored
9 else: JAVASCRIPTCORE_TARGET = jscore
10
11 # Output in JavaScriptCore/<config>
12 CONFIG(debug, debug|release) : JAVASCRIPTCORE_DESTDIR = debug
13 else: JAVASCRIPTCORE_DESTDIR = release
14
15 CONFIG(standalone_package) {
16     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated
17 } else {
18     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = generated
19 }
20
21 CONFIG(standalone_package): DEFINES *= NDEBUG
22
23 JAVASCRIPTCORE_INCLUDEPATH = \
24     $$PWD \
25     $$PWD/.. \
26     $$PWD/../ThirdParty \
27     $$PWD/assembler \
28     $$PWD/bytecode \
29     $$PWD/bytecompiler \
30     $$PWD/debugger \
31     $$PWD/interpreter \
32     $$PWD/jit \
33     $$PWD/parser \
34     $$PWD/profiler \
35     $$PWD/runtime \
36     $$PWD/wtf \
37     $$PWD/wtf/gobject \
38     $$PWD/wtf/symbian \
39     $$PWD/wtf/unicode \
40     $$PWD/yarr \
41     $$PWD/API \
42     $$PWD/ForwardingHeaders \
43     $$JSC_GENERATED_SOURCES_DIR
44
45 symbian {
46     PREPEND_INCLUDEPATH = $$JAVASCRIPTCORE_INCLUDEPATH $$PREPEND_INCLUDEPATH
47 } else {
48     INCLUDEPATH = $$JAVASCRIPTCORE_INCLUDEPATH $$INCLUDEPATH
49 }
50
51 symbian: {
52     LIBS += -lhal
53     # For hal.h
54     INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE
55 }
56
57 win32-*: DEFINES += _HAS_TR1=0
58
59 DEFINES += BUILDING_JavaScriptCore BUILDING_WTF
60
61 # CONFIG += text_breaking_with_icu
62
63 contains (CONFIG, text_breaking_with_icu) {
64     DEFINES += WTF_USE_QT_ICU_TEXT_BREAKING=1
65 }
66
67 wince* {
68     INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat
69     INCLUDEPATH += $$PWD/../JavaScriptCore/os-win32
70 }
71
72
73 defineTest(addJavaScriptCoreLib) {
74     # Argument is the relative path to JavaScriptCore.pro's qmake output
75     pathToJavaScriptCoreOutput = $$ARGS/$$JAVASCRIPTCORE_DESTDIR
76
77     win32-msvc*|wince* {
78         LIBS += -L$$pathToJavaScriptCoreOutput
79         LIBS += -l$$JAVASCRIPTCORE_TARGET
80         POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib
81     } else:symbian {
82         LIBS += -l$${JAVASCRIPTCORE_TARGET}.lib
83         # The default symbian build system does not use library paths at all. However when building with
84         # qmake's symbian makespec that uses Makefiles
85         QMAKE_LIBDIR += $$pathToJavaScriptCoreOutput
86         POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib
87     } else {
88         # Make sure jscore will be early in the list of libraries to workaround a bug in MinGW
89         # that can't resolve symbols from QtCore if libjscore comes after.
90         QMAKE_LIBDIR = $$pathToJavaScriptCoreOutput $$QMAKE_LIBDIR
91         webkit2 {
92             # FIXME Workaround for undefined reference linking issues until the build system gets redesigned
93             mac: LIBS += -Wl,-all_load -l$$JAVASCRIPTCORE_TARGET -WL,-noall_load 
94             else: LIBS += -Wl,-whole-archive -l$$JAVASCRIPTCORE_TARGET -Wl,-no-whole-archive
95         } else {
96             LIBS += -l$$JAVASCRIPTCORE_TARGET
97         }
98         POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}lib$${JAVASCRIPTCORE_TARGET}.a
99     }
100
101     win32-* {
102         LIBS += -lwinmm
103     }
104
105     # The following line is to prevent qmake from adding jscore to libQtWebKit's prl dependencies.
106     # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit and QtScript
107     # statically in applications (which isn't used often because, among other things, of licensing obstacles).
108     CONFIG -= explicitlib
109
110     export(QMAKE_LIBDIR)
111     export(LIBS)
112     export(POST_TARGETDEPS)
113     export(CONFIG)
114
115     return(true)
116 }