2011-04-08 Alpha Lam <hclam@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
80 # SVG support
81 !contains(DEFINES, ENABLE_SVG=0) {
82     !contains(DEFINES, ENABLE_SVG=.): DEFINES += ENABLE_SVG=1
83     !contains(DEFINES, ENABLE_SVG_FONTS=.): DEFINES += ENABLE_SVG_FONTS=1
84     !contains(DEFINES, ENABLE_SVG_FOREIGN_OBJECT=.): DEFINES += ENABLE_SVG_FOREIGN_OBJECT=1
85     !contains(DEFINES, ENABLE_SVG_ANIMATION=.): DEFINES += ENABLE_SVG_ANIMATION=1
86     !contains(DEFINES, ENABLE_SVG_AS_IMAGE=.): DEFINES += ENABLE_SVG_AS_IMAGE=1
87     !contains(DEFINES, ENABLE_SVG_USE=.): DEFINES += ENABLE_SVG_USE=1
88 } else {
89     DEFINES += ENABLE_SVG_FONTS=0 ENABLE_SVG_FOREIGN_OBJECT=0 ENABLE_SVG_ANIMATION=0 ENABLE_SVG_AS_IMAGE=0 ENABLE_SVG_USE=0
90 }
91
92 # HTML5 datalist support
93 !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
94
95 # Tiled Backing Store support
96 !contains(DEFINES, ENABLE_TILED_BACKING_STORE=.): DEFINES += ENABLE_TILED_BACKING_STORE=1
97
98 # Nescape plugins support (NPAPI)
99 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
100     unix|win32-*:!embedded:!wince*: {
101         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
102     } else {
103         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
104     }
105 }
106
107 # Web Socket support.
108 !contains(DEFINES, ENABLE_WEB_SOCKETS=.): DEFINES += ENABLE_WEB_SOCKETS=1
109
110 # Web Timing support.
111 !contains(DEFINES, ENABLE_WEB_TIMING=.): DEFINES += ENABLE_WEB_TIMING=1
112
113 # XSLT support with QtXmlPatterns
114 !contains(DEFINES, ENABLE_XSLT=.) {
115     contains(QT_CONFIG, xmlpatterns):DEFINES += ENABLE_XSLT=1
116     else:DEFINES += ENABLE_XSLT=0
117 }
118
119 # geolocation support if QtMobility exists
120 !CONFIG(QTDIR_build):!contains(DEFINES, ENABLE_GEOLOCATION=.) {
121     contains(MOBILITY_CONFIG, location) {
122        DEFINES += ENABLE_GEOLOCATION=1
123        DEFINES += ENABLE_CLIENT_BASED_GEOLOCATION=1
124     }
125 }
126
127 # orientation support if QtMobility exists
128 contains(MOBILITY_CONFIG, sensors) {
129    !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
130    !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
131    CONFIG *= mobility
132    MOBILITY *= sensors
133 }
134
135 # systeminfo support if QtMobility systeminfo module exists, but only for symbian, maemo and meego
136 symbian|maemo5|maemo6 {
137     !CONFIG(QTDIR_build):!contains(DEFINES, ENABLE_QT_USERAGENT_DEVICEMODEL=.) {
138         contains(MOBILITY_CONFIG, systeminfo) {
139             DEFINES += ENABLE_QT_USERAGENT_DEVICEMODEL=1
140         }
141     }
142 }
143
144 # Bearer management is part of Qt 4.7
145 # for older version, check for mobility with bearer
146 !contains(DEFINES, ENABLE_QT_BEARER=.) {
147      !lessThan(QT_MINOR_VERSION, 7) {
148         DEFINES += ENABLE_QT_BEARER=1
149      } else {
150         contains(MOBILITY_CONFIG, bearer) {
151             DEFINES += ENABLE_QT_BEARER=1
152         }
153     }
154 }
155
156 !contains(DEFINES, ENABLE_TOUCH_EVENTS=.): DEFINES += ENABLE_TOUCH_EVENTS=1
157
158 # HTML5 Media Support
159 # We require QtMultimedia or Phonon
160 !contains(DEFINES, ENABLE_VIDEO=.) {
161     DEFINES -= ENABLE_VIDEO=1
162     DEFINES += ENABLE_VIDEO=0
163
164     contains(DEFINES, USE_GSTREAMER=1) {
165         DEFINES -= ENABLE_VIDEO=0
166         DEFINES += ENABLE_VIDEO=1
167         DEFINES -= WTF_USE_QT_MULTIMEDIA=1
168         DEFINES += WTF_USE_QT_MULTIMEDIA=0
169     } else:contains(MOBILITY_CONFIG, multimedia) {
170         DEFINES -= ENABLE_VIDEO=0
171         DEFINES += ENABLE_VIDEO=1
172         DEFINES -= WTF_USE_QT_MULTIMEDIA=0
173         DEFINES += WTF_USE_QT_MULTIMEDIA=1
174     } else:contains(QT_CONFIG, phonon) {
175         DEFINES -= ENABLE_VIDEO=0
176         DEFINES += ENABLE_VIDEO=1
177         DEFINES -= WTF_USE_QT_MULTIMEDIA=1
178         DEFINES += WTF_USE_QT_MULTIMEDIA=0
179     }
180 }
181
182 # Used to compute defaults for the build-webkit script
183 CONFIG(compute_defaults) {
184     message($$DEFINES)
185     error("Done computing defaults")
186 }
187
188 contains(DEFINES, ENABLE_WCSS=1) {
189     contains(DEFINES, ENABLE_XHTMLMP=0) {
190         DEFINES -= ENABLE_XHTMLMP=0
191         DEFINES += ENABLE_XHTMLMP=1
192     }
193 }
194
195 ## Forward enabled feature macros to JavaScript enabled features macros
196 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
197 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
198 contains(DEFINES, ENABLE_CHANNEL_MESSAGING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CHANNEL_MESSAGING=1
199 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_ORIENTATION_EVENTS=1
200 contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=0): DASHBOARDSUPPORTCSSPROPERTIES -= $$PWD/css/DashboardSupportCSSPropertyNames.in
201 contains(DEFINES, ENABLE_DATAGRID=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATAGRID=1
202 contains(DEFINES, ENABLE_EVENTSOURCE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_EVENTSOURCE=1
203 contains(DEFINES, ENABLE_DATABASE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATABASE=1
204 contains(DEFINES, ENABLE_DATALIST=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATALIST=1
205 contains(DEFINES, ENABLE_DOM_STORAGE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DOM_STORAGE=1
206 contains(DEFINES, ENABLE_SHARED_SCRIPT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_SCRIPT=1
207 contains(DEFINES, ENABLE_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WORKERS=1
208 contains(DEFINES, ENABLE_SHARED_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_WORKERS=1
209 contains(DEFINES, ENABLE_VIDEO=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO=1
210 contains(DEFINES, ENABLE_XPATH=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XPATH=1
211 contains(DEFINES, ENABLE_XSLT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
212 contains(DEFINES, ENABLE_XBL=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XBL=1
213 contains(DEFINES, ENABLE_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FILTERS=1
214 contains(DEFINES, ENABLE_WCSS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WCSS=1
215 contains(DEFINES, ENABLE_WML=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WML=1
216 contains(DEFINES, ENABLE_XHTMLMP=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XHTMLMP=1
217 contains(DEFINES, ENABLE_SVG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
218 contains(DEFINES, ENABLE_SVG_ANIMATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_ANIMATION=1
219 contains(DEFINES, ENABLE_SVG_FONTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FONTS=1
220 contains(DEFINES, ENABLE_SVG_FOREIGN_OBJECT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FOREIGN_OBJECT=1
221 contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_JAVASCRIPT_DEBUGGER=1
222 contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_OFFLINE_WEB_APPLICATIONS=1
223 contains(DEFINES, ENABLE_WEB_SOCKETS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_SOCKETS=1
224 contains(DEFINES, ENABLE_WEB_TIMING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_TIMING=1
225 contains(DEFINES, ENABLE_TOUCH_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_EVENTS=1
226 contains(DEFINES, ENABLE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TILED_BACKING_STORE=1
227 contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
228 contains(DEFINES, ENABLE_METER_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_METER_TAG=1
229 contains(DEFINES, ENABLE_PROGRESS_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_PROGRESS_TAG=1
230 contains(DEFINES, ENABLE_GEOLOCATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GEOLOCATION=1
231 contains(DEFINES, ENABLE_BLOB=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_BLOB=1
232 contains(DEFINES, ENABLE_MEDIA_STATISTICS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_MEDIA_STATISTICS=1
233 contains(DEFINES, ENABLE_DATA_TRANSFER_ITEMS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATA_TRANSFER_ITEMS=1