[Qt] Set WebCore imagedecoders as default and add fallback to QImageDecoder
[WebKit-https.git] / Tools / qmake / mkspecs / features / features.prf
1 # -------------------------------------------------------------------
2 # This file does basic 'configure' style checks to determine the
3 # set of ENABLE_FOO defines and their values.
4 #
5 # See 'Tools/qmake/README' for an overview of the build system
6 # -------------------------------------------------------------------
7
8 CONFIG(minimal) {
9     DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
10 }
11
12 CONFIG(production) {
13     DEFINES += ENABLE_XSLT=0
14     DEFINES += ENABLE_WEB_TIMING=0
15 }
16
17 meegotouch {
18     DEFINES += WTF_USE_MEEGOTOUCH=1
19 }
20
21 haveQt(5) {
22     mac: CONFIG += graphics_surfaces
23 }
24
25 contains(CONFIG, graphics_surfaces) {
26     DEFINES += WTF_USE_GRAPHICS_SURFACE=1
27 }
28
29 ## load mobilityconfig if mobility is available
30 load(mobilityconfig, true)
31
32 # Try to locate sqlite3 source
33 SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
34 isEmpty(SQLITE3SRCDIR) {
35     SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
36 }
37
38 # For Mac we do not rely on QT_CONFIG, because icu is not officially supported for all of qt.
39 haveQt(5):if(contains(QT_CONFIG,icu)|mac) {
40     DEFINES += WTF_USE_ICU_UNICODE=1
41     DEFINES -= WTF_USE_QT4_UNICODE
42 } else {
43     DEFINES += WTF_USE_QT4_UNICODE=1
44     DEFINES -= WTF_USE_ICU_UNICODE
45 }
46
47 # Use of QRawFont in Qt 5:
48 haveQt(5): DEFINES += HAVE_QRAWFONT=1
49
50 isEmpty(HAVE_QRAWFONT) {
51     # We have to disable SVG Fonts, which rely on the fast path.
52     DEFINES -= ENABLE_SVG_FONTS=1
53     DEFINES += ENABLE_SVG_FONTS=0
54 }
55
56 # We need fontconfig to set up the test fonts for DumpRenderTree and WebKitTestRunner.
57 haveQt(5) {
58     contains(config_test_fontconfig, yes):!mac {
59         DEFINES += HAVE_FONTCONFIG=1
60     }
61 } else {
62     # Qt 4
63     unix:!mac:!embedded {
64         DEFINES += HAVE_FONTCONFIG=1
65     }
66 }
67
68 # We need libxml2 config test to determine to use libxml2 or not
69 !contains(DEFINES, WTF_USE_LIBXML2=.) {
70     haveQt(5):contains(config_test_libxml2, yes): DEFINES += WTF_USE_LIBXML2=1
71 }
72
73 # We need libxslt config test to determine to use libxslt or not
74 !contains(DEFINES, ENABLE_XSLT=.) {
75     haveQt(5):contains(config_test_libxslt, yes): DEFINES += ENABLE_XSLT=1
76 }
77
78 # Feature defines: for web-facing features only
79 !contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=.): DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1
80 !contains(DEFINES, ENABLE_GAMEPAD=.): DEFINES += ENABLE_GAMEPAD=0
81 !contains(DEFINES, ENABLE_SQL_DATABASE=.): DEFINES += ENABLE_SQL_DATABASE=1
82 !contains(DEFINES, ENABLE_ICONDATABASE=.): DEFINES += ENABLE_ICONDATABASE=1
83 !contains(DEFINES, ENABLE_CHANNEL_MESSAGING=.): DEFINES += ENABLE_CHANNEL_MESSAGING=1
84 !contains(DEFINES, ENABLE_DIRECTORY_UPLOAD=.): DEFINES += ENABLE_DIRECTORY_UPLOAD=0
85 !contains(DEFINES, ENABLE_FILE_SYSTEM=.): DEFINES += ENABLE_FILE_SYSTEM=0
86 !contains(DEFINES, ENABLE_QUOTA=.): DEFINES += ENABLE_QUOTA=0
87 !contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=.): DEFINES += ENABLE_DASHBOARD_SUPPORT=0
88 !contains(DEFINES, ENABLE_FILTERS=.): DEFINES += ENABLE_FILTERS=1
89 !contains(DEFINES, ENABLE_CSS_FILTERS=.): DEFINES += ENABLE_CSS_FILTERS=1
90 !contains(DEFINES, ENABLE_SHARED_WORKERS=.): DEFINES += ENABLE_SHARED_WORKERS=1
91 !contains(DEFINES, ENABLE_SHADOW_DOM=.): DEFINES += ENABLE_SHADOW_DOM=0
92 !contains(DEFINES, ENABLE_WORKERS=.): DEFINES += ENABLE_WORKERS=1
93 !contains(DEFINES, ENABLE_DETAILS=.): DEFINES += ENABLE_DETAILS=1
94 !contains(DEFINES, ENABLE_METER_TAG=.): DEFINES += ENABLE_METER_TAG=1
95 !contains(DEFINES, ENABLE_MHTML=.): DEFINES += ENABLE_MHTML=0
96 !contains(DEFINES, ENABLE_MICRODATA=.): DEFINES += ENABLE_MICRODATA=0
97 !contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
98 !contains(DEFINES, ENABLE_BLOB=.): DEFINES += ENABLE_BLOB=1
99 !contains(DEFINES, ENABLE_LEGACY_WEBKIT_BLOB_BUILDER=.): DEFINES += ENABLE_LEGACY_WEBKIT_BLOB_BUILDER=1
100 !contains(DEFINES, ENABLE_LEGACY_NOTIFICATIONS=.): DEFINES += ENABLE_LEGACY_NOTIFICATIONS=1
101 !contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
102 !contains(DEFINES, ENABLE_INPUT_TYPE_COLOR=.): DEFINES += ENABLE_INPUT_TYPE_COLOR=0
103 !contains(DEFINES, ENABLE_INPUT_SPEECH=.): DEFINES += ENABLE_INPUT_SPEECH=0
104 !contains(DEFINES, ENABLE_SCRIPTED_SPEECH=.): DEFINES += ENABLE_SCRIPTED_SPEECH=0
105 !contains(DEFINES, ENABLE_INSPECTOR=.): DEFINES += ENABLE_INSPECTOR=1
106 !contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
107 !contains(DEFINES, ENABLE_WEB_AUDIO=.): DEFINES += ENABLE_WEB_AUDIO=0
108 !contains(DEFINES, ENABLE_MEDIA_SOURCE=.): DEFINES += ENABLE_MEDIA_SOURCE=0
109 !contains(DEFINES, ENABLE_MEDIA_STATISTICS=.): DEFINES += ENABLE_MEDIA_STATISTICS=0
110 !contains(DEFINES, ENABLE_MEDIA_STREAM=.): DEFINES += ENABLE_MEDIA_STREAM=0
111 !contains(DEFINES, ENABLE_VIDEO_TRACK=.): DEFINES += ENABLE_VIDEO_TRACK=0
112 !contains(DEFINES, ENABLE_TOUCH_ICON_LOADING=.): DEFINES += ENABLE_TOUCH_ICON_LOADING=0
113 !contains(DEFINES, ENABLE_ANIMATION_API=.): DEFINES += ENABLE_ANIMATION_API=0
114 !contains(DEFINES, ENABLE_TOUCH_ADJUSTMENT=.): DEFINES += ENABLE_TOUCH_ADJUSTMENT=1
115 !contains(DEFINES, ENABLE_FAST_MOBILE_SCROLLING=.): DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
116 !contains(DEFINES, ENABLE_PAGE_VISIBILITY_API=.): DEFINES += ENABLE_PAGE_VISIBILITY_API=1
117
118 # Enabled in Source/JavaScriptCore/wtf/Platform.h if not set
119 # We have to do the same to be able to disable the feature in build-webkit
120 !contains(DEFINES, ENABLE_FTPDIR=.): DEFINES += ENABLE_FTPDIR=1
121
122 # SVG support
123 !contains(DEFINES, ENABLE_SVG=0) {
124     !contains(DEFINES, ENABLE_SVG=.): DEFINES += ENABLE_SVG=1
125     !contains(DEFINES, ENABLE_SVG_FONTS=.): DEFINES += ENABLE_SVG_FONTS=1
126 } else {
127     DEFINES += ENABLE_SVG_FONTS=0
128 }
129
130 # HTML5 datalist support
131 !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
132
133 # Tiled Backing Store support
134 !contains(DEFINES, WTF_USE_TILED_BACKING_STORE=.): DEFINES += WTF_USE_TILED_BACKING_STORE=1
135
136 # Nescape plugins support (NPAPI)
137 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
138     unix:haveQt(4)|win32-*:!embedded:!wince*: {
139         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
140     } else {
141         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
142     }
143 }
144
145 # Netscape plugins support for WebKit2
146 !contains(DEFINES, PLUGIN_ARCHITECTURE_UNSUPPORTED) {
147     no_webkit2 {
148         DEFINES += PLUGIN_ARCHITECTURE_UNSUPPORTED=1
149     } else {
150         contains(QT_CONFIG, xcb-xlib) {
151             CONFIG += plugin_backend_xlib
152             DEFINES += PLUGIN_ARCHITECTURE_X11=1 \
153                        PLUGIN_ARCHITECTURE_UNSUPPORTED=0 \
154                        ENABLE_PLUGIN_PROCESS=1
155         } else {
156             DEFINES += PLUGIN_ARCHITECTURE_UNSUPPORTED=1
157         }
158     }
159 }
160
161 # QStyle detection
162 haveQt(4)|!isEmpty(QT.widgets.name): DEFINES += HAVE_QSTYLE=1
163
164 # WebGL support
165 contains(QT_CONFIG, opengl):!win32-* {
166     !contains(DEFINES, ENABLE_WEBGL=.): DEFINES += ENABLE_WEBGL=1
167 } else {
168     DEFINES += ENABLE_WEBGL=0
169 }
170
171 # Web Socket support.
172 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
173
174 # Web Timing support.
175 !contains(DEFINES, ENABLE_WEB_TIMING=.): DEFINES += ENABLE_WEB_TIMING=1
176
177 !contains(DEFINES, ENABLE_REQUEST_ANIMATION_FRAME=.): DEFINES += ENABLE_REQUEST_ANIMATION_FRAME=1
178
179 # XSLT support with QtXmlPatterns
180 !contains(DEFINES, ENABLE_XSLT=.) {
181     contains(QT_CONFIG, xmlpatterns):DEFINES += ENABLE_XSLT=1
182     else:DEFINES += ENABLE_XSLT=0
183 }
184
185 # This is experimental and only works on Linux so far.
186 !contains(DEFINES, ENABLE_XSLT=.) {
187     contains(DEFINES, WTF_USE_LIBXML2=1) {
188         DEFINES += ENABLE_XSLT=1
189     }
190 }
191
192 # geolocation support if QtMobility exists
193 !contains(DEFINES, ENABLE_GEOLOCATION=.) {
194     contains(MOBILITY_CONFIG, location)|contains(QT_CONFIG, location) {
195        DEFINES += ENABLE_GEOLOCATION=1
196     }
197 }
198
199 # orientation support
200 haveQt(5) {
201     !isEmpty(QT.sensors.name) {
202         !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
203         !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
204     }
205 } else {
206     # Qt 4 with Qt Mobility
207     contains(MOBILITY_CONFIG, sensors) {
208         !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
209         !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
210         CONFIG *= mobility
211         MOBILITY *= sensors
212     }
213 }
214
215 !contains(DEFINES, ENABLE_TOUCH_EVENTS=.): DEFINES += ENABLE_TOUCH_EVENTS=1
216 !contains(DEFINES, ENABLE_GESTURE_EVENTS=.): DEFINES += ENABLE_GESTURE_EVENTS=1
217
218 # HTML5 Media Support
219 # We require QtMultimedia
220 !contains(DEFINES, ENABLE_VIDEO=.) {
221     DEFINES -= ENABLE_VIDEO=1
222     DEFINES += ENABLE_VIDEO=0
223
224     mac:!contains(DEFINES, USE_QTMULTIMEDIA=1) {
225         DEFINES -= ENABLE_VIDEO=0
226         DEFINES += ENABLE_VIDEO=1
227         DEFINES += WTF_USE_QTKIT=1
228         DEFINES -= WTF_USE_QTKIT=0
229     } else: linux-*:!contains(DEFINES, USE_QTMULTIMEDIA=1) {
230         !contains(QT_CONFIG, no-pkg-config):system(pkg-config --exists glib-2.0 gio-2.0 \'gstreamer-0.10 >= 0.10.30\' \'gstreamer-plugins-base-0.10 >= 0.10.30\'): {
231             DEFINES -= ENABLE_VIDEO=0
232             DEFINES += ENABLE_VIDEO=1
233             DEFINES += WTF_USE_GSTREAMER=1
234             DEFINES -= WTF_USE_GSTREAMER=0
235         } else {
236             message("Disabling video due the lack of GLib/Gio/GStreamer.")
237             DEFINES -= ENABLE_VIDEO=1
238             DEFINES += ENABLE_VIDEO=0
239         }
240     } else: contains(MOBILITY_CONFIG, multimedia) {
241         DEFINES -= ENABLE_VIDEO=0
242         DEFINES += ENABLE_VIDEO=1
243         DEFINES -= WTF_USE_QT_MULTIMEDIA=0
244         DEFINES += WTF_USE_QT_MULTIMEDIA=1
245     }
246 }
247
248 !contains(DEFINES, ENABLE_FULLSCREEN_API=.): DEFINES += ENABLE_FULLSCREEN_API=0
249
250 contains(DEFINES, ENABLE_INSPECTOR=0) {
251     DEFINES -= ENABLE_JAVASCRIPT_DEBUGGER=1
252     DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=0
253 }
254 haveQt(4) {
255     haveQtModule(declarative): DEFINES += HAVE_QQUICK1=1
256 }
257 ### FIXME: Add Qt 5 QQuick1 support once QDeclarativeEngine in QQuick2
258 ### is called QmlEngine and it is safe for us to use QQuick1 again.
259
260 ## Forward enabled feature macros to JavaScript enabled features macros
261 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
262 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
263 contains(DEFINES, ENABLE_CHANNEL_MESSAGING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CHANNEL_MESSAGING=1
264 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_ORIENTATION_EVENTS=1
265 contains(DEFINES, ENABLE_SQL_DATABASE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SQL_DATABASE=1
266 contains(DEFINES, ENABLE_DATALIST=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATALIST=1
267 contains(DEFINES, ENABLE_SHARED_SCRIPT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_SCRIPT=1
268 contains(DEFINES, ENABLE_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WORKERS=1
269 contains(DEFINES, ENABLE_SHARED_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_WORKERS=1
270 contains(DEFINES, ENABLE_SHADOW_DOM=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHADOW_DOM=1
271 contains(DEFINES, ENABLE_VIDEO=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO=1
272 contains(DEFINES, ENABLE_XSLT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
273 contains(DEFINES, ENABLE_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FILTERS=1
274 contains(DEFINES, ENABLE_CSS_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CSS_FILTERS=1
275 contains(DEFINES, ENABLE_SVG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
276 contains(DEFINES, ENABLE_SVG_FONTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FONTS=1
277 contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_JAVASCRIPT_DEBUGGER=1
278 contains(DEFINES, ENABLE_GAMEPAD=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GAMEPAD=1
279 contains(DEFINES, ENABLE_WEB_SOCKETS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_SOCKETS=1
280 contains(DEFINES, ENABLE_WEB_TIMING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_TIMING=1
281 contains(DEFINES, ENABLE_TOUCH_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_EVENTS=1
282 contains(DEFINES, ENABLE_GESTURE_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GESTURE_EVENTS=1
283 contains(DEFINES, WTF_USE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += WTF_USE_TILED_BACKING_STORE=1
284 contains(DEFINES, ENABLE_LEGACY_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_LEGACY_NOTIFICATIONS=1
285 contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
286 contains(DEFINES, ENABLE_DETAILS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DETAILS=1
287 contains(DEFINES, ENABLE_METER_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_METER_TAG=1
288 contains(DEFINES, ENABLE_PROGRESS_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_PROGRESS_TAG=1
289 contains(DEFINES, ENABLE_GEOLOCATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GEOLOCATION=1
290 contains(DEFINES, ENABLE_BLOB=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_BLOB=1
291 contains(DEFINES, ENABLE_LEGACY_WEBKIT_BLOB_BUILDER=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_LEGACY_WEBKIT_BLOB_BUILDER=1
292 contains(DEFINES, ENABLE_MEDIA_SOURCE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_SOURCE=1
293 contains(DEFINES, ENABLE_MEDIA_STATISTICS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STATISTICS=1
294 contains(DEFINES, ENABLE_MEDIA_STREAM=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STREAM=1
295 contains(DEFINES, ENABLE_VIDEO_TRACK=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO_TRACK=1
296 contains(DEFINES, ENABLE_DATA_TRANSFER_ITEMS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATA_TRANSFER_ITEMS=1
297 contains(DEFINES, ENABLE_FULLSCREEN_API=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FULLSCREEN_API=1
298 contains(DEFINES, ENABLE_REQUEST_ANIMATION_FRAME=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_REQUEST_ANIMATION_FRAME=1
299 contains(DEFINES, ENABLE_TOUCH_ADJUSTMENT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_ADJUSTMENT=1
300
301 v8 {
302     # This have to be placed here because command line arguments, such as CONFIG+=v8 are
303     # not considered by qmake when processing defaults_pre.prf.
304     root_project_file: message("Building WebKit2 with v8 is not supported currently. Disabling WebKit2.")
305     CONFIG += no_webkit2
306 }
307
308 # Used to compute defaults for the build-webkit script
309 # Don't place anything after this!
310 CONFIG(compute_defaults) {
311     message($$DEFINES)
312     error("Done computing defaults")
313 }