452e44b66bf884e7cc9f493c8ecec10807f2ad6a
[WebKit-https.git] / Source / WebCore / features.pri
1 # Setting up features (enabled/disabled)
2
3 CONFIG(minimal) {
4     DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
5 }
6
7 CONFIG(production) {
8     DEFINES += ENABLE_XSLT=0
9     DEFINES += ENABLE_WEB_TIMING=0
10 }
11
12 meegotouch {
13     DEFINES += WTF_USE_MEEGOTOUCH=1
14 }
15
16 # SQLite is required to build WebKit
17 DEFINES += ENABLE_SQLITE=1
18
19 ## load mobilityconfig if mobility is available
20 load(mobilityconfig, true)
21
22 # Try to locate sqlite3 source
23 SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
24 isEmpty(SQLITE3SRCDIR) {
25     SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
26 }
27
28 contains(CONFIG, use_system_icu) {
29     DEFINES += WTF_USE_ICU_UNICODE=1
30     DEFINES -= WTF_USE_QT4_UNICODE
31     LIBS += -licuuc -licui18n
32 } else {
33     DEFINES += WTF_USE_QT4_UNICODE=1
34     DEFINES -= WTF_USE_ICU_UNICODE
35 }
36
37 isEmpty(HAVE_QRAWFONT) {
38     # We have to disable SVG Fonts, which rely on the fast path.
39     DEFINES -= ENABLE_SVG_FONTS=1
40     DEFINES += ENABLE_SVG_FONTS=0
41 }
42
43 !contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=.): DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1
44 !contains(DEFINES, ENABLE_GAMEPAD=.): DEFINES += ENABLE_GAMEPAD=0
45 !contains(DEFINES, ENABLE_SQL_DATABASE=.): DEFINES += ENABLE_SQL_DATABASE=1
46 !contains(DEFINES, ENABLE_ICONDATABASE=.): DEFINES += ENABLE_ICONDATABASE=1
47 !contains(DEFINES, ENABLE_CHANNEL_MESSAGING=.): DEFINES += ENABLE_CHANNEL_MESSAGING=1
48 !contains(DEFINES, ENABLE_DIRECTORY_UPLOAD=.): DEFINES += ENABLE_DIRECTORY_UPLOAD=0
49 !contains(DEFINES, ENABLE_FILE_SYSTEM=.): DEFINES += ENABLE_FILE_SYSTEM=0
50 !contains(DEFINES, ENABLE_QUOTA=.): DEFINES += ENABLE_QUOTA=0 
51 !contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=.): DEFINES += ENABLE_DASHBOARD_SUPPORT=0
52 !contains(DEFINES, ENABLE_FILTERS=.): DEFINES += ENABLE_FILTERS=1
53 !contains(DEFINES, ENABLE_XPATH=.): DEFINES += ENABLE_XPATH=1
54 !contains(DEFINES, ENABLE_SHARED_WORKERS=.): DEFINES += ENABLE_SHARED_WORKERS=1
55 !contains(DEFINES, ENABLE_WORKERS=.): DEFINES += ENABLE_WORKERS=1
56 !contains(DEFINES, ENABLE_DETAILS=.): DEFINES += ENABLE_DETAILS=1
57 !contains(DEFINES, ENABLE_METER_TAG=.): DEFINES += ENABLE_METER_TAG=1
58 !contains(DEFINES, ENABLE_MHTML=.): DEFINES += ENABLE_MHTML=0
59 !contains(DEFINES, ENABLE_MICRODATA=.): DEFINES += ENABLE_MICRODATA=0
60 !contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
61 !contains(DEFINES, ENABLE_BLOB=.): DEFINES += ENABLE_BLOB=1
62 !contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
63 !contains(DEFINES, ENABLE_INPUT_COLOR=.): DEFINES += ENABLE_INPUT_COLOR=0
64 !contains(DEFINES, ENABLE_INPUT_SPEECH=.): DEFINES += ENABLE_INPUT_SPEECH=0
65 !contains(DEFINES, ENABLE_INSPECTOR=.): DEFINES += ENABLE_INSPECTOR=1
66 !contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
67 !contains(DEFINES, ENABLE_WEB_AUDIO=.): DEFINES += ENABLE_WEB_AUDIO=0
68 !contains(DEFINES, ENABLE_MEDIA_SOURCE=.): DEFINES += ENABLE_MEDIA_SOURCE=0
69 !contains(DEFINES, ENABLE_MEDIA_STATISTICS=.): DEFINES += ENABLE_MEDIA_STATISTICS=0
70 !contains(DEFINES, ENABLE_MEDIA_STREAM=.): DEFINES += ENABLE_MEDIA_STREAM=0
71 !contains(DEFINES, ENABLE_VIDEO_TRACK=.): DEFINES += ENABLE_VIDEO_TRACK=0
72 !contains(DEFINES, ENABLE_TOUCH_ICON_LOADING=.): DEFINES += ENABLE_TOUCH_ICON_LOADING=0
73 !contains(DEFINES, ENABLE_ANIMATION_API=.): DEFINES += ENABLE_ANIMATION_API=0
74
75 # SVG support
76 !contains(DEFINES, ENABLE_SVG=0) {
77     !contains(DEFINES, ENABLE_SVG=.): DEFINES += ENABLE_SVG=1
78     !contains(DEFINES, ENABLE_SVG_FONTS=.): DEFINES += ENABLE_SVG_FONTS=1
79 } else {
80     DEFINES += ENABLE_SVG_FONTS=0
81 }
82
83 # HTML5 datalist support
84 !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
85
86 # Tiled Backing Store support
87 !contains(DEFINES, WTF_USE_TILED_BACKING_STORE=.): DEFINES += WTF_USE_TILED_BACKING_STORE=1
88
89 # Nescape plugins support (NPAPI)
90 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
91     unix|win32-*:!embedded:!wince*: {
92         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
93     } else {
94         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
95     }
96 }
97
98 # WebGL support
99 contains(QT_CONFIG, opengl):!win32-* {
100     !contains(DEFINES, ENABLE_WEBGL=.): DEFINES += ENABLE_WEBGL=1
101 } else {
102     DEFINES += ENABLE_WEBGL=0
103 }
104
105 # Web Socket support.
106 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
107
108 # Web Timing support.
109 !contains(DEFINES, ENABLE_WEB_TIMING=.): DEFINES += ENABLE_WEB_TIMING=1
110
111 # XSLT support with QtXmlPatterns
112 !contains(DEFINES, ENABLE_XSLT=.) {
113     contains(QT_CONFIG, xmlpatterns):DEFINES += ENABLE_XSLT=1
114     else:DEFINES += ENABLE_XSLT=0
115 }
116
117 # This is experimental and only works on Linux so far.
118 contains(DEFINES, WTF_USE_LIBXML2=1) {
119     DEFINES += ENABLE_XSLT=1
120 }
121
122 # geolocation support if QtMobility exists
123 !contains(DEFINES, ENABLE_GEOLOCATION=.) {
124     contains(MOBILITY_CONFIG, location) {
125        DEFINES += ENABLE_GEOLOCATION=1
126        DEFINES += ENABLE_CLIENT_BASED_GEOLOCATION=1
127     }
128 }
129
130 # orientation support if QtMobility exists
131 contains(MOBILITY_CONFIG, sensors) {
132    !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
133    !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
134    CONFIG *= mobility
135    MOBILITY *= sensors
136 }
137
138 # systeminfo support if QtMobility systeminfo module exists, but only for maemo and meego
139 maemo5|maemo6 {
140     !contains(DEFINES, WTF_USE_QT_MOBILITY_SYSTEMINFO=.) {
141         contains(MOBILITY_CONFIG, systeminfo) {
142             DEFINES += WTF_USE_QT_MOBILITY_SYSTEMINFO=1
143         }
144     }
145 }
146
147 !contains(DEFINES, ENABLE_TOUCH_EVENTS=.): DEFINES += ENABLE_TOUCH_EVENTS=1
148
149 # HTML5 Media Support
150 # We require QtMultimedia
151 !contains(DEFINES, ENABLE_VIDEO=.) {
152     DEFINES -= ENABLE_VIDEO=1
153     DEFINES += ENABLE_VIDEO=0
154
155     mac:!contains(DEFINES, USE_QTMULTIMEDIA=1) {
156         DEFINES -= ENABLE_VIDEO=0
157         DEFINES += ENABLE_VIDEO=1
158         DEFINES += WTF_USE_QTKIT=1
159         DEFINES -= WTF_USE_QTKIT=0
160     } else: linux-*:!contains(DEFINES, USE_QTMULTIMEDIA=1) {
161         !contains(QT_CONFIG, no-pkg-config):system(pkg-config --exists glib-2.0 gio-2.0 gstreamer-0.10): {
162             DEFINES -= ENABLE_VIDEO=0
163             DEFINES += ENABLE_VIDEO=1
164             DEFINES += WTF_USE_GSTREAMER=1
165             DEFINES -= WTF_USE_GSTREAMER=0
166         } else {
167             message("Disabling video due the lack of GLib/Gio/GStreamer.")
168             DEFINES -= ENABLE_VIDEO=1
169             DEFINES += ENABLE_VIDEO=0
170         }
171     } else: contains(MOBILITY_CONFIG, multimedia) {
172         DEFINES -= ENABLE_VIDEO=0
173         DEFINES += ENABLE_VIDEO=1
174         DEFINES -= WTF_USE_QT_MULTIMEDIA=0
175         DEFINES += WTF_USE_QT_MULTIMEDIA=1
176     }
177 }
178
179 !contains(DEFINES, ENABLE_FULLSCREEN_API=.): DEFINES += ENABLE_FULLSCREEN_API=1
180
181 ## Forward enabled feature macros to JavaScript enabled features macros
182 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
183 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
184 contains(DEFINES, ENABLE_CHANNEL_MESSAGING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CHANNEL_MESSAGING=1
185 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_ORIENTATION_EVENTS=1
186 contains(DEFINES, ENABLE_SQL_DATABASE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SQL_DATABASE=1
187 contains(DEFINES, ENABLE_DATALIST=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATALIST=1
188 contains(DEFINES, ENABLE_SHARED_SCRIPT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_SCRIPT=1
189 contains(DEFINES, ENABLE_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WORKERS=1
190 contains(DEFINES, ENABLE_SHARED_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_WORKERS=1
191 contains(DEFINES, ENABLE_VIDEO=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO=1
192 contains(DEFINES, ENABLE_XPATH=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XPATH=1
193 contains(DEFINES, ENABLE_XSLT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
194 contains(DEFINES, ENABLE_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FILTERS=1
195 contains(DEFINES, ENABLE_SVG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
196 contains(DEFINES, ENABLE_SVG_FONTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FONTS=1
197 contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_JAVASCRIPT_DEBUGGER=1
198 contains(DEFINES, ENABLE_GAMEPAD=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GAMEPAD=1
199 contains(DEFINES, ENABLE_WEB_SOCKETS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_SOCKETS=1
200 contains(DEFINES, ENABLE_WEB_TIMING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_TIMING=1
201 contains(DEFINES, ENABLE_TOUCH_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_EVENTS=1
202 contains(DEFINES, WTF_USE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += WTF_USE_TILED_BACKING_STORE=1
203 contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
204 contains(DEFINES, ENABLE_DETAILS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DETAILS=1
205 contains(DEFINES, ENABLE_METER_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_METER_TAG=1
206 contains(DEFINES, ENABLE_PROGRESS_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_PROGRESS_TAG=1
207 contains(DEFINES, ENABLE_GEOLOCATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GEOLOCATION=1
208 contains(DEFINES, ENABLE_BLOB=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_BLOB=1
209 contains(DEFINES, ENABLE_MEDIA_SOURCE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_SOURCE=1
210 contains(DEFINES, ENABLE_MEDIA_STATISTICS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STATISTICS=1
211 contains(DEFINES, ENABLE_MEDIA_STREAM=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STREAM=1
212 contains(DEFINES, ENABLE_VIDEO_TRACK=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO_TRACK=1
213 contains(DEFINES, ENABLE_DATA_TRANSFER_ITEMS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATA_TRANSFER_ITEMS=1
214 contains(DEFINES, ENABLE_FULLSCREEN_API=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FULLSCREEN_API=1
215
216 # Used to compute defaults for the build-webkit script
217 # Don't place anything after this!
218 CONFIG(compute_defaults) {
219     message($$DEFINES)
220     error("Done computing defaults")
221 }