2011-07-08 Simon Fraser <simon.fraser@apple.com>
[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 ## load mobilityconfig if mobility is available
17 load(mobilityconfig, true)
18
19 ## Define default features macros for optional components
20 ## (look for defs in config.h and included files!)
21 # Try to locate sqlite3 source
22 CONFIG(QTDIR_build) {
23     SQLITE3SRCDIR = $$QT_SOURCE_TREE/src/3rdparty/sqlite/
24 } else {
25     SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
26     isEmpty(SQLITE3SRCDIR) {
27         SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
28     }
29 }
30
31 contains(CONFIG, use_system_icu) {
32     DEFINES += WTF_USE_ICU_UNICODE=1
33     DEFINES -= WTF_USE_QT4_UNICODE
34     LIBS += -licuuc -licui18n
35 } else {
36     DEFINES += WTF_USE_QT4_UNICODE=1
37     DEFINES -= WTF_USE_ICU_UNICODE
38 }
39
40 isEmpty(HAVE_QRAWFONT) {
41     # We have to disable SVG Fonts, which rely on the fast path.
42     DEFINES -= ENABLE_SVG_FONTS=1
43     DEFINES += ENABLE_SVG_FONTS=0
44 }
45
46 contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
47     DEFINES+=ENABLE_DATABASE=0 ENABLE_DOM_STORAGE=0 ENABLE_ICONDATABASE=0 ENABLE_WORKERS=0 ENABLE_SHARED_WORKERS=0
48 }
49
50 # turn off SQLITE support if we do not have sqlite3 available
51 !CONFIG(QTDIR_build):win32-*:!exists( $${SQLITE3SRCDIR}/sqlite3.c ): DEFINES += ENABLE_SQLITE=0 ENABLE_DATABASE=0 ENABLE_WORKERS=0 ENABLE_SHARED_WORKERS=0 ENABLE_ICONDATABASE=0 ENABLE_OFFLINE_WEB_APPLICATIONS=0 ENABLE_DOM_STORAGE=0
52
53 !contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=.): DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1
54 !contains(DEFINES, ENABLE_DATABASE=.): DEFINES += ENABLE_DATABASE=1
55 !contains(DEFINES, ENABLE_EVENTSOURCE=.): DEFINES += ENABLE_EVENTSOURCE=1
56 !contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=.): DEFINES += ENABLE_OFFLINE_WEB_APPLICATIONS=1
57 !contains(DEFINES, ENABLE_DOM_STORAGE=.): DEFINES += ENABLE_DOM_STORAGE=1
58 !contains(DEFINES, ENABLE_ICONDATABASE=.): DEFINES += ENABLE_ICONDATABASE=1
59 !contains(DEFINES, ENABLE_CHANNEL_MESSAGING=.): DEFINES += ENABLE_CHANNEL_MESSAGING=1
60 !contains(DEFINES, ENABLE_DIRECTORY_UPLOAD=.): DEFINES += ENABLE_DIRECTORY_UPLOAD=0
61 !contains(DEFINES, ENABLE_FILE_SYSTEM=.): DEFINES += ENABLE_FILE_SYSTEM=0
62 !contains(DEFINES, ENABLE_QUOTA=.): DEFINES += ENABLE_QUOTA=0 
63
64 # turn on SQLITE support if any of the dependent features are turned on
65 !contains(DEFINES, ENABLE_SQLITE=.) {
66   contains(DEFINES, ENABLE_DATABASE=1)|contains(DEFINES, ENABLE_ICONDATABASE=1)|contains(DEFINES, ENABLE_DOM_STORAGE=1)|contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1) {
67     DEFINES += ENABLE_SQLITE=1
68   } else {
69     DEFINES += ENABLE_SQLITE=0
70   }
71 }
72
73 !contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=.): DEFINES += ENABLE_DASHBOARD_SUPPORT=0
74 !contains(DEFINES, ENABLE_FILTERS=.): DEFINES += ENABLE_FILTERS=1
75 !contains(DEFINES, ENABLE_XPATH=.): DEFINES += ENABLE_XPATH=1
76 !contains(DEFINES, ENABLE_WCSS=.): DEFINES += ENABLE_WCSS=0
77 !contains(DEFINES, ENABLE_SHARED_WORKERS=.): DEFINES += ENABLE_SHARED_WORKERS=1
78 !contains(DEFINES, ENABLE_WORKERS=.): DEFINES += ENABLE_WORKERS=1
79 !contains(DEFINES, ENABLE_XHTMLMP=.): DEFINES += ENABLE_XHTMLMP=0
80 !contains(DEFINES, ENABLE_DETAILS=.): DEFINES += ENABLE_DETAILS=1
81 !contains(DEFINES, ENABLE_METER_TAG=.): DEFINES += ENABLE_METER_TAG=1
82 !contains(DEFINES, ENABLE_MHTML=.): DEFINES += ENABLE_MHTML=0
83 !contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
84 !contains(DEFINES, ENABLE_BLOB=.): DEFINES += ENABLE_BLOB=1
85 !contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
86 !contains(DEFINES, ENABLE_INPUT_COLOR=.): DEFINES += ENABLE_INPUT_COLOR=0
87 !contains(DEFINES, ENABLE_INPUT_SPEECH=.): DEFINES += ENABLE_INPUT_SPEECH=0
88 !contains(DEFINES, ENABLE_INSPECTOR=.): DEFINES += ENABLE_INSPECTOR=1
89 !contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
90 !contains(DEFINES, ENABLE_WEB_AUDIO=.): DEFINES += ENABLE_WEB_AUDIO=0
91 !contains(DEFINES, ENABLE_WEBGL=.): DEFINES += ENABLE_WEBGL=0
92 !contains(DEFINES, ENABLE_MEDIA_STATISTICS=.): DEFINES += ENABLE_MEDIA_STATISTICS=0
93 !contains(DEFINES, ENABLE_MEDIA_STREAM=.): DEFINES += ENABLE_MEDIA_STREAM=0
94 !contains(DEFINES, ENABLE_VIDEO_TRACK=.): DEFINES += ENABLE_VIDEO_TRACK=0
95 !contains(DEFINES, ENABLE_TOUCH_ICON_LOADING=.): DEFINES += ENABLE_TOUCH_ICON_LOADING=0
96 !contains(DEFINES, ENABLE_ANIMATION_API=.): DEFINES += ENABLE_ANIMATION_API=0
97
98 # SVG support
99 !contains(DEFINES, ENABLE_SVG=0) {
100     !contains(DEFINES, ENABLE_SVG=.): DEFINES += ENABLE_SVG=1
101     !contains(DEFINES, ENABLE_SVG_FONTS=.): DEFINES += ENABLE_SVG_FONTS=1
102     !contains(DEFINES, ENABLE_SVG_FOREIGN_OBJECT=.): DEFINES += ENABLE_SVG_FOREIGN_OBJECT=1
103     !contains(DEFINES, ENABLE_SVG_ANIMATION=.): DEFINES += ENABLE_SVG_ANIMATION=1
104     !contains(DEFINES, ENABLE_SVG_AS_IMAGE=.): DEFINES += ENABLE_SVG_AS_IMAGE=1
105     !contains(DEFINES, ENABLE_SVG_USE=.): DEFINES += ENABLE_SVG_USE=1
106 } else {
107     DEFINES += ENABLE_SVG_FONTS=0 ENABLE_SVG_FOREIGN_OBJECT=0 ENABLE_SVG_ANIMATION=0 ENABLE_SVG_AS_IMAGE=0 ENABLE_SVG_USE=0
108 }
109
110 # HTML5 datalist support
111 !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
112
113 # Tiled Backing Store support
114 !contains(DEFINES, ENABLE_TILED_BACKING_STORE=.): DEFINES += ENABLE_TILED_BACKING_STORE=1
115
116 # Nescape plugins support (NPAPI)
117 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
118     unix|win32-*:!embedded:!wince*: {
119         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
120     } else {
121         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
122     }
123 }
124
125 # Web Socket support.
126 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
127
128 # Web Timing support.
129 !contains(DEFINES, ENABLE_WEB_TIMING=.): DEFINES += ENABLE_WEB_TIMING=1
130
131 # XSLT support with QtXmlPatterns
132 !contains(DEFINES, ENABLE_XSLT=.) {
133     contains(QT_CONFIG, xmlpatterns):DEFINES += ENABLE_XSLT=1
134     else:DEFINES += ENABLE_XSLT=0
135 }
136
137 # This is experimental and only works on Linux so far.
138 contains(DEFINES, WTF_USE_LIBXML2=1) {
139     DEFINES += ENABLE_XSLT=1
140 }
141
142 # geolocation support if QtMobility exists
143 !CONFIG(QTDIR_build):!contains(DEFINES, ENABLE_GEOLOCATION=.) {
144     contains(MOBILITY_CONFIG, location) {
145        DEFINES += ENABLE_GEOLOCATION=1
146        DEFINES += ENABLE_CLIENT_BASED_GEOLOCATION=1
147     }
148 }
149
150 # orientation support if QtMobility exists
151 contains(MOBILITY_CONFIG, sensors) {
152    !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
153    !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
154    CONFIG *= mobility
155    MOBILITY *= sensors
156 }
157
158 # systeminfo support if QtMobility systeminfo module exists, but only for symbian, maemo and meego
159 symbian|maemo5|maemo6 {
160     !CONFIG(QTDIR_build):!contains(DEFINES, WTF_USE_QT_MOBILITY_SYSTEMINFO=.) {
161         contains(MOBILITY_CONFIG, systeminfo) {
162             DEFINES += WTF_USE_QT_MOBILITY_SYSTEMINFO=1
163         }
164     }
165 }
166
167 # Bearer management is part of Qt 4.7
168 # for older version, check for mobility with bearer
169 !contains(DEFINES, WTF_USE_QT_BEARER=.) {
170      !lessThan(QT_MINOR_VERSION, 7) {
171         DEFINES += WTF_USE_QT_BEARER=1
172      } else {
173         contains(MOBILITY_CONFIG, bearer) {
174             DEFINES += WTF_USE_QT_BEARER=1
175         }
176     }
177 }
178
179 !contains(DEFINES, ENABLE_TOUCH_EVENTS=.): DEFINES += ENABLE_TOUCH_EVENTS=1
180
181 # HTML5 Media Support
182 # We require QtMultimedia
183 !contains(DEFINES, ENABLE_VIDEO=.) {
184     DEFINES -= ENABLE_VIDEO=1
185     DEFINES += ENABLE_VIDEO=0
186
187     contains(DEFINES, USE_QTKIT=1) {
188         DEFINES -= ENABLE_VIDEO=0
189         DEFINES += ENABLE_VIDEO=1
190         DEFINES -= WTF_USE_QT_MULTIMEDIA=1
191         DEFINES += WTF_USE_QT_MULTIMEDIA=0
192     } else: contains(DEFINES, USE_GSTREAMER=1) {
193         DEFINES -= ENABLE_VIDEO=0
194         DEFINES += ENABLE_VIDEO=1
195         DEFINES -= WTF_USE_QT_MULTIMEDIA=1
196         DEFINES += WTF_USE_QT_MULTIMEDIA=0
197     } else:contains(MOBILITY_CONFIG, multimedia) {
198         DEFINES -= ENABLE_VIDEO=0
199         DEFINES += ENABLE_VIDEO=1
200         DEFINES -= WTF_USE_QT_MULTIMEDIA=0
201         DEFINES += WTF_USE_QT_MULTIMEDIA=1
202     }
203 }
204
205 # Used to compute defaults for the build-webkit script
206 CONFIG(compute_defaults) {
207     message($$DEFINES)
208     error("Done computing defaults")
209 }
210
211 contains(DEFINES, ENABLE_WCSS=1) {
212     contains(DEFINES, ENABLE_XHTMLMP=0) {
213         DEFINES -= ENABLE_XHTMLMP=0
214         DEFINES += ENABLE_XHTMLMP=1
215     }
216 }
217
218 ## Forward enabled feature macros to JavaScript enabled features macros
219 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
220 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
221 contains(DEFINES, ENABLE_CHANNEL_MESSAGING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CHANNEL_MESSAGING=1
222 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_ORIENTATION_EVENTS=1
223 contains(DEFINES, ENABLE_EVENTSOURCE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_EVENTSOURCE=1
224 contains(DEFINES, ENABLE_DATABASE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATABASE=1
225 contains(DEFINES, ENABLE_DATALIST=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATALIST=1
226 contains(DEFINES, ENABLE_DOM_STORAGE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DOM_STORAGE=1
227 contains(DEFINES, ENABLE_SHARED_SCRIPT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_SCRIPT=1
228 contains(DEFINES, ENABLE_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WORKERS=1
229 contains(DEFINES, ENABLE_SHARED_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_WORKERS=1
230 contains(DEFINES, ENABLE_VIDEO=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO=1
231 contains(DEFINES, ENABLE_XPATH=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XPATH=1
232 contains(DEFINES, ENABLE_XSLT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
233 contains(DEFINES, ENABLE_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FILTERS=1
234 contains(DEFINES, ENABLE_WCSS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WCSS=1
235 contains(DEFINES, ENABLE_XHTMLMP=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XHTMLMP=1
236 contains(DEFINES, ENABLE_SVG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
237 contains(DEFINES, ENABLE_SVG_ANIMATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_ANIMATION=1
238 contains(DEFINES, ENABLE_SVG_FONTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FONTS=1
239 contains(DEFINES, ENABLE_SVG_FOREIGN_OBJECT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FOREIGN_OBJECT=1
240 contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_JAVASCRIPT_DEBUGGER=1
241 contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_OFFLINE_WEB_APPLICATIONS=1
242 contains(DEFINES, ENABLE_WEB_SOCKETS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_SOCKETS=1
243 contains(DEFINES, ENABLE_WEB_TIMING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_TIMING=1
244 contains(DEFINES, ENABLE_TOUCH_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_EVENTS=1
245 contains(DEFINES, ENABLE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TILED_BACKING_STORE=1
246 contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
247 contains(DEFINES, ENABLE_DETAILS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DETAILS=1
248 contains(DEFINES, ENABLE_METER_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_METER_TAG=1
249 contains(DEFINES, ENABLE_PROGRESS_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_PROGRESS_TAG=1
250 contains(DEFINES, ENABLE_GEOLOCATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GEOLOCATION=1
251 contains(DEFINES, ENABLE_BLOB=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_BLOB=1
252 contains(DEFINES, ENABLE_MEDIA_STATISTICS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STATISTICS=1
253 contains(DEFINES, ENABLE_MEDIA_STREAM=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STREAM=1
254 contains(DEFINES, ENABLE_VIDEO_TRACK=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO_TRACK=1
255 contains(DEFINES, ENABLE_DATA_TRANSFER_ITEMS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATA_TRANSFER_ITEMS=1