Re-apply change a14033620fab5edca44293ec6dfcc904e2e0eb20 by Andreas Kling
[qt:qt.git] / src / 3rdparty / webkit / Source / WebCore / WebCore.pri
1 # Include file for WebCore
2
3 include(../common.pri)
4 include(features.pri)
5
6 # Uncomment this to enable Texture Mapper.
7 # CONFIG += texmap
8
9 QT *= network
10
11 SOURCE_DIR = $$replace(PWD, /WebCore, "")
12
13 contains(QT_CONFIG, qpa)|contains(QT_CONFIG, embedded): CONFIG += embedded
14
15 # Use a config-specific target to prevent parallel builds file clashes on Mac
16 mac: CONFIG(debug, debug|release): WEBCORE_TARGET = webcored
17 else: WEBCORE_TARGET = webcore
18
19 # Output in WebCore/<config>
20 CONFIG(debug, debug|release) : WEBCORE_DESTDIR = debug
21 else: WEBCORE_DESTDIR = release
22
23 CONFIG(standalone_package) {
24     isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = $$PWD/../WebCore/generated
25 } else {
26     isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = $$OUTPUT_DIR/WebCore/generated
27 }
28
29 V8_DIR = "$$[QT_INSTALL_PREFIX]/src/3rdparty/v8"
30
31 v8:!exists($${V8_DIR}/include/v8.h) {
32     error("Cannot build with V8. Needed file $${V8_DIR}/include/v8.h does not exist.")
33 }
34
35 v8 {
36     message(Using V8 with QtScript)
37     QT += script
38     INCLUDEPATH += $${V8_DIR}/include
39     DEFINES *= V8_BINDING=1
40     DEFINES += WTF_CHANGES=1
41     DEFINES *= WTF_USE_V8=1
42     DEFINES += USING_V8_SHARED
43     linux-*:LIBS += -lv8
44 }
45
46 v8 {
47     WEBCORE_INCLUDEPATH = \
48         $$SOURCE_DIR/WebCore/bindings/v8 \
49         $$SOURCE_DIR/WebCore/bindings/v8/custom \
50         $$SOURCE_DIR/WebCore/bindings/v8/specialization \
51         $$SOURCE_DIR/WebCore/bridge/qt/v8 \
52         $$SOURCE_DIR/WebCore/testing/v8
53
54 } else {
55     WEBCORE_INCLUDEPATH = \
56         $$SOURCE_DIR/WebCore/bridge/jsc \
57         $$SOURCE_DIR/WebCore/bindings/js \
58         $$SOURCE_DIR/WebCore/bindings/js/specialization \
59         $$SOURCE_DIR/WebCore/bridge/c \
60         $$SOURCE_DIR/WebCore/testing/js
61 }
62
63 WEBCORE_INCLUDEPATH = \
64     $$SOURCE_DIR/WebCore \
65     $$SOURCE_DIR/WebCore/accessibility \
66     $$SOURCE_DIR/WebCore/bindings \
67     $$SOURCE_DIR/WebCore/bindings/generic \
68     $$SOURCE_DIR/WebCore/bridge \
69     $$SOURCE_DIR/WebCore/css \
70     $$SOURCE_DIR/WebCore/dom \
71     $$SOURCE_DIR/WebCore/dom/default \
72     $$SOURCE_DIR/WebCore/editing \
73     $$SOURCE_DIR/WebCore/fileapi \
74     $$SOURCE_DIR/WebCore/history \
75     $$SOURCE_DIR/WebCore/html \
76     $$SOURCE_DIR/WebCore/html/canvas \
77     $$SOURCE_DIR/WebCore/html/parser \
78     $$SOURCE_DIR/WebCore/html/shadow \
79     $$SOURCE_DIR/WebCore/inspector \
80     $$SOURCE_DIR/WebCore/loader \
81     $$SOURCE_DIR/WebCore/loader/appcache \
82     $$SOURCE_DIR/WebCore/loader/archive \
83     $$SOURCE_DIR/WebCore/loader/cache \
84     $$SOURCE_DIR/WebCore/loader/icon \
85     $$SOURCE_DIR/WebCore/mathml \
86     $$SOURCE_DIR/WebCore/notifications \
87     $$SOURCE_DIR/WebCore/page \
88     $$SOURCE_DIR/WebCore/page/animation \
89     $$SOURCE_DIR/WebCore/platform \
90     $$SOURCE_DIR/WebCore/platform/animation \
91     $$SOURCE_DIR/WebCore/platform/audio \
92     $$SOURCE_DIR/WebCore/platform/graphics \
93     $$SOURCE_DIR/WebCore/platform/graphics/filters \
94     $$SOURCE_DIR/WebCore/platform/graphics/filters/arm \
95     $$SOURCE_DIR/WebCore/platform/graphics/texmap \
96     $$SOURCE_DIR/WebCore/platform/graphics/transforms \
97     $$SOURCE_DIR/WebCore/platform/image-decoders \
98     $$SOURCE_DIR/WebCore/platform/leveldb \
99     $$SOURCE_DIR/WebCore/platform/mock \
100     $$SOURCE_DIR/WebCore/platform/network \
101     $$SOURCE_DIR/WebCore/platform/sql \
102     $$SOURCE_DIR/WebCore/platform/text \
103     $$SOURCE_DIR/WebCore/platform/text/transcoder \
104     $$SOURCE_DIR/WebCore/plugins \
105     $$SOURCE_DIR/WebCore/rendering \
106     $$SOURCE_DIR/WebCore/rendering/mathml \
107     $$SOURCE_DIR/WebCore/rendering/style \
108     $$SOURCE_DIR/WebCore/rendering/svg \
109     $$SOURCE_DIR/WebCore/storage \
110     $$SOURCE_DIR/WebCore/svg \
111     $$SOURCE_DIR/WebCore/svg/animation \
112     $$SOURCE_DIR/WebCore/svg/graphics \
113     $$SOURCE_DIR/WebCore/svg/graphics/filters \
114     $$SOURCE_DIR/WebCore/svg/properties \
115     $$SOURCE_DIR/WebCore/testing \
116     $$SOURCE_DIR/WebCore/webaudio \
117     $$SOURCE_DIR/WebCore/websockets \
118     $$SOURCE_DIR/WebCore/wml \
119     $$SOURCE_DIR/WebCore/workers \
120     $$SOURCE_DIR/WebCore/xml \
121     $$WEBCORE_INCLUDEPATH
122
123 WEBCORE_INCLUDEPATH = \
124     $$SOURCE_DIR/WebCore/bridge/qt \
125     $$SOURCE_DIR/WebCore/page/qt \
126     $$SOURCE_DIR/WebCore/platform/graphics/qt \
127     $$SOURCE_DIR/WebCore/platform/network/qt \
128     $$SOURCE_DIR/WebCore/platform/qt \
129     $$SOURCE_DIR/WebKit/qt/Api \
130     $$SOURCE_DIR/WebKit/qt/WebCoreSupport \
131     $$WEBCORE_INCLUDEPATH
132
133 # On Symbian PREPEND_INCLUDEPATH is the best way to make sure that WebKit headers
134 # are included before platform headers.
135 symbian {
136     PREPEND_INCLUDEPATH = $$WEBCORE_INCLUDEPATH $$WC_GENERATED_SOURCES_DIR $$PREPEND_INCLUDEPATH
137 } else {
138     INCLUDEPATH = $$WEBCORE_INCLUDEPATH $$WC_GENERATED_SOURCES_DIR $$INCLUDEPATH
139 }
140
141 symbian {
142     v8 {
143         QMAKE_CXXFLAGS.ARMCC += -OTime -O3
144         QMAKE_CXXFLAGS.ARMCC += --fpu softvfp+vfpv2 --fpmode fast
145         LIBS += -llibpthread
146     }
147
148     # RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target.
149     # Move RW-section base address to start from 0x1000000 instead of the toolchain default 0x400000.
150     QMAKE_LFLAGS.ARMCC += --rw-base 0x1000000
151     QMAKE_LFLAGS.GCCE += -Tdata 0x1000000
152
153     CONFIG += do_not_build_as_thumb
154
155     CONFIG(release, debug|release): QMAKE_CXXFLAGS.ARMCC += -OTime -O3
156     # Symbian plugin support.
157     LIBS += -lefsrv
158
159     !CONFIG(QTDIR_build) {
160         # Test if symbian OS comes with sqlite
161         exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso):CONFIG *= system-sqlite
162     } else:!symbian-abld:!symbian-sbsv2 {
163         # When bundled with Qt, all Symbian build systems extract their own sqlite files if
164         # necessary, but on non-mmp based ones we need to specify this ourselves.
165         include($$QT_SOURCE_TREE/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri)
166     }
167 }
168
169 contains(DEFINES, ENABLE_XSLT=1) {
170     QT *= xmlpatterns
171 }
172
173 contains(DEFINES, ENABLE_SQLITE=1) {
174     !system-sqlite:exists( $${SQLITE3SRCDIR}/sqlite3.c ) {
175             INCLUDEPATH += $${SQLITE3SRCDIR}
176             DEFINES += SQLITE_CORE SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
177             CONFIG(release, debug|release): DEFINES *= NDEBUG
178             contains(DEFINES, ENABLE_SINGLE_THREADED=1): DEFINES += SQLITE_THREADSAFE=0
179     } else {
180         # Use sqlite3 from the underlying OS
181         CONFIG(QTDIR_build) {
182             QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
183             LIBS *= $$QT_LFLAGS_SQLITE
184         } else {
185             INCLUDEPATH += $${SQLITE3SRCDIR}
186             LIBS += -lsqlite3
187         }
188     }
189     wince*:DEFINES += HAVE_LOCALTIME_S=0
190 }
191
192 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
193     unix:!symbian {
194         mac {
195             INCLUDEPATH += platform/mac
196             # Note: XP_MACOSX is defined in npapi.h
197         } else {
198             !embedded {
199                 CONFIG += x11
200                 LIBS += -lXrender
201             }
202             maemo5 {
203                 DEFINES += MOZ_PLATFORM_MAEMO=5
204             }
205             contains(DEFINES, Q_WS_MAEMO_6) {
206                 DEFINES += MOZ_PLATFORM_MAEMO=6
207             }
208             DEFINES += XP_UNIX
209             DEFINES += ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE=1
210         }
211     }
212     win32-* {
213         LIBS += \
214             -ladvapi32 \
215             -lgdi32 \
216             -lshell32 \
217             -lshlwapi \
218             -luser32 \
219             -lversion
220     }
221 }
222
223 contains(DEFINES, ENABLE_GEOLOCATION=1) {
224     CONFIG *= mobility
225     MOBILITY *= location
226 }
227
228 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
229     CONFIG *= mobility
230     MOBILITY *= sensors
231 }
232
233 contains(DEFINES, WTF_USE_QT_MOBILITY_SYSTEMINFO=1) {
234      CONFIG *= mobility
235      MOBILITY *= systeminfo
236 }
237
238 contains(DEFINES, WTF_USE_QT_BEARER=1) {
239     # Bearer management is part of Qt 4.7, so don't accidentially
240     # pull in Qt Mobility when building against >= 4.7
241     !greaterThan(QT_MINOR_VERSION, 6) {
242         CONFIG *= mobility
243         MOBILITY *= bearer
244     }
245 }
246
247 contains(DEFINES, ENABLE_VIDEO=1) {
248     contains(DEFINES, WTF_USE_QTKIT=1) {
249         INCLUDEPATH += $$PWD/platform/graphics/mac
250
251         LIBS += -framework AppKit -framework AudioUnit \
252                 -framework AudioToolbox -framework CoreAudio \
253                 -framework QuartzCore -framework QTKit
254
255     } else:contains(DEFINES, WTF_USE_GSTREAMER=1) {
256         DEFINES += ENABLE_GLIB_SUPPORT=1
257
258         INCLUDEPATH += $$PWD/platform/graphics/gstreamer
259
260         PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10 gstreamer-video-0.10
261     } else:contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
262         CONFIG   *= mobility
263         MOBILITY *= multimedia
264     }
265 }
266
267 contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap) {
268     !contains(QT_CONFIG, opengl) {
269         error( "This configuration needs an OpenGL enabled Qt. Your Qt is missing OpenGL.")
270     }
271     QT *= opengl
272 }
273
274 !CONFIG(webkit-debug):CONFIG(QTDIR_build) {
275     # Remove the following 2 lines if you want debug information in WebCore
276     CONFIG -= separate_debug_info
277     CONFIG += no_debug_info
278 }
279
280 contains (CONFIG, text_breaking_with_icu) {
281     LIBS += -licuuc
282 }
283
284 !CONFIG(QTDIR_build) {
285     win32-*|wince* {
286         DLLDESTDIR = $$OUTPUT_DIR/bin
287         isEmpty(QT_SOURCE_TREE):build_pass: TARGET = $$qtLibraryTarget($$TARGET)
288
289         dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS]
290         dlltarget.CONFIG = no_path
291         INSTALLS += dlltarget
292     }
293     mac {
294         LIBS += -framework Carbon -framework AppKit
295     }
296 }
297
298 win32-* {
299     INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/win
300     LIBS += -lgdi32
301     LIBS += -lole32
302     LIBS += -luser32
303 }
304
305 # Remove whole program optimizations due to miscompilations
306 win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{
307     QMAKE_CFLAGS_RELEASE -= -GL
308     QMAKE_CXXFLAGS_RELEASE -= -GL
309
310     # Disable incremental linking for windows 32bit OS debug build as WebKit is so big
311     # that linker failes to link incrementally in debug mode.
312     ARCH = $$(PROCESSOR_ARCHITECTURE)
313     WOW64ARCH = $$(PROCESSOR_ARCHITEW6432)
314     equals(ARCH, x86):{
315         isEmpty(WOW64ARCH): QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
316     }
317 }
318
319 wince* {
320     LIBS += -lmmtimer
321     LIBS += -lole32
322 }
323
324 mac {
325     LIBS_PRIVATE += -framework Carbon -framework AppKit
326 }
327
328 unix:!mac:*-g++*:QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
329 unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections
330 linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
331
332 unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
333 unix:!mac:!symbian:CONFIG += link_pkgconfig
334
335 # Disable C++0x mode in WebCore for those who enabled it in their Qt's mkspec
336 *-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
337
338 enable_fast_mobile_scrolling: DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
339
340 use_qt_mobile_theme: DEFINES += WTF_USE_QT_MOBILE_THEME=1
341
342 defineTest(prependWebCoreLib) {
343     pathToWebCoreOutput = $$ARGS/$$WEBCORE_DESTDIR
344
345     win32-msvc*|wince*|win32-icc {
346         LIBS = -l$$WEBCORE_TARGET $$LIBS
347         LIBS = -L$$pathToWebCoreOutput $$LIBS
348         POST_TARGETDEPS += $${pathToWebCoreOutput}$${QMAKE_DIR_SEP}$${WEBCORE_TARGET}.lib
349     } else:symbian {
350         LIBS = -l$${WEBCORE_TARGET}.lib $$LIBS
351         QMAKE_LIBDIR += $$pathToWebCoreOutput
352         POST_TARGETDEPS += $${pathToWebCoreOutput}$${QMAKE_DIR_SEP}$${WEBCORE_TARGET}.lib
353     } else {
354         QMAKE_LIBDIR = $$pathToWebCoreOutput $$QMAKE_LIBDIR
355         LIBS = -l$$WEBCORE_TARGET $$LIBS
356         POST_TARGETDEPS += $${pathToWebCoreOutput}$${QMAKE_DIR_SEP}lib$${WEBCORE_TARGET}.a
357     }
358     
359     CONFIG -= explicitlib
360     CONFIG -= staticlib
361     export(QMAKE_LIBDIR)
362     export(POST_TARGETDEPS)
363     export(CONFIG)
364     export(LIBS)
365
366     return(true)
367 }