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