2011-04-11 Anna Cavender <annacc@chromium.org>
[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(DEFINES, ENABLE_SINGLE_THREADED=1) {
32     DEFINES+=ENABLE_DATABASE=0 ENABLE_DOM_STORAGE=0 ENABLE_ICONDATABASE=0 ENABLE_WORKERS=0 ENABLE_SHARED_WORKERS=0
33 }
34
35 # turn off SQLITE support if we do not have sqlite3 available
36 !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
37
38 !contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=.): DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1
39 !contains(DEFINES, ENABLE_DATABASE=.): DEFINES += ENABLE_DATABASE=1
40 !contains(DEFINES, ENABLE_EVENTSOURCE=.): DEFINES += ENABLE_EVENTSOURCE=1
41 !contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=.): DEFINES += ENABLE_OFFLINE_WEB_APPLICATIONS=1
42 !contains(DEFINES, ENABLE_DOM_STORAGE=.): DEFINES += ENABLE_DOM_STORAGE=1
43 !contains(DEFINES, ENABLE_ICONDATABASE=.): DEFINES += ENABLE_ICONDATABASE=1
44 !contains(DEFINES, ENABLE_CHANNEL_MESSAGING=.): DEFINES += ENABLE_CHANNEL_MESSAGING=1
45 !contains(DEFINES, ENABLE_DIRECTORY_UPLOAD=.): DEFINES += ENABLE_DIRECTORY_UPLOAD=0
46 !contains(DEFINES, ENABLE_FILE_SYSTEM=.): DEFINES += ENABLE_FILE_SYSTEM=0
47 !contains(DEFINES, ENABLE_QUOTA=.): DEFINES += ENABLE_QUOTA=0 
48
49 # turn on SQLITE support if any of the dependent features are turned on
50 !contains(DEFINES, ENABLE_SQLITE=.) {
51   contains(DEFINES, ENABLE_DATABASE=1)|contains(DEFINES, ENABLE_ICONDATABASE=1)|contains(DEFINES, ENABLE_DOM_STORAGE=1)|contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1) {
52     DEFINES += ENABLE_SQLITE=1
53   } else {
54     DEFINES += ENABLE_SQLITE=0
55   }
56 }
57
58 !contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=.): DEFINES += ENABLE_DASHBOARD_SUPPORT=0
59 !contains(DEFINES, ENABLE_FILTERS=.): DEFINES += ENABLE_FILTERS=1
60 !contains(DEFINES, ENABLE_XPATH=.): DEFINES += ENABLE_XPATH=1
61 #!contains(DEFINES, ENABLE_XBL=.): DEFINES += ENABLE_XBL=1
62 !contains(DEFINES, ENABLE_WCSS=.): DEFINES += ENABLE_WCSS=0
63 !contains(DEFINES, ENABLE_WML=.): DEFINES += ENABLE_WML=0
64 !contains(DEFINES, ENABLE_SHARED_WORKERS=.): DEFINES += ENABLE_SHARED_WORKERS=1
65 !contains(DEFINES, ENABLE_WORKERS=.): DEFINES += ENABLE_WORKERS=1
66 !contains(DEFINES, ENABLE_XHTMLMP=.): DEFINES += ENABLE_XHTMLMP=0
67 !contains(DEFINES, ENABLE_DATAGRID=.): DEFINES += ENABLE_DATAGRID=0
68 !contains(DEFINES, ENABLE_METER_TAG=.): DEFINES += ENABLE_METER_TAG=1
69 !contains(DEFINES, ENABLE_PROGRESS_TAG=.): DEFINES += ENABLE_PROGRESS_TAG=1
70 !contains(DEFINES, ENABLE_BLOB=.): DEFINES += ENABLE_BLOB=1
71 !contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
72 !contains(DEFINES, ENABLE_IMAGE_RESIZER=.): DEFINES += ENABLE_IMAGE_RESIZER=0
73 !contains(DEFINES, ENABLE_INPUT_SPEECH=.): DEFINES += ENABLE_INPUT_SPEECH=0
74 !contains(DEFINES, ENABLE_INSPECTOR=.): DEFINES += ENABLE_INSPECTOR=1
75 !contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
76 !contains(DEFINES, ENABLE_WEB_AUDIO=.): DEFINES += ENABLE_WEB_AUDIO=0
77 !contains(DEFINES, ENABLE_WEBGL=.): DEFINES += ENABLE_WEBGL=0
78 !contains(DEFINES, ENABLE_MEDIA_STATISTICS=.): DEFINES += ENABLE_MEDIA_STATISTICS=0
79 !contains(DEFINES, ENABLE_TRACK=.): DEFINES += ENABLE_TRACK=0
80
81 # SVG support
82 !contains(DEFINES, ENABLE_SVG=0) {
83     !contains(DEFINES, ENABLE_SVG=.): DEFINES += ENABLE_SVG=1
84     !contains(DEFINES, ENABLE_SVG_FONTS=.): DEFINES += ENABLE_SVG_FONTS=1
85     !contains(DEFINES, ENABLE_SVG_FOREIGN_OBJECT=.): DEFINES += ENABLE_SVG_FOREIGN_OBJECT=1
86     !contains(DEFINES, ENABLE_SVG_ANIMATION=.): DEFINES += ENABLE_SVG_ANIMATION=1
87     !contains(DEFINES, ENABLE_SVG_AS_IMAGE=.): DEFINES += ENABLE_SVG_AS_IMAGE=1
88     !contains(DEFINES, ENABLE_SVG_USE=.): DEFINES += ENABLE_SVG_USE=1
89 } else {
90     DEFINES += ENABLE_SVG_FONTS=0 ENABLE_SVG_FOREIGN_OBJECT=0 ENABLE_SVG_ANIMATION=0 ENABLE_SVG_AS_IMAGE=0 ENABLE_SVG_USE=0
91 }
92
93 # HTML5 datalist support
94 !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
95
96 # Tiled Backing Store support
97 !contains(DEFINES, ENABLE_TILED_BACKING_STORE=.): DEFINES += ENABLE_TILED_BACKING_STORE=1
98
99 # Nescape plugins support (NPAPI)
100 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
101     unix|win32-*:!embedded:!wince*: {
102         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
103     } else {
104         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
105     }
106 }
107
108 # Web Socket support.
109 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
110
111 # Web Timing support.
112 !contains(DEFINES, ENABLE_WEB_TIMING=.): DEFINES += ENABLE_WEB_TIMING=1
113
114 # XSLT support with QtXmlPatterns
115 !contains(DEFINES, ENABLE_XSLT=.) {
116     contains(QT_CONFIG, xmlpatterns):DEFINES += ENABLE_XSLT=1
117     else:DEFINES += ENABLE_XSLT=0
118 }
119
120 # geolocation support if QtMobility exists
121 !CONFIG(QTDIR_build):!contains(DEFINES, ENABLE_GEOLOCATION=.) {
122     contains(MOBILITY_CONFIG, location) {
123        DEFINES += ENABLE_GEOLOCATION=1
124        DEFINES += ENABLE_CLIENT_BASED_GEOLOCATION=1
125     }
126 }
127
128 # orientation support if QtMobility exists
129 contains(MOBILITY_CONFIG, sensors) {
130    !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
131    !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
132    CONFIG *= mobility
133    MOBILITY *= sensors
134 }
135
136 # systeminfo support if QtMobility systeminfo module exists, but only for symbian, maemo and meego
137 symbian|maemo5|maemo6 {
138     !CONFIG(QTDIR_build):!contains(DEFINES, ENABLE_QT_USERAGENT_DEVICEMODEL=.) {
139         contains(MOBILITY_CONFIG, systeminfo) {
140             DEFINES += ENABLE_QT_USERAGENT_DEVICEMODEL=1
141         }
142     }
143 }
144
145 # Bearer management is part of Qt 4.7
146 # for older version, check for mobility with bearer
147 !contains(DEFINES, ENABLE_QT_BEARER=.) {
148      !lessThan(QT_MINOR_VERSION, 7) {
149         DEFINES += ENABLE_QT_BEARER=1
150      } else {
151         contains(MOBILITY_CONFIG, bearer) {
152             DEFINES += ENABLE_QT_BEARER=1
153         }
154     }
155 }
156
157 !contains(DEFINES, ENABLE_TOUCH_EVENTS=.): DEFINES += ENABLE_TOUCH_EVENTS=1
158
159 # HTML5 Media Support
160 # We require QtMultimedia or Phonon
161 !contains(DEFINES, ENABLE_VIDEO=.) {
162     DEFINES -= ENABLE_VIDEO=1
163     DEFINES += ENABLE_VIDEO=0
164
165     contains(DEFINES, USE_GSTREAMER=1) {
166         DEFINES -= ENABLE_VIDEO=0
167         DEFINES += ENABLE_VIDEO=1
168         DEFINES -= WTF_USE_QT_MULTIMEDIA=1
169         DEFINES += WTF_USE_QT_MULTIMEDIA=0
170     } else:contains(MOBILITY_CONFIG, multimedia) {
171         DEFINES -= ENABLE_VIDEO=0
172         DEFINES += ENABLE_VIDEO=1
173         DEFINES -= WTF_USE_QT_MULTIMEDIA=0
174         DEFINES += WTF_USE_QT_MULTIMEDIA=1
175     } else:contains(QT_CONFIG, phonon) {
176         DEFINES -= ENABLE_VIDEO=0
177         DEFINES += ENABLE_VIDEO=1
178         DEFINES -= WTF_USE_QT_MULTIMEDIA=1
179         DEFINES += WTF_USE_QT_MULTIMEDIA=0
180     }
181 }
182
183 # Used to compute defaults for the build-webkit script
184 CONFIG(compute_defaults) {
185     message($$DEFINES)
186     error("Done computing defaults")
187 }
188
189 contains(DEFINES, ENABLE_WCSS=1) {
190     contains(DEFINES, ENABLE_XHTMLMP=0) {
191         DEFINES -= ENABLE_XHTMLMP=0
192         DEFINES += ENABLE_XHTMLMP=1
193     }
194 }
195
196 ## Forward enabled feature macros to JavaScript enabled features macros
197 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
198 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
199 contains(DEFINES, ENABLE_CHANNEL_MESSAGING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CHANNEL_MESSAGING=1
200 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_ORIENTATION_EVENTS=1
201 contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=0): DASHBOARDSUPPORTCSSPROPERTIES -= $$PWD/css/DashboardSupportCSSPropertyNames.in
202 contains(DEFINES, ENABLE_DATAGRID=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATAGRID=1
203 contains(DEFINES, ENABLE_EVENTSOURCE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_EVENTSOURCE=1
204 contains(DEFINES, ENABLE_DATABASE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATABASE=1
205 contains(DEFINES, ENABLE_DATALIST=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATALIST=1
206 contains(DEFINES, ENABLE_DOM_STORAGE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DOM_STORAGE=1
207 contains(DEFINES, ENABLE_SHARED_SCRIPT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_SCRIPT=1
208 contains(DEFINES, ENABLE_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WORKERS=1
209 contains(DEFINES, ENABLE_SHARED_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_WORKERS=1
210 contains(DEFINES, ENABLE_VIDEO=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO=1
211 contains(DEFINES, ENABLE_XPATH=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XPATH=1
212 contains(DEFINES, ENABLE_XSLT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
213 contains(DEFINES, ENABLE_XBL=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XBL=1
214 contains(DEFINES, ENABLE_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FILTERS=1
215 contains(DEFINES, ENABLE_WCSS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WCSS=1
216 contains(DEFINES, ENABLE_WML=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WML=1
217 contains(DEFINES, ENABLE_XHTMLMP=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XHTMLMP=1
218 contains(DEFINES, ENABLE_SVG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
219 contains(DEFINES, ENABLE_SVG_ANIMATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_ANIMATION=1
220 contains(DEFINES, ENABLE_SVG_FONTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FONTS=1
221 contains(DEFINES, ENABLE_SVG_FOREIGN_OBJECT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FOREIGN_OBJECT=1
222 contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_JAVASCRIPT_DEBUGGER=1
223 contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_OFFLINE_WEB_APPLICATIONS=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_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TILED_BACKING_STORE=1
228 contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
229 contains(DEFINES, ENABLE_METER_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_METER_TAG=1
230 contains(DEFINES, ENABLE_PROGRESS_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_PROGRESS_TAG=1
231 contains(DEFINES, ENABLE_GEOLOCATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GEOLOCATION=1
232 contains(DEFINES, ENABLE_BLOB=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_BLOB=1
233 contains(DEFINES, ENABLE_MEDIA_STATISTICS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STATISTICS=1
234 contains(DEFINES, ENABLE_TRACK=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TRACK=1
235 contains(DEFINES, ENABLE_DATA_TRANSFER_ITEMS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATA_TRANSFER_ITEMS=1