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