1 AC_INIT([WebKit],[0.1],[http://bugs.webkit.org/])
5 AC_CONFIG_HEADERS([aconfig.h])
6 AC_CONFIG_SRCDIR([WebCore/config.h])
8 # see http://www.gnu.org/software/libtool/manual.html#Versioning
9 LIBWEBKITGTK_VERSION=1:0:0
10 AC_SUBST([LIBWEBKITGTK_VERSION])
12 AM_INIT_AUTOMAKE([foreign subdir-objects])
16 # host checking - inspired by the GTK+ configure.in
17 # TODO: os_mac, os_bsd
18 AC_MSG_CHECKING([for native Win32])
27 AC_MSG_RESULT([$os_win32])
38 # If CXXFLAGS and CFLAGS are unset, default to -O2
39 # This is to tell automake not to include '-g' if CXXFLAGS is not set
40 # For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
41 if test -z "$CXXFLAGS"; then
44 if test -z "$CFLAGS"; then
56 # check for -fvisibility=hidden compiler support (GCC >= 4)
57 saved_CFLAGS="$CFLAGS"
58 CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
59 AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
60 AC_COMPILE_IFELSE([char foo;],
61 [ AC_MSG_RESULT([yes])
62 SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden" ],
64 CFLAGS="$saved_CFLAGS"
65 AC_SUBST(SYMBOL_VISIBILITY)
66 AC_SUBST(SYMBOL_VISIBILITY_INLINES)
68 AC_PATH_PROG(PERL, perl)
69 if test -z "$PERL"; then
70 AC_MSG_ERROR([You need 'perl' to compile WebKit])
73 AC_PATH_PROG(BISON, bison)
74 if test -z "$BISON"; then
75 AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
78 AC_PATH_PROG(FLEX, flex)
79 if test -z "$FLEX"; then
80 AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
83 AC_PATH_PROG(GPERF, gperf)
84 if test -z "$GPERF"; then
85 AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
89 if test -z "$MV"; then
90 AC_MSG_ERROR([You need 'mv' to compile WebKit])
94 # Check for glib-genmarshal and glib-mkenums
95 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
96 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
98 # Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
101 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
104 # C/C++ Language Features
114 AC_CHECK_HEADERS([pthread.h],
115 AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exist]),
116 AC_MSG_ERROR([pthread support is required to build WebKit]))
119 AC_CHECK_HEADERS([jpeglib.h])
121 # check for pkg-config
122 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
123 if test "$PKG_CONFIG" = "no"; then
124 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
127 # check for icu-config
128 AC_PATH_PROG(icu_config, icu-config, no)
129 if test "$icu_config" = "no"; then
130 AC_MSG_ERROR([Cannot find icu-config. ICU library is needed.])
132 ICU_CFLAGS=`$icu_config --cflags`
133 ICU_LIBS=`$icu_config --ldflags`
134 AC_SUBST([ICU_CFLAGS])
137 # determine the GDK/GTK+ target
138 AC_MSG_CHECKING([the target for WebKit GTK+])
139 AC_ARG_WITH(webkit_target,
140 AC_HELP_STRING([--with-webkit-target=@<:@x11/win32/quartz/directfb@:>@],
141 [Select webkit target [default=x11]]),
142 [],[with_webkit_target="x11"])
144 case "$with_webkit_target" in
145 x11|win32|quartz|directfb) ;;
146 *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
149 AC_MSG_RESULT([$with_webkit_target])
152 # determine the http backend
153 AC_MSG_CHECKING([the HTTP backend to use])
154 AC_ARG_WITH(http_backend,
155 AC_HELP_STRING([--with-http-backend=@<:@curl@:>@],
156 [Select HTTP backend [default=curl]]),
157 [],[http_backend="curl"])
159 case "$http_backend" in
161 *) AC_MSG_ERROR([Invalid HTTP backend: must be curl.]) ;;
164 AC_MSG_RESULT([$http_backend])
167 # minimum base dependencies
168 GLIB_REQUIRED_VERSION=2.0
169 GOBJECT_REQUIRED_VERSION=2.0
170 GTHREAD_REQUIRED_VERSION=2.0
171 PANGO_REQUIRED_VERSION=1.0
172 CAIRO_REQUIRED_VERSION=1.2
173 FONTCONFIG_REQUIRED_VERSION=2.4
174 FREETYPE2_REQUIRED_VERSION=9.0
175 LIBXML_REQUIRED_VERSION=2.6
178 GTK_REQUIRED_VERSION=2.0
179 LIBCURL_REQUIRED_VERSION=7.15
180 LIBXSLT_REQUIRED_VERSION=1.1.7
181 SQLITE_REQUIRED_VERSION=3.0
182 GSTREAMER_REQUIRED_VERSION=0.10
183 GNOME_VFS_REQUIRED_VERSION=2.0
185 PKG_CHECK_MODULES([DEPENDENCIES],
186 [glib-2.0 >= $GLIB_REQUIRED_VERSION
187 gobject-2.0 >= $GOBJECT_REQUIRED_VERSION
188 gthread-2.0 >= $GTHREAD_REQUIRED_VERSION
189 gtk+-2.0 >= $GTK_REQUIRED_VERSION
190 pango >= $PANGO_REQUIRED_VERSION
191 cairo >= $CAIRO_REQUIRED_VERSION
193 fontconfig >= $FONTCONFIG_REQUIRED_VERSION
194 freetype2 >= $FREETYPE2_REQUIRED_VERSION
195 libxml-2.0 >= $LIBXML_REQUIRED_VERSION])
196 AC_SUBST([DEPENDENCIES_CFLAGS])
197 AC_SUBST([DEPENDENCIES_LIBS])
199 # check whether to build with debugging enabled
200 AC_MSG_CHECKING([whether to do a debug build])
202 AC_HELP_STRING([--enable-debug],
203 [turn on debugging [default=no]]),
204 [],[enable_debug="no"])
205 AC_MSG_RESULT([$enable_debug])
207 # check whether to build with database support
208 AC_MSG_CHECKING([whether to enable HTML5 client-side storage support])
209 AC_ARG_ENABLE(database,
210 AC_HELP_STRING([--enable-database],
211 [enable HTML5 client-side storage support [default=yes]]),
212 [],[enable_database="yes"])
213 AC_MSG_RESULT([$enable_database])
215 # check whether to build with icon database support
216 AC_MSG_CHECKING([whether to enable icon database support])
217 AC_ARG_ENABLE(icon_database,
218 AC_HELP_STRING([--enable-icon-database],
219 [enable icon database [default=no]]),
220 [],[enable_icon_database="no"])
221 AC_MSG_RESULT([$enable_icon_database])
223 # check whether to enable HTML5 audio/video support
224 AC_MSG_CHECKING([whether to enable HTML5 video support])
226 AC_HELP_STRING([--enable-video],
227 [enable HTML5 video support [default=no]]),
228 [],[enable_video="no"])
229 AC_MSG_RESULT([$enable_video])
231 # check whether to enable XPath support
232 AC_MSG_CHECKING([whether to enable XPath support])
234 AC_HELP_STRING([--enable-xpath],
235 [enable support for XPath [default=yes]]),
236 [],[enable_xpath="yes"])
237 AC_MSG_RESULT([$enable_xpath])
239 # check whether to enable XSLT support
240 AC_MSG_CHECKING([whether to enable XSLT support])
242 AC_HELP_STRING([--enable-xslt],
243 [enable support for XSLT [default=yes]]),
244 [],[enable_xslt="yes"])
245 AC_MSG_RESULT([$enable_xslt])
247 # check whether to enable SVG experimental features
248 # Enable all SVG if it is
249 AC_MSG_CHECKING([whether to enable SVG experimental features])
250 AC_ARG_ENABLE(svg_experimental,
251 AC_HELP_STRING([--enable-svg-experimental],
252 [enable support for SVG experimental features [default=no]]),
253 [],[enable_svg_experimental="no"])
254 AC_MSG_RESULT([$enable_svg_experimental])
256 if test "$enable_svg_experimental" = "yes"; then
258 enable_svg_animation=yes
259 enable_svg_filters=yes
261 enable_svg_foreign_object=yes
262 enable_svg_as_image=yes
263 enable_svg_use_element=yes
266 # check whether to enable SVG support
267 AC_MSG_CHECKING([whether to enable SVG support])
269 AC_HELP_STRING([--enable-svg],
270 [enable support for SVG [default=no]]),
271 [],[enable_svg="no"])
272 AC_MSG_RESULT([$enable_svg])
274 # check whether to enable support for SVG animation
275 AC_MSG_CHECKING([whether to enable support for SVG animataion])
276 AC_ARG_ENABLE(svg_animation,
277 AC_HELP_STRING([--enable-svg-animation],
278 [enable support for SVG animation (experimental) [default=no]]),
279 [],[enable_svg_animation="no"])
280 AC_MSG_RESULT([$enable_svg_animation])
282 # check whether to enable support for SVG filters
283 AC_MSG_CHECKING([whether to enable support for SVG filters])
284 AC_ARG_ENABLE(svg_filters,
285 AC_HELP_STRING([--enable-svg-filters],
286 [enable support for SVG filters (experimental) [default=no]]),
287 [],[enable_svg_filters="no"])
288 AC_MSG_RESULT([$enable_svg_filters])
290 # check whether to enable support for SVG fonts
291 AC_MSG_CHECKING([whether to enable support for SVG fonts])
292 AC_ARG_ENABLE(svg_fonts,
293 AC_HELP_STRING([--enable-svg-fonts],
294 [enable support for SVG fonts (experimental) [default=no]]),
295 [],[enable_svg_fonts="no"])
296 AC_MSG_RESULT([$enable_svg_fonts])
298 # check whether to enable foreign objects support for SVG
299 AC_MSG_CHECKING([whether to enable support for SVG foreign objects])
300 AC_ARG_ENABLE(svg_foreign_object,
301 AC_HELP_STRING([--enable-svg-foreign-object],
302 [enable support for SVG foreign objects (experimental) [default=no]]),
303 [],[enable_svg_foreign_object="no"])
304 AC_MSG_RESULT([$enable_svg_foreign_object])
306 # check whether to enable SVG As Image support
307 AC_MSG_CHECKING([whether to enable SVG as Image support])
308 AC_ARG_ENABLE(svg_as_image,
309 AC_HELP_STRING([--enable-svg-as-image],
310 [enable SVG as Image support (experimental) [default=no]]),
311 [],[enable_svg_as_image="no"])
312 AC_MSG_RESULT([$enable_svg_as_image])
314 # check whether to enable SVG USE element support
315 AC_MSG_CHECKING([whether to enable support for SVG use element])
316 AC_ARG_ENABLE(svg_use_element,
317 AC_HELP_STRING([--enable-svg-use-element],
318 [enable SVG use element support (experimental) [default=no]]),
319 [],[enable_svg_use_element="no"])
320 AC_MSG_RESULT([$enable_svg_use_element])
322 # check whether to enable code coverage
323 AC_MSG_CHECKING([whether to enable code coverage support])
324 AC_ARG_ENABLE(coverage,
325 AC_HELP_STRING([--enable-coverage],
326 [enable code coverage support [default=no]]),
327 [],[enable_coverage="no"])
328 AC_MSG_RESULT([$enable_coverage])
330 # check whether to enable FastMalloc
331 AC_MSG_CHECKING([whether to enable optimized memory allocator])
332 AC_ARG_ENABLE(fast_malloc,
333 AC_HELP_STRING([--enable-fast-malloc],
334 [enable optimized memory allocator default=yes, default=no for debug builds]),
335 [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
336 AC_MSG_RESULT([$enable_fast_malloc])
338 # Add '-g' flag to gcc if it's debug build
339 if test "$enable_debug" = "yes"; then
340 CXXFLAGS="$CXXFLAGS -g"
344 # check if curl is available
345 if test "$http_backend" = "curl"; then
346 PKG_CHECK_MODULES([LIBCURL],
347 [libcurl >= $LIBCURL_REQUIRED_VERSION])
348 AC_SUBST([LIBCURL_CFLAGS])
349 AC_SUBST([LIBCURL_LIBS])
352 # check if sqlite 3 is available
353 if test "$enable_icon_database" = "yes" || test "$enable_database" = "yes"; then
354 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
355 AC_SUBST([SQLITE3_CFLAGS])
356 AC_SUBST([SQLITE3_LIBS])
359 # check if libxslt is available
360 if test "$enable_xslt" = "yes"; then
361 PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
362 AC_SUBST([LIBXSLT_CFLAGS])
363 AC_SUBST([LIBXSLT_LIBS])
366 # check if gstreamer is available
367 if test "$enable_video" = "yes"; then
368 PKG_CHECK_MODULES([GSTREAMER],
369 [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
371 gstreamer-plugins-base-0.10,
372 gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION])
373 AC_SUBST([GSTREAMER_CFLAGS])
374 AC_SUBST([GSTREAMER_LIBS])
377 # check for code coverage support
378 if test "$enable_coverage" = "yes"; then
379 COVERAGE_CFLAGS="-MD"
380 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
381 AC_SUBST([COVERAGE_CFLAGS])
382 AC_SUBST([COVERAGE_LDFLAGS])
385 # check for SVG features, enabling SVG if necessary
386 if test "$enable_svg_animation" = "yes" || \
387 test "$enable_svg_filters" = "yes" || \
388 test "$enable_svg_fonts" = "yes" || \
389 test "$enable_svg_foreign_object" = "yes" || \
390 test "$enable_svg_as_image" = "yes" || \
391 test "$enable_svg_use_element" = "yes"; then
393 if test "$enable_svg" = "no"; then
394 AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
400 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
401 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
402 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
403 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
405 # target conditionals
406 AM_CONDITIONAL([TARGET_X11], [test "$with_webkit_target" = "x11"])
407 AM_CONDITIONAL([TARGET_WIN32], [test "$with_webkit_target" = "win32"])
408 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_webkit_target" = "quartz"])
409 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_webkit_target" = "directfb"])
411 # HTTP backend conditionals
412 AM_CONDITIONAL([USE_CURL], [test "$http_backend" = "curl"])
414 # WebKit feature conditionals
415 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
416 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
417 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
418 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
419 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
420 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
421 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
422 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
423 AM_CONDITIONAL([ENABLE_SVG_FILTERS],[test "$enable_svg_filters" = "yes"])
424 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
425 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
426 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
427 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use_element" = "yes"])
428 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
429 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
430 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
434 WebKit/gtk/WebKitGtk.pc:WebKit/gtk/WebKitGtk.pc.in
441 WebKit was configured with the following options:
443 Target : $with_webkit_target
444 HTTP backend : $http_backend
445 Enable debug : $enable_debug
446 Code coverage support : $enable_coverage
447 Optimized memory allocator : $enable_fast_malloc
448 HTML5 client-side storage support : $enable_database
449 HTML5 video element support : $enable_video
450 Icon database support : $enable_icon_database
451 SVG support : $enable_svg
452 SVG animation support : $enable_svg_animation
453 SVG filters support : $enable_svg_filters
454 SVG fonts support : $enable_svg_fonts
455 SVG foreign object support : $enable_svg_foreign_object
456 SVG as image support : $enable_svg_as_image
457 SVG use element support : $enable_svg_use_element
458 XPATH support : $enable_xpath
459 XSLT support : $enable_xslt