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])
41 # If CXXFLAGS and CFLAGS are unset, default to -O2
42 # This is to tell automake not to include '-g' if CXXFLAGS is not set
43 # For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
44 if test -z "$CXXFLAGS"; then
47 if test -z "$CFLAGS"; then
59 # check for -fvisibility=hidden compiler support (GCC >= 4)
60 saved_CFLAGS="$CFLAGS"
61 CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
62 AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
63 AC_COMPILE_IFELSE([char foo;],
64 [ AC_MSG_RESULT([yes])
65 SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden" ],
67 CFLAGS="$saved_CFLAGS"
68 AC_SUBST(SYMBOL_VISIBILITY)
69 AC_SUBST(SYMBOL_VISIBILITY_INLINES)
71 AC_PATH_PROG(PERL, perl)
72 if test -z "$PERL"; then
73 AC_MSG_ERROR([You need 'perl' to compile WebKit])
76 AC_PATH_PROG(BISON, bison)
77 if test -z "$BISON"; then
78 AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
81 AC_PATH_PROG(FLEX, flex)
82 if test -z "$FLEX"; then
83 AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
86 AC_PATH_PROG(GPERF, gperf)
87 if test -z "$GPERF"; then
88 AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
92 if test -z "$MV"; then
93 AC_MSG_ERROR([You need 'mv' to compile WebKit])
97 # Check for glib-genmarshal and glib-mkenums
98 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
99 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
100 if test -z "$GLIB_GENMARSHAL" || test -z "$GLIB_MKENUMS"; then
101 AC_MSG_ERROR([You need the GLib dev tools in your path])
104 # Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
107 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
110 # C/C++ Language Features
119 # pthread (not needed on Windows)
120 if test "$os_win32" = "no"; then
121 AC_CHECK_HEADERS([pthread.h],
122 AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exists]),
123 AC_MSG_ERROR([pthread support is required to build WebKit]))
127 AC_CHECK_HEADERS([jpeglib.h])
129 # check for pkg-config
130 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
131 if test "$PKG_CONFIG" = "no"; then
132 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
135 # determine the Unicode backend
136 AC_MSG_CHECKING([the Unicode backend to use])
137 AC_ARG_WITH(unicode_backend,
138 AC_HELP_STRING([--with-unicode-backend=@<:@icu@:>@],
139 [Select Unicode backend [default=icu]]),
140 [],[unicode_backend="icu"])
142 case "$unicode_backend" in
144 *) AC_MSG_ERROR([Invalid Unicode backend: must be icu.]) ;;
147 AC_MSG_RESULT([$unicode_backend])
149 if test "$unicode_backend" = "icu"; then
150 # check for icu-config
151 if test "$os_darwin" = "yes"; then
152 UNICODE_CFLAGS="-I\$(srcdir)/JavaScriptCore/icu -I\$(srcdir)/WebCore/icu"
153 UNICODE_LIBS="-licucore"
155 AC_PATH_PROG(icu_config, icu-config, no)
156 if test "$icu_config" = "no"; then
157 AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
160 # We don't use --cflags as this gives us a lot of things that we don't
161 # necessarily want, like debugging and optimization flags
162 # See man (1) icu-config for more info.
163 UNICODE_CFLAGS=`$icu_config --cppflags`
164 UNICODE_LIBS=`$icu_config --ldflags`
168 AC_SUBST([UNICODE_CFLAGS])
169 AC_SUBST([UNICODE_LIBS])
171 # determine the GDK/GTK+ target
172 AC_MSG_CHECKING([the target windowing system])
174 AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@],
175 [Select webkit target [default=x11]]),
176 [],[with_target="x11"])
178 case "$with_target" in
179 x11|win32|quartz|directfb) ;;
180 *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
183 AC_MSG_RESULT([$with_target])
185 AC_MSG_CHECKING([for Hildon UI extensions])
187 AC_HELP_STRING([--with-hildon],
188 [Use Hildon UI extensions [default=no]]),
189 [],[with_hildon="no"])
190 AC_MSG_RESULT([$with_hildon])
192 if test "$with_hildon" = "yes"; then
193 HILDON_CPPFLAGS="-DMAEMO_CHANGES"
194 PKG_CHECK_MODULES([HILDON], [hildon-1])
195 AC_SUBST([HILDON_CPPFLAGS])
196 AC_SUBST([HILDON_CFLAGS])
197 AC_SUBST([HILDON_LIBS])
200 # determine the http backend
201 AC_MSG_CHECKING([the HTTP backend to use])
202 AC_ARG_WITH(http_backend,
203 AC_HELP_STRING([--with-http-backend=@<:@curl/soup@:>@],
204 [Select HTTP backend [default=curl]]),
205 [],[with_http_backend="curl"])
207 case "$with_http_backend" in
209 *) AC_MSG_ERROR([Invalid HTTP backend: must be curl, soup.]) ;;
212 AC_MSG_RESULT([$with_http_backend])
214 # minimum base dependencies
215 CAIRO_REQUIRED_VERSION=1.4
216 FONTCONFIG_REQUIRED_VERSION=2.4
217 FREETYPE2_REQUIRED_VERSION=9.0
218 LIBXML_REQUIRED_VERSION=2.6
220 # minimum GTK+ base dependencies
221 GLIB_REQUIRED_VERSION=2.0
222 GOBJECT_REQUIRED_VERSION=2.0
223 GTHREAD_REQUIRED_VERSION=2.0
224 PANGO_REQUIRED_VERSION=1.0
225 GTK_REQUIRED_VERSION=2.8
228 LIBCURL_REQUIRED_VERSION=7.15
229 LIBSOUP_REQUIRED_VERSION=2.23
230 LIBXSLT_REQUIRED_VERSION=1.1.7
231 SQLITE_REQUIRED_VERSION=3.0
232 GSTREAMER_REQUIRED_VERSION=0.10
233 GNOME_VFS_REQUIRED_VERSION=2.0
235 PKG_CHECK_MODULES([GLOBALDEPS],
236 [glib-2.0 >= $GLIB_REQUIRED_VERSION
237 gobject-2.0 >= $GOBJECT_REQUIRED_VERSION
238 gthread-2.0 >= $GTHREAD_REQUIRED_VERSION])
239 AC_SUBST([GLOBALDEPS_CFLAGS])
240 AC_SUBST([GLOBALDEPS_LIBS])
242 PKG_CHECK_MODULES([WEBKITDEPS],
243 [gtk+-2.0 >= $GTK_REQUIRED_VERSION
244 pango >= $PANGO_REQUIRED_VERSION
245 cairo >= $CAIRO_REQUIRED_VERSION
247 fontconfig >= $FONTCONFIG_REQUIRED_VERSION
248 freetype2 >= $FREETYPE2_REQUIRED_VERSION
249 libxml-2.0 >= $LIBXML_REQUIRED_VERSION])
250 AC_SUBST([WEBKITDEPS_CFLAGS])
251 AC_SUBST([WEBKITDEPS_LIBS])
253 # check whether to build with debugging enabled
254 AC_MSG_CHECKING([whether to do a debug build])
256 AC_HELP_STRING([--enable-debug],
257 [turn on debugging [default=no]]),
258 [],[enable_debug="no"])
259 AC_MSG_RESULT([$enable_debug])
261 # check whether to build with cross-document messaging support
262 AC_MSG_CHECKING([whether to enable HTML5 cross-document messaging support])
263 AC_ARG_ENABLE(cross_document_messaging,
264 AC_HELP_STRING([--enable-cross-document-messaging],
265 [enable HTML5 cross-document messaging support [default=yes]]),
266 [],[enable_cross_document_messaging="yes"])
267 AC_MSG_RESULT([$enable_cross_document_messaging])
269 # check whether to enable HTML5 client-side session and persitent storage support
270 AC_MSG_CHECKING([whether to enable HTML5 client-side session and persistent storage support])
271 AC_ARG_ENABLE(dom_storage,
272 AC_HELP_STRING([--enable-dom-storage],
273 [enable HTML5 client-side session and persistent storage support [default=no]]),
274 [],[enable_dom_storage="no"])
275 AC_MSG_RESULT([$enable_dom_storage])
277 # check whether to build with database support
278 AC_MSG_CHECKING([whether to enable HTML5 client-side database storage support])
279 AC_ARG_ENABLE(database,
280 AC_HELP_STRING([--enable-database],
281 [enable HTML5 client-side database storage support [default=yes]]),
282 [],[enable_database="yes"])
283 AC_MSG_RESULT([$enable_database])
285 # check whether to build with icon database support
286 AC_MSG_CHECKING([whether to enable icon database support])
287 AC_ARG_ENABLE(icon_database,
288 AC_HELP_STRING([--enable-icon-database],
289 [enable icon database [default=no]]),
290 [],[enable_icon_database="no"])
291 AC_MSG_RESULT([$enable_icon_database])
293 # check whether to enable HTML5 audio/video support
294 AC_MSG_CHECKING([whether to enable HTML5 video support])
296 AC_HELP_STRING([--enable-video],
297 [enable HTML5 video support [default=no]]),
298 [],[enable_video="no"])
299 AC_MSG_RESULT([$enable_video])
301 # check whether to enable XPath support
302 AC_MSG_CHECKING([whether to enable XPath support])
304 AC_HELP_STRING([--enable-xpath],
305 [enable support for XPath [default=yes]]),
306 [],[enable_xpath="yes"])
307 AC_MSG_RESULT([$enable_xpath])
309 # check whether to enable XSLT support
310 AC_MSG_CHECKING([whether to enable XSLT support])
312 AC_HELP_STRING([--enable-xslt],
313 [enable support for XSLT [default=yes]]),
314 [],[enable_xslt="yes"])
315 AC_MSG_RESULT([$enable_xslt])
317 # check whether to enable SVG experimental features
318 # Enable all SVG if it is
319 AC_MSG_CHECKING([whether to enable SVG experimental features])
320 AC_ARG_ENABLE(svg_experimental,
321 AC_HELP_STRING([--enable-svg-experimental],
322 [enable support for SVG experimental features [default=no]]),
323 [],[enable_svg_experimental="no"])
324 AC_MSG_RESULT([$enable_svg_experimental])
326 if test "$enable_svg_experimental" = "yes"; then
328 enable_svg_animation=yes
329 # enable_svg_filters=yes
331 enable_svg_foreign_object=yes
332 enable_svg_as_image=yes
333 enable_svg_use_element=yes
336 # check whether to enable SVG support
337 AC_MSG_CHECKING([whether to enable SVG support])
339 AC_HELP_STRING([--enable-svg],
340 [enable support for SVG [default=no]]),
341 [],[enable_svg="no"])
342 AC_MSG_RESULT([$enable_svg])
344 # check whether to enable support for SVG animation
345 AC_MSG_CHECKING([whether to enable support for SVG animation])
346 AC_ARG_ENABLE(svg_animation,
347 AC_HELP_STRING([--enable-svg-animation],
348 [enable support for SVG animation (experimental) [default=no]]),
349 [],[enable_svg_animation="no"])
350 AC_MSG_RESULT([$enable_svg_animation])
352 # check whether to enable support for SVG filters
353 AC_MSG_CHECKING([whether to enable support for SVG filters])
354 AC_ARG_ENABLE(svg_filters,
355 AC_HELP_STRING([--enable-svg-filters],
356 [enable support for SVG filters (experimental) [default=no]]),
357 [],[enable_svg_filters="no"])
358 AC_MSG_RESULT([$enable_svg_filters])
360 # check whether to enable support for SVG fonts
361 AC_MSG_CHECKING([whether to enable support for SVG fonts])
362 AC_ARG_ENABLE(svg_fonts,
363 AC_HELP_STRING([--enable-svg-fonts],
364 [enable support for SVG fonts (experimental) [default=no]]),
365 [],[enable_svg_fonts="no"])
366 AC_MSG_RESULT([$enable_svg_fonts])
368 # check whether to enable foreign objects support for SVG
369 AC_MSG_CHECKING([whether to enable support for SVG foreign objects])
370 AC_ARG_ENABLE(svg_foreign_object,
371 AC_HELP_STRING([--enable-svg-foreign-object],
372 [enable support for SVG foreign objects (experimental) [default=no]]),
373 [],[enable_svg_foreign_object="no"])
374 AC_MSG_RESULT([$enable_svg_foreign_object])
376 # check whether to enable SVG As Image support
377 AC_MSG_CHECKING([whether to enable SVG as Image support])
378 AC_ARG_ENABLE(svg_as_image,
379 AC_HELP_STRING([--enable-svg-as-image],
380 [enable SVG as Image support (experimental) [default=no]]),
381 [],[enable_svg_as_image="no"])
382 AC_MSG_RESULT([$enable_svg_as_image])
384 # check whether to enable SVG USE element support
385 AC_MSG_CHECKING([whether to enable support for SVG use element])
386 AC_ARG_ENABLE(svg_use_element,
387 AC_HELP_STRING([--enable-svg-use-element],
388 [enable SVG use element support (experimental) [default=no]]),
389 [],[enable_svg_use_element="no"])
390 AC_MSG_RESULT([$enable_svg_use_element])
392 # check whether to enable code coverage
393 AC_MSG_CHECKING([whether to enable code coverage support])
394 AC_ARG_ENABLE(coverage,
395 AC_HELP_STRING([--enable-coverage],
396 [enable code coverage support [default=no]]),
397 [],[enable_coverage="no"])
398 AC_MSG_RESULT([$enable_coverage])
400 # check whether to enable FastMalloc
401 AC_MSG_CHECKING([whether to enable optimized memory allocator])
402 AC_ARG_ENABLE(fast_malloc,
403 AC_HELP_STRING([--enable-fast-malloc],
404 [enable optimized memory allocator default=yes, default=no for debug builds]),
405 [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
406 AC_MSG_RESULT([$enable_fast_malloc])
408 # determine the font backend
409 AC_MSG_CHECKING([the font backend to use])
410 AC_ARG_WITH(font_backend,
411 AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
412 [Select font backend [default=freetype]]),
413 [],[with_font_backend="freetype"])
415 case "$with_font_backend" in
417 *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
419 AC_MSG_RESULT([$with_font_backend])
421 # Add '-g' flag to gcc if it's debug build
422 if test "$enable_debug" = "yes"; then
423 CXXFLAGS="$CXXFLAGS -g"
427 # check if curl is available
428 if test "$with_http_backend" = "curl"; then
429 PKG_CHECK_MODULES([LIBCURL],
430 [libcurl >= $LIBCURL_REQUIRED_VERSION])
431 AC_SUBST([LIBCURL_CFLAGS])
432 AC_SUBST([LIBCURL_LIBS])
435 if test "$with_http_backend" = "soup"; then
436 PKG_CHECK_MODULES([LIBSOUP],
437 [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
438 AC_SUBST([LIBSOUP_CFLAGS])
439 AC_SUBST([LIBSOUP_LIBS])
442 # check if sqlite 3 is available
443 if test "$enable_icon_database" = "yes" || test "$enable_database" = "yes"; then
444 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
445 AC_SUBST([SQLITE3_CFLAGS])
446 AC_SUBST([SQLITE3_LIBS])
449 # check if libxslt is available
450 if test "$enable_xslt" = "yes"; then
451 PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
452 AC_SUBST([LIBXSLT_CFLAGS])
453 AC_SUBST([LIBXSLT_LIBS])
456 # check if gstreamer is available
457 if test "$enable_video" = "yes"; then
458 PKG_CHECK_MODULES([GSTREAMER],
459 [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
461 gstreamer-plugins-base-0.10,
462 gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION])
463 AC_SUBST([GSTREAMER_CFLAGS])
464 AC_SUBST([GSTREAMER_LIBS])
467 # check for code coverage support
468 if test "$enable_coverage" = "yes"; then
469 COVERAGE_CFLAGS="-MD"
470 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
471 AC_SUBST([COVERAGE_CFLAGS])
472 AC_SUBST([COVERAGE_LDFLAGS])
475 # check for SVG features, enabling SVG if necessary
476 if test "$enable_svg_animation" = "yes" || \
477 test "$enable_svg_filters" = "yes" || \
478 test "$enable_svg_fonts" = "yes" || \
479 test "$enable_svg_foreign_object" = "yes" || \
480 test "$enable_svg_as_image" = "yes" || \
481 test "$enable_svg_use_element" = "yes"; then
483 if test "$enable_svg" = "no"; then
484 AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
490 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
491 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
492 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
493 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
495 # target conditionals
496 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
497 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
498 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
499 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
501 # HTTP backend conditionals
502 AM_CONDITIONAL([USE_CURL], [test "$with_http_backend" = "curl"])
503 AM_CONDITIONAL([USE_SOUP], [test "$with_http_backend" = "soup"])
505 # Font backend conditionals
506 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
507 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
509 # WebKit feature conditionals
510 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
511 AM_CONDITIONAL([ENABLE_CROSS_DOCUMENT_MESSAGING],[test "$enable_cross_document_messaging" = "yes"])
512 AM_CONDITIONAL([ENABLE_DOM_STORAGE],[test "$enable_dom_storage" = "yes"])
513 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
514 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
515 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
516 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
517 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
518 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
519 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
520 AM_CONDITIONAL([ENABLE_SVG_FILTERS],[test "$enable_svg_filters" = "yes"])
521 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
522 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
523 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
524 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use_element" = "yes"])
525 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
526 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
527 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
531 WebKit/gtk/webkit-1.0.pc:WebKit/gtk/webkit.pc.in
538 WebKit was configured with the following options:
541 Enable debugging (slow) : $enable_debug
542 Code coverage support : $enable_coverage
543 Unicode backend : $unicode_backend
544 HTTP backend : $with_http_backend
545 Font backend : $with_font_backend
546 Optimized memory allocator : $enable_fast_malloc
548 HTML5 cross-document messaging : $enable_cross_document_messaging
549 HTML5 client-side session and persistent storage support : $enable_dom_storage
550 HTML5 client-side database storage support : $enable_database
551 HTML5 video element support : $enable_video
552 Icon database support : $enable_icon_database
553 SVG support : $enable_svg
554 SVG animation support : $enable_svg_animation
555 SVG filters support : $enable_svg_filters
556 SVG fonts support : $enable_svg_fonts
557 SVG foreign object support : $enable_svg_foreign_object
558 SVG as image support : $enable_svg_as_image
559 SVG use element support : $enable_svg_use_element
560 XPATH support : $enable_xpath
561 XSLT support : $enable_xslt
563 GDK target : $with_target
564 Hildon UI extensions : $with_hildon