Move WebCore into Source
[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_3D_CANVAS=.): DEFINES += ENABLE_3D_CANVAS=0
77
78 # SVG support
79 !contains(DEFINES, ENABLE_SVG=0) {
80     !contains(DEFINES, ENABLE_SVG=.): DEFINES += ENABLE_SVG=1
81     !contains(DEFINES, ENABLE_SVG_FONTS=.): DEFINES += ENABLE_SVG_FONTS=1
82     !contains(DEFINES, ENABLE_SVG_FOREIGN_OBJECT=.): DEFINES += ENABLE_SVG_FOREIGN_OBJECT=1
83     !contains(DEFINES, ENABLE_SVG_ANIMATION=.): DEFINES += ENABLE_SVG_ANIMATION=1
84     !contains(DEFINES, ENABLE_SVG_AS_IMAGE=.): DEFINES += ENABLE_SVG_AS_IMAGE=1
85     !contains(DEFINES, ENABLE_SVG_USE=.): DEFINES += ENABLE_SVG_USE=1
86 } else {
87     DEFINES += ENABLE_SVG_FONTS=0 ENABLE_SVG_FOREIGN_OBJECT=0 ENABLE_SVG_ANIMATION=0 ENABLE_SVG_AS_IMAGE=0 ENABLE_SVG_USE=0
88 }
89
90 # HTML5 datalist support
91 !contains(DEFINES, ENABLE_DATALIST=.): DEFINES += ENABLE_DATALIST=1
92
93 # Tiled Backing Store support
94 !contains(DEFINES, ENABLE_TILED_BACKING_STORE=.): DEFINES += ENABLE_TILED_BACKING_STORE=1
95
96 # Nescape plugins support (NPAPI)
97 !contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=.) {
98     unix|win32-*:!embedded:!wince*: {
99         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=1
100     } else {
101         DEFINES += ENABLE_NETSCAPE_PLUGIN_API=0
102     }
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 # geolocation support if QtMobility exists
118 !CONFIG(QTDIR_build):!contains(DEFINES, ENABLE_GEOLOCATION=.) {
119     contains(MOBILITY_CONFIG, location) {
120        DEFINES += ENABLE_GEOLOCATION=1
121     }
122 }
123
124 # orientation support if QtMobility exists
125 contains(MOBILITY_CONFIG, sensors) {
126    !contains(DEFINES, ENABLE_ORIENTATION_EVENTS=.): DEFINES += ENABLE_ORIENTATION_EVENTS=1
127    !contains(DEFINES, ENABLE_DEVICE_ORIENTATION=.): DEFINES += ENABLE_DEVICE_ORIENTATION=1
128    CONFIG *= mobility
129    MOBILITY *= sensors
130 }
131
132 # Bearer management is part of Qt 4.7
133 # for older version, check for mobility with bearer
134 !contains(DEFINES, ENABLE_QT_BEARER=.) {
135      !lessThan(QT_MINOR_VERSION, 7) {
136         DEFINES += ENABLE_QT_BEARER=1
137      } else {
138         contains(MOBILITY_CONFIG, bearer) {
139             DEFINES += ENABLE_QT_BEARER=1
140         }
141     }
142 }
143
144 !contains(DEFINES, ENABLE_TOUCH_EVENTS=.): DEFINES += ENABLE_TOUCH_EVENTS=1
145
146 # HTML5 Media Support
147 # We require QtMultimedia or Phonon
148 !contains(DEFINES, ENABLE_VIDEO=.) {
149     DEFINES -= ENABLE_VIDEO=1
150     DEFINES += ENABLE_VIDEO=0
151
152     contains(MOBILITY_CONFIG, multimedia) {
153         DEFINES -= ENABLE_VIDEO=0
154         DEFINES += ENABLE_VIDEO=1
155     } else:contains(QT_CONFIG, phonon) {
156         DEFINES -= ENABLE_VIDEO=0
157         DEFINES += ENABLE_VIDEO=1
158     }
159 }
160
161 # Used to compute defaults for the build-webkit script
162 CONFIG(compute_defaults) {
163     message($$DEFINES)
164     error("Done computing defaults")
165 }
166
167 contains(DEFINES, ENABLE_WCSS=1) {
168     contains(DEFINES, ENABLE_XHTMLMP=0) {
169         DEFINES -= ENABLE_XHTMLMP=0
170         DEFINES += ENABLE_XHTMLMP=1
171     }
172 }
173
174 ## Forward enabled feature macros to JavaScript enabled features macros
175 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
176 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
177 contains(DEFINES, ENABLE_CHANNEL_MESSAGING=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_CHANNEL_MESSAGING=1
178 contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_ORIENTATION_EVENTS=1
179 contains(DEFINES, ENABLE_DASHBOARD_SUPPORT=0): DASHBOARDSUPPORTCSSPROPERTIES -= $$PWD/css/DashboardSupportCSSPropertyNames.in
180 contains(DEFINES, ENABLE_DATAGRID=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATAGRID=1
181 contains(DEFINES, ENABLE_EVENTSOURCE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_EVENTSOURCE=1
182 contains(DEFINES, ENABLE_DATABASE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATABASE=1
183 contains(DEFINES, ENABLE_DATALIST=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATALIST=1
184 contains(DEFINES, ENABLE_DOM_STORAGE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_DOM_STORAGE=1
185 contains(DEFINES, ENABLE_SHARED_SCRIPT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_SCRIPT=1
186 contains(DEFINES, ENABLE_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WORKERS=1
187 contains(DEFINES, ENABLE_SHARED_WORKERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SHARED_WORKERS=1
188 contains(DEFINES, ENABLE_VIDEO=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO=1
189 contains(DEFINES, ENABLE_XPATH=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XPATH=1
190 contains(DEFINES, ENABLE_XSLT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
191 contains(DEFINES, ENABLE_XBL=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XBL=1
192 contains(DEFINES, ENABLE_FILTERS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_FILTERS=1
193 contains(DEFINES, ENABLE_WCSS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WCSS=1
194 contains(DEFINES, ENABLE_WML=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_WML=1
195 contains(DEFINES, ENABLE_XHTMLMP=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_XHTMLMP=1
196 contains(DEFINES, ENABLE_SVG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
197 contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_JAVASCRIPT_DEBUGGER=1
198 contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_OFFLINE_WEB_APPLICATIONS=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, ENABLE_TILED_BACKING_STORE=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TILED_BACKING_STORE=1
203 contains(DEFINES, ENABLE_NOTIFICATIONS=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
204 contains(DEFINES, ENABLE_METER_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_METER_TAG=1
205 contains(DEFINES, ENABLE_PROGRESS_TAG=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_PROGRESS_TAG=1
206 contains(DEFINES, ENABLE_GEOLOCATION=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_GEOLOCATION=1
207 contains(DEFINES, ENABLE_BLOB=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_BLOB=1