[GTK] Move feature overriding to the configure phase
[WebKit-https.git] / Source / autotools / SetupWebKitFeatures.m4
1 # This adds the include line to the bottom of the autoconfig header.
2 AH_BOTTOM([#include "WebKitFeatures.h"])
3
4 # This list of features represents those selected for release builds.
5 # If you are adding a new or unstable feature, you should mark it
6 # disabled here.
7 read -d '' DEFAULT_FEATURE_DEFINES <<"EOF"
8         ENABLE_ACCELERATED_2D_CANVAS=0
9         ENABLE_BATTERY_STATUS=0
10         ENABLE_BLOB=1
11         ENABLE_CANVAS_PATH=0
12         ENABLE_CANVAS_PROXY=0
13         ENABLE_CHANNEL_MESSAGING=1
14         ENABLE_CSP_NEXT=0
15         ENABLE_CSS3_TEXT=0
16         ENABLE_CSS_BOX_DECORATION_BREAK=1
17         ENABLE_CSS_COMPOSITING=0
18         ENABLE_CSS_DEVICE_ADAPTATION=0
19         ENABLE_CSS_EXCLUSIONS=1
20         ENABLE_CSS_IMAGE_ORIENTATION=0
21         ENABLE_CSS_IMAGE_RESOLUTION=0
22         ENABLE_CSS_IMAGE_SET=0
23         ENABLE_CSS_REGIONS=0
24         ENABLE_CSS_STICKY_POSITION=0
25         ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED=0
26         ENABLE_CSS_VARIABLES=0
27         ENABLE_CSS3_CONDITIONAL_RULES=0
28         ENABLE_CUSTOM_SCHEME_HANDLER=0
29         ENABLE_DASHBOARD_SUPPORT=0
30         ENABLE_DATALIST_ELEMENT=0
31         ENABLE_DATA_TRANSFER_ITEMS=0
32         ENABLE_DETAILS_ELEMENT=1
33         ENABLE_DEVICE_ORIENTATION=0
34         ENABLE_DIALOG_ELEMENT=0
35         ENABLE_DIRECTORY_UPLOAD=0
36         ENABLE_DOM4_EVENTS_CONSTRUCTOR=0
37         ENABLE_DOWNLOAD_ATTRIBUTE=0
38         ENABLE_FILE_SYSTEM=0
39         ENABLE_FILTERS=1
40         ENABLE_FTPDIR=0
41         ENABLE_FULLSCREEN_API=1
42         ENABLE_HIGH_DPI_CANVAS=0
43         ENABLE_ICONDATABASE=1
44         ENABLE_IFRAME_SEAMLESS=1
45         ENABLE_INDEXED_DATABASE=0
46         ENABLE_INPUT_SPEECH=0
47         ENABLE_INPUT_TYPE_COLOR=0
48         ENABLE_INPUT_TYPE_DATE=0
49         ENABLE_INPUT_TYPE_DATETIME=0
50         ENABLE_INPUT_TYPE_DATETIMELOCAL=0
51         ENABLE_INPUT_TYPE_MONTH=0
52         ENABLE_INPUT_TYPE_TIME=0
53         ENABLE_INPUT_TYPE_WEEK=0
54         ENABLE_INSPECTOR=1
55         ENABLE_JAVASCRIPT_DEBUGGER=1
56         ENABLE_LEGACY_CSS_VENDOR_PREFIXES=0
57         ENABLE_LEGACY_NOTIFICATIONS=0
58         ENABLE_LEGACY_VENDOR_PREFIXES=1
59         ENABLE_LEGACY_WEB_AUDIO=0
60         ENABLE_LINK_PREFETCH=0
61         ENABLE_LINK_PRERENDER=0
62         ENABLE_MATHML=1
63         ENABLE_MEDIA_CAPTURE=0
64         ENABLE_MEDIA_SOURCE=0
65         ENABLE_MEDIA_STATISTICS=0
66         ENABLE_METER_ELEMENT=1
67         ENABLE_MHTML=1
68         ENABLE_MICRODATA=0
69         ENABLE_MOUSE_CURSOR_SCALE=0
70         ENABLE_NAVIGATOR_CONTENT_UTILS=0
71         ENABLE_NETSCAPE_PLUGIN_API=1
72         ENABLE_NETWORK_INFO=0
73         ENABLE_NOTIFICATIONS=0
74         ENABLE_ORIENTATION_EVENTS=0
75         ENABLE_PAGE_VISIBILITY_API=0
76         ENABLE_PERFORMANCE_TIMELINE=0
77         ENABLE_PROGRESS_ELEMENT=1
78         ENABLE_PROXIMITY_EVENTS=0
79         ENABLE_QUOTA=0
80         ENABLE_RESOURCE_TIMING=0
81         ENABLE_REQUEST_ANIMATION_FRAME=1
82         ENABLE_SCRIPTED_SPEECH=0
83         ENABLE_SHADOW_DOM=1
84         ENABLE_SHARED_WORKERS=1
85         ENABLE_SMOOTH_SCROLLING=1
86         ENABLE_SQL_DATABASE=1
87         ENABLE_STYLE_SCOPED=0
88         ENABLE_SVG_DOM_OBJC_BINDINGS=0
89         ENABLE_TEMPLATE_ELEMENT=0
90         ENABLE_TEXT_AUTOSIZING=0
91         ENABLE_TOUCH_EVENTS=0
92         ENABLE_TOUCH_ICON_LOADING=0
93         ENABLE_USER_TIMING=0
94         ENABLE_VIBRATION=0
95         ENABLE_VIDEO_TRACK=0
96         ENABLE_WEB_AUDIO=0
97         ENABLE_WEB_SOCKETS=1
98         ENABLE_WEB_TIMING=1
99         ENABLE_WORKERS=1
100         ENABLE_XHR_TIMEOUT=1
101 EOF
102
103 if test "$enable_spellcheck" = "yes"; then
104     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_SPELLCHECK=1"
105 else
106     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_SPELLCHECK=0"
107 fi
108
109 if test "$enable_gamepad" = "yes"; then
110         DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_GAMEPAD=1"
111 else
112         DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_GAMEPAD=0"
113 fi
114
115 if test "$enable_video" = "yes"; then
116     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_VIDEO=1"
117 else
118     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_VIDEO=0"
119 fi
120
121 if test "$enable_media_stream" = "yes"; then
122     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_MEDIA_STREAM=1"
123 else
124     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_MEDIA_STREAM=0"
125 fi
126
127 if test "$enable_css_shaders" = "yes"; then
128     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_CSS_SHADERS=1"
129 else
130     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_CSS_SHADERS=0"
131 fi
132
133 if test "$enable_css_filters" = "yes"; then
134     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_CSS_FILTERS=1"
135 else
136     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_CSS_FILTERS=0"
137 fi
138
139 if test "$enable_geolocation" = "yes"; then
140     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_GEOLOCATION=1"
141 else
142     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_GEOLOCATION=0"
143 fi
144
145 if test "$enable_svg" = "yes"; then
146     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_SVG=1"
147 else
148     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_SVG=0"
149 fi
150
151 if test "$enable_svg_fonts" = "yes"; then
152     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_SVG_FONTS=1"
153 else
154     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_SVG_FONTS=0"
155 fi
156
157 if test "$enable_webgl" = "yes"; then
158     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_WEBGL=1"
159 else
160     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_WEBGL=0"
161 fi
162
163 if test "$enable_accelerated_compositing" = "yes"; then
164     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_3D_RENDERING=1"
165 else
166     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_3D_RENDERING=0"
167 fi
168
169 if test "$enable_web_audio" = "yes"; then
170     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_WEB_AUDIO=1"
171 else
172     DEFAULT_FEATURE_DEFINES="$DEFAULT_FEATURE_DEFINES ENABLE_WEB_AUDIO=0"
173 fi
174
175 # We need to run this command now rather than use AC_CONFIG_COMMANDS
176 # because automake rules depend on the output file (WebKitFeatures.txt).
177 $srcdir/Tools/gtk/generate-feature-defines-files $DEFAULT_FEATURE_DEFINES
178
179 dnl AM_WEBKIT_FEATURE_CONDITIONAL
180 dnl Checks whether the given feature is enabled in the
181 dnl build that is being configured and sets up equally-named
182 dnl Automake conditional reflecting the feature status.
183 dnl
184 dnl Usage:
185 dnl AM_WEBKIT_FEATURE_CONDITIONAL([FEATURE])
186 AC_DEFUN([AM_WEBKIT_FEATURE_CONDITIONAL], [
187   AC_PROG_AWK
188
189   grep -qE "($1=1)" WebKitFeatures.txt
190   if test $? -eq 0; then
191     feature_enabled="yes";
192   else
193     feature_enabled="no";
194   fi
195
196   AM_CONDITIONAL([$1], [test "$feature_enabled" = "yes"])
197
198 ]) dnl AM_WEBKIT_FEATURE_CONDITIONAL