Fix the issue that Web Audio test case fails on PR3.
[framework/web/webkit-efl.git] / Source / WebCore / WebCore.pri
1 # -------------------------------------------------------------------
2 # This file contains shared rules used both when building WebCore
3 # itself, and by targets that use WebCore.
4 #
5 # See 'Tools/qmake/README' for an overview of the build system
6 # -------------------------------------------------------------------
7
8 SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore
9
10 QT *= network sql
11 haveQt(5): QT *= core-private gui-private
12
13 WEBCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebCore/$${GENERATED_SOURCES_DESTDIR}
14
15 INCLUDEPATH += \
16     $$SOURCE_DIR \
17     $$SOURCE_DIR/Modules/filesystem \
18     $$SOURCE_DIR/Modules/geolocation \
19     $$SOURCE_DIR/Modules/indexeddb \
20     $$SOURCE_DIR/Modules/notifications \
21     $$SOURCE_DIR/Modules/protocolhandler \
22     $$SOURCE_DIR/Modules/quota \
23     $$SOURCE_DIR/Modules/webaudio \
24     $$SOURCE_DIR/Modules/webdatabase \
25     $$SOURCE_DIR/Modules/websockets \
26     $$SOURCE_DIR/accessibility \
27     $$SOURCE_DIR/bindings \
28     $$SOURCE_DIR/bindings/generic \
29     $$SOURCE_DIR/bridge \
30     $$SOURCE_DIR/bridge/qt \
31     $$SOURCE_DIR/css \
32     $$SOURCE_DIR/dom \
33     $$SOURCE_DIR/dom/default \
34     $$SOURCE_DIR/editing \
35     $$SOURCE_DIR/fileapi \
36     $$SOURCE_DIR/history \
37     $$SOURCE_DIR/html \
38     $$SOURCE_DIR/html/canvas \
39     $$SOURCE_DIR/html/parser \
40     $$SOURCE_DIR/html/shadow \
41     $$SOURCE_DIR/html/track \
42     $$SOURCE_DIR/inspector \
43     $$SOURCE_DIR/loader \
44     $$SOURCE_DIR/loader/appcache \
45     $$SOURCE_DIR/loader/archive \
46     $$SOURCE_DIR/loader/cache \
47     $$SOURCE_DIR/loader/icon \
48     $$SOURCE_DIR/mathml \
49     $$SOURCE_DIR/page \
50     $$SOURCE_DIR/page/animation \
51     $$SOURCE_DIR/page/qt \
52     $$SOURCE_DIR/page/scrolling \
53     $$SOURCE_DIR/platform \
54     $$SOURCE_DIR/platform/animation \
55     $$SOURCE_DIR/platform/audio \
56     $$SOURCE_DIR/platform/graphics \
57     $$SOURCE_DIR/platform/graphics/filters \
58     $$SOURCE_DIR/platform/graphics/filters/arm \
59     $$SOURCE_DIR/platform/graphics/opengl \
60     $$SOURCE_DIR/platform/graphics/qt \
61     $$SOURCE_DIR/platform/graphics/surfaces \
62     $$SOURCE_DIR/platform/graphics/texmap \
63     $$SOURCE_DIR/platform/graphics/transforms \
64     $$SOURCE_DIR/platform/image-decoders \
65     $$SOURCE_DIR/platform/image-decoders/bmp \
66     $$SOURCE_DIR/platform/image-decoders/ico \
67     $$SOURCE_DIR/platform/image-decoders/gif \
68     $$SOURCE_DIR/platform/image-decoders/jpeg \
69     $$SOURCE_DIR/platform/image-decoders/png \
70     $$SOURCE_DIR/platform/image-decoders/webp \
71     $$SOURCE_DIR/platform/leveldb \
72     $$SOURCE_DIR/platform/mock \
73     $$SOURCE_DIR/platform/network \
74     $$SOURCE_DIR/platform/network/qt \
75     $$SOURCE_DIR/platform/qt \
76     $$SOURCE_DIR/platform/sql \
77     $$SOURCE_DIR/platform/text \
78     $$SOURCE_DIR/platform/text/transcoder \
79     $$SOURCE_DIR/plugins \
80     $$SOURCE_DIR/rendering \
81     $$SOURCE_DIR/rendering/mathml \
82     $$SOURCE_DIR/rendering/style \
83     $$SOURCE_DIR/rendering/svg \
84     $$SOURCE_DIR/storage \
85     $$SOURCE_DIR/svg \
86     $$SOURCE_DIR/svg/animation \
87     $$SOURCE_DIR/svg/graphics \
88     $$SOURCE_DIR/svg/graphics/filters \
89     $$SOURCE_DIR/svg/properties \
90     $$SOURCE_DIR/testing \
91     $$SOURCE_DIR/websockets \
92     $$SOURCE_DIR/workers \
93     $$SOURCE_DIR/xml \
94     $$SOURCE_DIR/xml/parser \
95     $$SOURCE_DIR/../ThirdParty
96
97 INCLUDEPATH += \
98     $$SOURCE_DIR/bridge/jsc \
99     $$SOURCE_DIR/bindings/js \
100     $$SOURCE_DIR/bindings/js/specialization \
101     $$SOURCE_DIR/bridge/c \
102     $$SOURCE_DIR/testing/js
103
104 INCLUDEPATH += $$WEBCORE_GENERATED_SOURCES_DIR
105
106 contains(DEFINES, ENABLE_XSLT=1) {
107     contains(DEFINES, WTF_USE_LIBXML2=1) {
108         mac {
109             INCLUDEPATH += /usr/include/libxml2
110             LIBS += -lxml2 -lxslt
111         } else {
112             PKGCONFIG += libxslt
113         }
114     } else {
115         QT *= xmlpatterns
116     }
117 }
118
119 contains(DEFINES, WTF_USE_LIBXML2=1) {
120     PKGCONFIG += libxml-2.0
121 }
122
123 contains(DEFINES, WTF_USE_ZLIB=1) {
124     LIBS += -lz
125 }
126
127 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
128     unix {
129         mac {
130             INCLUDEPATH += platform/mac
131             # Note: XP_MACOSX is defined in npapi.h
132         } else {
133             xlibAvailable() {
134                 CONFIG += x11
135                 LIBS += -lXrender
136                 DEFINES += MOZ_X11
137             }
138             DEFINES += XP_UNIX
139             DEFINES += ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE=1
140         }
141     }
142     win32-* {
143         LIBS += \
144             -ladvapi32 \
145             -lgdi32 \
146             -lshell32 \
147             -lshlwapi \
148             -luser32 \
149             -lversion
150     }
151 }
152
153 contains(DEFINES, ENABLE_GEOLOCATION=1) {
154     CONFIG *= mobility
155     MOBILITY *= location
156 }
157
158 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1)|contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
159     haveQt(5) {
160         QT += sensors
161     } else {
162         CONFIG *= mobility
163         MOBILITY *= sensors
164     }
165 }
166
167 contains(DEFINES, WTF_USE_QT_MOBILITY_SYSTEMINFO=1) {
168      CONFIG *= mobility
169      MOBILITY *= systeminfo
170 }
171
172 contains(DEFINES, ENABLE_VIDEO=1) {
173     contains(DEFINES, WTF_USE_QTKIT=1) {
174         INCLUDEPATH += $$SOURCE_DIR/platform/graphics/mac
175
176         LIBS += -framework AppKit -framework AudioUnit \
177                 -framework AudioToolbox -framework CoreAudio \
178                 -framework QuartzCore -framework QTKit
179
180     } else:contains(DEFINES, WTF_USE_GSTREAMER=1) {
181         DEFINES += ENABLE_GLIB_SUPPORT=1
182
183         INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gstreamer
184
185         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
186     } else:contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
187         CONFIG   *= mobility
188         MOBILITY *= multimedia
189     }
190 }
191
192 contains(DEFINES, WTF_USE_3D_GRAPHICS=1) {
193     contains(QT_CONFIG, opengles2): LIBS += -lEGL
194     mac: LIBS += -framework IOSurface -framework CoreFoundation
195     linux-*:contains(DEFINES, HAVE_XCOMPOSITE=1): LIBS += -lXcomposite
196     haveQt(4): QT *= opengl
197 }
198
199 !system-sqlite:exists( $${SQLITE3SRCDIR}/sqlite3.c ) {
200     INCLUDEPATH += $${SQLITE3SRCDIR}
201     DEFINES += SQLITE_CORE SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
202 } else {
203     INCLUDEPATH += $${SQLITE3SRCDIR}
204     LIBS += -lsqlite3
205 }
206
207 haveQt(5) {
208     # Qt5 allows us to use config tests to check for the presence of these libraries
209     config_libjpeg {
210         DEFINES += WTF_USE_LIBJPEG=1
211         LIBS += -ljpeg
212     } else {
213         warning("JPEG library not found! QImageDecoder will decode JPEG images.")
214     }
215     config_libpng {
216         DEFINES += WTF_USE_LIBPNG=1
217         LIBS += -lpng
218     } else {
219         warning("PNG library not found! QImageDecoder will decode PNG images.")
220     }
221     config_libwebp {
222         DEFINES += WTF_USE_WEBP=1
223         LIBS += -lwebp
224     }
225 } else {
226     !win32-*:!mac {
227         DEFINES += WTF_USE_LIBJPEG=1 WTF_USE_LIBPNG=1
228         LIBS += -ljpeg -lpng
229     }
230 }
231
232 win32-*|wince* {
233     DLLDESTDIR = $${ROOT_BUILD_DIR}/bin
234
235     dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS]
236     dlltarget.CONFIG = no_path
237     INSTALLS += dlltarget
238 }
239 mac {
240     LIBS += -framework Carbon -framework AppKit
241 }
242
243 win32-* {
244     INCLUDEPATH += $$SOURCE_DIR/platform/win
245     LIBS += -lgdi32
246     LIBS += -lole32
247     LIBS += -luser32
248 }
249
250 # Remove whole program optimizations due to miscompilations
251 win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{
252     QMAKE_CFLAGS_LTCG -= -GL
253     QMAKE_CXXFLAGS_LTCG -= -GL
254
255     # Disable incremental linking for windows 32bit OS debug build as WebKit is so big
256     # that linker failes to link incrementally in debug mode.
257     ARCH = $$(PROCESSOR_ARCHITECTURE)
258     WOW64ARCH = $$(PROCESSOR_ARCHITEW6432)
259     equals(ARCH, x86):{
260         isEmpty(WOW64ARCH): QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
261     }
262 }
263
264 wince* {
265     DEFINES += HAVE_LOCALTIME_S=0
266     LIBS += -lmmtimer
267     LIBS += -lole32
268 }
269
270 mac {
271     LIBS_PRIVATE += -framework Carbon -framework AppKit
272 }
273
274 unix:!mac:*-g++*:QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
275 unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections
276 linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
277
278 unix|win32-g++* {
279     QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
280     haveQt(5): QMAKE_PKGCONFIG_REQUIRES += QtWidgets
281 }
282
283 # Disable C++0x mode in WebCore for those who enabled it in their Qt's mkspec
284 *-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
285
286 enable_fast_mobile_scrolling: DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
287