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