fe20fdb0e2d133917a872e2500a3ec4c91678222
[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 # Load results of config tests (only supported in Qt 5)
9 haveQt(5): include($${ROOT_BUILD_DIR}/Tools/qmake/.qmake.cache, , true)
10
11 CONFIG(minimal) {
12     DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
13 }
14
15 CONFIG(production) {
16     DEFINES += ENABLE_XSLT=0
17     DEFINES += ENABLE_WEB_TIMING=0
18 }
19
20 meegotouch {
21     DEFINES += WTF_USE_MEEGOTOUCH=1
22 }
23
24 ## load mobilityconfig if mobility is available
25 load(mobilityconfig, true)
26
27 # Try to locate sqlite3 source
28 SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
29 isEmpty(SQLITE3SRCDIR) {
30     SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
31 }
32
33 haveQt(5):contains(QT_CONFIG,icu) {
34     DEFINES += WTF_USE_ICU_UNICODE=1
35     DEFINES -= WTF_USE_QT4_UNICODE
36 } else {
37     DEFINES += WTF_USE_QT4_UNICODE=1
38     DEFINES -= WTF_USE_ICU_UNICODE
39 }
40
41 isEmpty(HAVE_QRAWFONT) {
42     # We have to disable SVG Fonts, which rely on the fast path.
43     DEFINES -= ENABLE_SVG_FONTS=1
44     DEFINES += ENABLE_SVG_FONTS=0
45 }
46
47 # We need fontconfig to set up the test fonts for DumpRenderTree and WebKitTestRunner.
48 haveQt(5):contains(config_test_fontconfig, yes):!mac {
49     DEFINES += HAVE_FONTCONFIG=1
50 }
51 haveQt(4):unix:!mac:!embedded {
52     DEFINES += HAVE_FONTCONFIG=1
53 }
54
55
56 !contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=.): DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1
57 !contains(DEFINES, ENABLE_GAMEPAD=.): DEFINES += ENABLE_GAMEPAD=0
58 !contains(DEFINES, ENABLE_SQL_DATABASE=.): DEFINES += ENABLE_SQL_DATABASE=1
59 !contains(DEFINES, ENABLE_ICONDATABASE=.): DEFINES += ENABLE_ICONDATABASE=1
60 !contains(DEFINES, ENABLE_CHANNEL_MESSAGING=.): DEFINES += ENABLE_CHANNEL_MESSAGING=1
61 !contains(DEFINES, ENABLE_DIRECTORY_UPLOAD=.): DEFINES += ENABLE_DIRECTORY_UPLOAD=0
62 !contains(DEFINES, ENABLE_FILE_SYSTEM=.): DEFINES += ENABLE_FILE_SYSTEM=0
63 !contains(DEFINES, ENABLE_QUOTA=.): DEFINES += ENABLE_QUOTA=0
64 !contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=.): DEFINES += ENABLE_DASHBOARD_SUPPORT=0
65 !contains(DEFINES, ENABLE_FILTERS=.): DEFINES += ENABLE_FILTERS=1
66 !contains(DEFINES, ENABLE_CSS_FILTERS=.): DEFINES += ENABLE_CSS_FILTERS=1
67 !contains(DEFINES, ENABLE_SHARED_WORKERS=.): DEFINES += ENABLE_SHARED_WORKERS=1
68 !contains(DEFINES, ENABLE_SHADOW_DOM=.): DEFINES += ENABLE_SHADOW_DOM=0
69 !contains(DEFINES, ENABLE_WORKERS=.): DEFINES += ENABLE_WORKERS=1
70 !contains(DEFINES, ENABLE_DETAILS=.): DEFINES += ENABLE_DETAILS=1
71 !contains(DEFINES, ENABLE_METER_TAG=.): DEFINES += ENABLE_METER_TAG=1
72 !contains(DEFINES, ENABLE_MHTML=.): DEFINES += ENABLE_MHTML=0
73 !contains(DEFINES, ENABLE_MICRODATA=.): DEFINES += ENABLE_MICRODATA=0
74 !contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
75 !contains(DEFINES, ENABLE_BLOB=.): DEFINES += ENABLE_BLOB=1
76 !contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
77 !contains(DEFINES, ENABLE_INPUT_COLOR=.): DEFINES += ENABLE_INPUT_COLOR=0
78 !contains(DEFINES, ENABLE_INPUT_SPEECH=.): DEFINES += ENABLE_INPUT_SPEECH=0
79 !contains(DEFINES, ENABLE_INSPECTOR=.): DEFINES += ENABLE_INSPECTOR=1
80 !contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
81 !contains(DEFINES, ENABLE_WEB_AUDIO=.): DEFINES += ENABLE_WEB_AUDIO=0
82 !contains(DEFINES, ENABLE_MEDIA_SOURCE=.): DEFINES += ENABLE_MEDIA_SOURCE=0
83 !contains(DEFINES, ENABLE_MEDIA_STATISTICS=.): DEFINES += ENABLE_MEDIA_STATISTICS=0
84 !contains(DEFINES, ENABLE_MEDIA_STREAM=.): DEFINES += ENABLE_MEDIA_STREAM=0
85 !contains(DEFINES, ENABLE_VIDEO_TRACK=.): DEFINES += ENABLE_VIDEO_TRACK=0
86 !contains(DEFINES, ENABLE_TOUCH_ICON_LOADING=.): DEFINES += ENABLE_TOUCH_ICON_LOADING=0
87 !contains(DEFINES, ENABLE_ANIMATION_API=.): DEFINES += ENABLE_ANIMATION_API=0
88
89 # SVG support
90 !contains(DEFINES, ENABLE_SVG=0) {
91     !contains(DEFINES, ENABLE_SVG=.): DEFINES += ENABLE_SVG=1
92     !contains(DEFINES, ENABLE_SVG_FONTS=.): DEFINES += ENABLE_SVG_FONTS=1
93 } else {
94     DEFINES += ENABLE_SVG_FONTS=0
95 }
96
97 # HTML5 datalist support
98 !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
99
100 # Tiled Backing Store support
101 !contains(DEFINES, WTF_USE_TILED_BACKING_STORE=.): DEFINES += WTF_USE_TILED_BACKING_STORE=1
102
103 # Nescape plugins support (NPAPI)
104 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
105     unix:haveQt(4)|win32-*:!embedded:!wince*: {
106         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
107     } else {
108         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
109     }
110 }
111
112 # Netscape plugins support for WebKit2
113 !no_webkit2:!contains(DEFINES, PLUGIN_ARCHITECTURE_UNSUPPORTED): {
114     # Disable xlib plugins while they're in-process, because they crash
115     # as soon as an installed npapi plugin uses Qt 4.
116     false:contains(QT_CONFIG, xcb-xlib) {
117         CONFIG += plugin_backend_xlib
118         DEFINES += PLUGIN_ARCHITECTURE_X11=1 \
119                    PLUGIN_ARCHITECTURE_UNSUPPORTED=0
120     } else {
121         DEFINES += PLUGIN_ARCHITECTURE_UNSUPPORTED=1
122     }
123 }
124
125 # QStyle detection
126 haveQt(4)|!isEmpty(QT.widgets.name): DEFINES += HAVE_QSTYLE=1
127
128 # WebGL support
129 contains(QT_CONFIG, opengl):!win32-* {
130     !contains(DEFINES, ENABLE_WEBGL=.): DEFINES += ENABLE_WEBGL=1
131 } else {
132     DEFINES += ENABLE_WEBGL=0
133 }
134
135 # Web Socket support.
136 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
137
138 # Web Timing support.
139 !contains(DEFINES, ENABLE_WEB_TIMING=.): DEFINES += ENABLE_WEB_TIMING=1
140
141 !contains(DEFINES, ENABLE_REQUEST_ANIMATION_FRAME=.): DEFINES += ENABLE_REQUEST_ANIMATION_FRAME=1
142
143 # XSLT support with QtXmlPatterns
144 !contains(DEFINES, ENABLE_XSLT=.) {
145     contains(QT_CONFIG, xmlpatterns):DEFINES += ENABLE_XSLT=1
146     else:DEFINES += ENABLE_XSLT=0
147 }
148
149 # This is experimental and only works on Linux so far.
150 contains(DEFINES, WTF_USE_LIBXML2=1) {
151     DEFINES += ENABLE_XSLT=1
152 }
153
154 # geolocation support if QtMobility exists
155 !contains(DEFINES, ENABLE_GEOLOCATION=.) {
156     contains(MOBILITY_CONFIG, location)|contains(QT_CONFIG, location) {
157        DEFINES += ENABLE_GEOLOCATION=1
158        DEFINES += ENABLE_CLIENT_BASED_GEOLOCATION=1
159     }
160 }
161
162 # orientation support if QtMobility exists
163 contains(MOBILITY_CONFIG, sensors) {
164    !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
165    !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
166    CONFIG *= mobility
167    MOBILITY *= sensors
168 }
169
170 !contains(DEFINES, ENABLE_TOUCH_EVENTS=.): DEFINES += ENABLE_TOUCH_EVENTS=1
171 !contains(DEFINES, ENABLE_GESTURE_EVENTS=.): DEFINES += ENABLE_GESTURE_EVENTS=1
172
173 # HTML5 Media Support
174 # We require QtMultimedia
175 !contains(DEFINES, ENABLE_VIDEO=.) {
176     DEFINES -= ENABLE_VIDEO=1
177     DEFINES += ENABLE_VIDEO=0
178
179     mac:!contains(DEFINES, USE_QTMULTIMEDIA=1) {
180         DEFINES -= ENABLE_VIDEO=0
181         DEFINES += ENABLE_VIDEO=1
182         DEFINES += WTF_USE_QTKIT=1
183         DEFINES -= WTF_USE_QTKIT=0
184     } else: linux-*:!contains(DEFINES, USE_QTMULTIMEDIA=1) {
185         !contains(QT_CONFIG, no-pkg-config):system(pkg-config --exists glib-2.0 gio-2.0 gstreamer-0.10): {
186             DEFINES -= ENABLE_VIDEO=0
187             DEFINES += ENABLE_VIDEO=1
188             DEFINES += WTF_USE_GSTREAMER=1
189             DEFINES -= WTF_USE_GSTREAMER=0
190         } else {
191             message("Disabling video due the lack of GLib/Gio/GStreamer.")
192             DEFINES -= ENABLE_VIDEO=1
193             DEFINES += ENABLE_VIDEO=0
194         }
195     } else: contains(MOBILITY_CONFIG, multimedia) {
196         DEFINES -= ENABLE_VIDEO=0
197         DEFINES += ENABLE_VIDEO=1
198         DEFINES -= WTF_USE_QT_MULTIMEDIA=0
199         DEFINES += WTF_USE_QT_MULTIMEDIA=1
200     }
201 }
202
203 !contains(DEFINES, ENABLE_FULLSCREEN_API=.): DEFINES += ENABLE_FULLSCREEN_API=0
204
205 ## Forward enabled feature macros to JavaScript enabled features macros
206 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
207 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
208 contains(DEFINES, ENABLE_CHANNEL_MESSAGING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CHANNEL_MESSAGING=1
209 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_ORIENTATION_EVENTS=1
210 contains(DEFINES, ENABLE_SQL_DATABASE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SQL_DATABASE=1
211 contains(DEFINES, ENABLE_DATALIST=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATALIST=1
212 contains(DEFINES, ENABLE_SHARED_SCRIPT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_SCRIPT=1
213 contains(DEFINES, ENABLE_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WORKERS=1
214 contains(DEFINES, ENABLE_SHARED_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_WORKERS=1
215 contains(DEFINES, ENABLE_SHADOW_DOM=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHADOW_DOM=1
216 contains(DEFINES, ENABLE_VIDEO=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO=1
217 contains(DEFINES, ENABLE_XSLT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
218 contains(DEFINES, ENABLE_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FILTERS=1
219 contains(DEFINES, ENABLE_CSS_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CSS_FILTERS=1
220 contains(DEFINES, ENABLE_SVG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
221 contains(DEFINES, ENABLE_SVG_FONTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FONTS=1
222 contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_JAVASCRIPT_DEBUGGER=1
223 contains(DEFINES, ENABLE_GAMEPAD=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GAMEPAD=1
224 contains(DEFINES, ENABLE_WEB_SOCKETS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_SOCKETS=1
225 contains(DEFINES, ENABLE_WEB_TIMING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_TIMING=1
226 contains(DEFINES, ENABLE_TOUCH_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_EVENTS=1
227 contains(DEFINES, ENABLE_GESTURE_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GESTURE_EVENTS=1
228 contains(DEFINES, WTF_USE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += WTF_USE_TILED_BACKING_STORE=1
229 contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
230 contains(DEFINES, ENABLE_DETAILS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DETAILS=1
231 contains(DEFINES, ENABLE_METER_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_METER_TAG=1
232 contains(DEFINES, ENABLE_PROGRESS_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_PROGRESS_TAG=1
233 contains(DEFINES, ENABLE_GEOLOCATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GEOLOCATION=1
234 contains(DEFINES, ENABLE_BLOB=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_BLOB=1
235 contains(DEFINES, ENABLE_MEDIA_SOURCE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_SOURCE=1
236 contains(DEFINES, ENABLE_MEDIA_STATISTICS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STATISTICS=1
237 contains(DEFINES, ENABLE_MEDIA_STREAM=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STREAM=1
238 contains(DEFINES, ENABLE_VIDEO_TRACK=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO_TRACK=1
239 contains(DEFINES, ENABLE_DATA_TRANSFER_ITEMS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATA_TRANSFER_ITEMS=1
240 contains(DEFINES, ENABLE_FULLSCREEN_API=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FULLSCREEN_API=1
241 contains(DEFINES, ENABLE_REQUEST_ANIMATION_FRAME=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_REQUEST_ANIMATION_FRAME=1
242
243 # Used to compute defaults for the build-webkit script
244 # Don't place anything after this!
245 CONFIG(compute_defaults) {
246     message($$DEFINES)
247     error("Done computing defaults")
248 }