[GTK] Use XDamage to simplify RedirectedXCompositeWindow
[WebKit-https.git] / configure.ac
1 AC_PREREQ(2.60)
2
3 m4_define([webkit_major_version], [1])
4 m4_define([webkit_minor_version], [11])
5 m4_define([webkit_micro_version], [0])
6
7 # This is the version we'll be using as part of our User-Agent string
8 # e.g., AppleWebKit/$(webkit_user_agent_version) ...
9 #
10 # Sourced from Source/WebCore/Configurations/Version.xcconfig
11 m4_define([webkit_user_agent_major_version], [537])
12 m4_define([webkit_user_agent_minor_version], [4])
13
14 AC_INIT([WebKitGTK],[webkit_major_version.webkit_minor_version.webkit_micro_version],[http://bugs.webkit.org/])
15
16 AC_CONFIG_MACRO_DIR([Source/autotools])
17 AC_CONFIG_AUX_DIR([Source/autotools])
18 AC_SUBST(ACLOCAL_AMFLAGS, "-I Source/autotools")
19
20 AC_CONFIG_HEADERS([autotoolsconfig.h])
21 AC_CANONICAL_HOST
22
23 WEBKIT_MAJOR_VERSION=webkit_major_version
24 WEBKIT_MINOR_VERSION=webkit_minor_version
25 WEBKIT_MICRO_VERSION=webkit_micro_version
26 WEBKIT_USER_AGENT_MAJOR_VERSION=webkit_user_agent_major_version
27 WEBKIT_USER_AGENT_MINOR_VERSION=webkit_user_agent_minor_version
28 AC_SUBST(WEBKIT_MAJOR_VERSION)
29 AC_SUBST(WEBKIT_MINOR_VERSION)
30 AC_SUBST(WEBKIT_MICRO_VERSION)
31 AC_SUBST(WEBKIT_USER_AGENT_MAJOR_VERSION)
32 AC_SUBST(WEBKIT_USER_AGENT_MINOR_VERSION)
33
34 AC_CONFIG_SRCDIR([Source/WebCore/config.h])
35
36 dnl # Libtool library version, not to confuse with API version
37 dnl # see http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
38 LIBWEBKITGTK_VERSION=16:0:16
39 AC_SUBST([LIBWEBKITGTK_VERSION])
40
41 LIBJAVASCRIPTCOREGTK_VERSION=13:5:13
42 AC_SUBST([LIBJAVASCRIPTCOREGTK_VERSION])
43
44 LIBWEBKIT2GTK_VERSION=17:0:17
45 AC_SUBST([LIBWEBKIT2GTK_VERSION])
46
47 AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip tar-ustar])
48
49 # Use AM_SILENT_RULES if present
50 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
51
52 # host checking - inspired by the GTK+ configure.in
53 # TODO: move these to webkit.m4?
54 AC_MSG_CHECKING([for native Win32])
55 case "$host" in
56      *-*-mingw*)
57        os_win32=yes
58        ;;
59      *)
60        os_win32=no
61        ;;
62 esac
63 AC_MSG_RESULT([$os_win32])
64
65 case "$host" in
66      *-*-linux*)
67        os_linux=yes
68        ;;
69      *-*-freebsd*)
70        os_freebsd=yes
71        ;;
72      *-*-darwin*)
73        os_darwin=yes
74        ;;
75 esac
76
77 case "$host_os" in
78      gnu* | linux* | k*bsd*-gnu)
79        os_gnu=yes
80        ;;
81      *)
82        os_gnu=no
83        ;;
84 esac
85
86 # If CFLAGS and CXXFLAGS are unset, default to empty.
87 # This is to tell automake not to include '-g' if C{XX,}FLAGS is not set
88 # For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
89 if test -z "$CXXFLAGS"; then
90    CXXFLAGS=""
91 fi
92 if test -z "$CFLAGS"; then
93    CFLAGS=""
94 fi
95
96 PKG_PROG_PKG_CONFIG
97
98 AC_PATH_PROG(PERL, perl)
99 if test -z "$PERL"; then
100    AC_MSG_ERROR([You need 'perl' to compile WebKit])
101 fi
102
103 AC_PATH_PROG(PYTHON, python)
104 if test -z "$PYTHON"; then
105    AC_MSG_ERROR([You need 'python' to compile WebKit])
106 fi
107
108 AC_PATH_PROG(RUBY, ruby)
109 if test -z "$RUBY"; then
110    AC_MSG_ERROR([You need 'ruby' to compile WebKit])
111 fi
112
113 AC_PATH_PROG(BISON, bison)
114 if test -z "$BISON"; then
115    AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
116 fi
117
118 AC_PATH_PROG(MV, mv)
119 if test -z "$MV"; then
120    AC_MSG_ERROR([You need 'mv' to compile WebKit])
121 fi
122
123 AC_PROG_CC
124 AC_PROG_CXX
125 AM_PROG_CC_C_O
126 AC_PROG_INSTALL
127 AC_SYS_LARGEFILE
128
129 # Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
130 # doesn't exist)
131 AC_LANG_PUSH([C++])
132 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
133 AC_LANG_POP([C++])
134
135 # C/C++ Language Features
136 AC_C_CONST
137 AC_C_INLINE
138 AC_C_VOLATILE
139
140 # C/C++ Headers
141 AC_HEADER_STDC
142 AC_HEADER_STDBOOL
143
144 # Linker
145 AC_DISABLE_STATIC
146 AC_LIBTOOL_WIN32_DLL
147 AC_PROG_LIBTOOL
148 # use dolt to speedup the build
149 DOLT
150
151 AC_PATH_PROG(FLEX, flex)
152 if test -z "$FLEX"; then
153    AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
154 else
155    FLEX_VERSION=`$FLEX --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
156    AX_COMPARE_VERSION([2.5.33],[gt],[$FLEX_VERSION],
157       AC_MSG_WARN([You need at least version 2.5.33 of the 'flex' lexer generator to compile WebKit correctly]))
158 fi
159
160 AC_PATH_PROG(GPERF, gperf)
161 if test -z "$GPERF"; then
162    AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
163 fi
164
165 # check for -fvisibility=hidden compiler support (GCC >= 4)
166 saved_CFLAGS="$CFLAGS"
167 CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
168 AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
169 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
170       [ AC_MSG_RESULT([yes])
171         SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden" ],
172         AC_MSG_RESULT([no]))
173 CFLAGS="$saved_CFLAGS"
174 AC_SUBST(SYMBOL_VISIBILITY)
175 AC_SUBST(SYMBOL_VISIBILITY_INLINES)
176
177 # Disable C++0x compat warnings for GCC >= 4.6.0 until we build
178 # cleanly with that.
179 AC_LANG_PUSH(C++)
180 TMPCXXFLAGS=$CXXFLAGS
181 CXXFLAGS="-Wall -Werror"
182 AC_MSG_CHECKING([if we have to disable C++0x compat warnings for GCC >= 4.6.0])
183 AC_TRY_COMPILE([
184 namespace std {
185     class nullptr_t { };
186 }
187 extern std::nullptr_t nullptr;
188 ], [return 0;],
189 disable_cxx0x_compat=no,
190 disable_cxx0x_compat=yes)
191 AC_MSG_RESULT($disable_cxx0x_compat)
192 if test "$disable_cxx0x_compat" = yes; then
193   CXXFLAGS="$TMPCXXFLAGS -Wno-c++0x-compat"
194 else
195   CXXFLAGS="$TMPCXXFLAGS"
196 fi
197 AC_LANG_POP(C++)
198
199 # pthread (not needed on Windows)
200 if test "$os_win32" = "no"; then
201 AC_CHECK_HEADERS([pthread.h],
202                  AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exists]),
203                  AC_MSG_ERROR([pthread support is required to build WebKit]))
204 AC_CHECK_LIB(pthread, pthread_rwlock_init,
205                  AC_DEFINE([HAVE_PTHREAD_RWLOCK],[1],[Define if pthread rwlock is present]),
206                  AC_MSG_WARN([pthread rwlock support is not available]))
207 fi
208
209 # check for libjpeg the way Gtk does it.
210 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
211                    jpeg_ok=yes, jpeg_ok=no
212                    AC_MSG_ERROR([JPEG library (libjpeg) not found]))
213 if test "$jpeg_ok" = yes; then
214    AC_MSG_CHECKING([for jpeglib])
215    AC_TRY_CPP(
216 [#include <stdio.h>
217 #undef PACKAGE
218 #undef VERSION
219 #undef HAVE_STDLIB_H
220 #include <jpeglib.h>],
221          jpeg_ok=yes,
222          jpeg_ok=no)
223    AC_MSG_RESULT($jpeg_ok)
224    if test "$jpeg_ok" = yes; then
225       JPEG_LIBS="-ljpeg"
226       # should we check for progressive JPEG like GTK+ as well?
227    else
228       AC_MSG_ERROR([JPEG library (libjpeg) not found])
229    fi
230 fi
231 AC_SUBST([JPEG_LIBS])
232
233 # Check for libpng the way Gtk+ does it
234 for l in libpng libpng14 libpng12; do
235   AC_MSG_CHECKING(for $l)
236   if $PKG_CONFIG --exists $l ; then
237     AC_MSG_RESULT(yes)
238     PNG_LIBS=`$PKG_CONFIG --libs $l`
239     png_ok=yes
240     break
241   else
242     AC_MSG_RESULT(no)
243     png_ok=no
244   fi
245 done
246 if test "$png_ok" != yes; then
247   AC_CHECK_LIB(png, png_read_info,
248     [AC_CHECK_HEADER(png.h,
249       png_ok=yes,
250       png_ok=no)],
251     AC_MSG_ERROR([PNG library (libpng) not found]), -lz -lm)
252   if test "$png_ok" = yes; then
253     AC_MSG_CHECKING([for png_structp in png.h])
254     AC_TRY_COMPILE([#include <png.h>],
255       [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
256       png_ok=yes,
257       png_ok=no)
258     AC_MSG_RESULT($png_ok)
259     if test "$png_ok" = yes; then
260       PNG_LIBS='-lpng -lz'
261     else
262       AC_MSG_ERROR([PNG library (libpng) not found])
263     fi
264   else
265     AC_MSG_ERROR([PNG library (libpng) not found])
266   fi
267 fi
268 AC_SUBST([PNG_LIBS])
269
270
271 if test "$os_win32" = "yes"; then
272   WINMM_LIBS=-lwinmm
273   SHLWAPI_LIBS=-lshlwapi
274   OLE32_LIBS=-lole32
275 fi
276 AC_SUBST([WINMM_LIBS])
277 AC_SUBST([SHLWAPI_LIBS])
278 AC_SUBST([OLE32_LIBS])
279
280
281 # determine the GTK+ version to use
282 AC_MSG_CHECKING([the GTK+ version to use])
283 AC_ARG_WITH([gtk],
284         [AS_HELP_STRING([--with-gtk=2.0|3.0], [the GTK+ version to use (default: 3.0)])],
285         [case "$with_gtk" in
286         2.0|3.0) ;;
287         *) AC_MSG_ERROR([invalid GTK+ version specified]) ;;
288         esac],
289         [with_gtk=3.0])
290 AC_MSG_RESULT([$with_gtk])
291
292 GTK2_REQUIRED_VERSION=2.10
293 GAIL2_REQUIRED_VERSION=1.8
294 GTK3_REQUIRED_VERSION=3.4.0
295 GAIL3_REQUIRED_VERSION=3.0
296
297 case "$with_gtk" in
298      2.0) GTK_REQUIRED_VERSION=$GTK2_REQUIRED_VERSION
299           GTK_API_VERSION=2.0
300           WEBKITGTK_API_MAJOR_VERSION=1
301           WEBKITGTK_API_MINOR_VERSION=0
302           WEBKITGTK_API_VERSION=1.0
303           WEBKITGTK_PC_NAME=webkit
304           GAIL_PC_NAME=gail
305           GAIL_REQUIRED_VERSION=$GAIL2_REQUIRED_VERSION
306           ;;
307      3.0) GTK_REQUIRED_VERSION=$GTK3_REQUIRED_VERSION
308           GTK_API_VERSION=3.0
309           WEBKITGTK_API_MAJOR_VERSION=3
310           WEBKITGTK_API_MINOR_VERSION=0
311           WEBKITGTK_API_VERSION=3.0
312           WEBKITGTK_PC_NAME=webkitgtk
313           GAIL_PC_NAME=gail-3.0
314           GAIL_REQUIRED_VERSION=$GAIL3_REQUIRED_VERSION
315           ;;
316 esac
317
318 AC_SUBST([WEBKITGTK_API_MAJOR_VERSION])
319 AC_SUBST([WEBKITGTK_API_MINOR_VERSION])
320 AC_SUBST([WEBKITGTK_API_VERSION])
321 AC_SUBST([WEBKITGTK_PC_NAME])
322 AC_SUBST([GTK_API_VERSION])
323 AM_CONDITIONAL([GTK_API_VERSION_2],[test "$GTK_API_VERSION" = "2.0"])
324
325 # determine the GDK/GTK+ target
326 AC_MSG_CHECKING([the target windowing system])
327 AC_ARG_WITH(target,
328             AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@],
329                            [Select webkit target [default=x11]]),
330             [],[with_target="x11"])
331
332 case "$with_target" in
333      x11|win32|quartz|directfb) ;;
334      *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
335 esac
336
337 AC_MSG_RESULT([$with_target])
338
339 AC_MSG_CHECKING([the GStreamer version to use])
340 AC_ARG_WITH([gstreamer],
341         [AS_HELP_STRING([--with-gstreamer=0.10|1.0], [the GStreamer version to use (default: 0.10)])],
342         [case "$with_gstreamer" in
343         0.10|1.0) ;;
344         *) AC_MSG_ERROR([invalid GStreamer version specified]) ;;
345         esac],
346         [with_gstreamer=0.10])
347 AC_MSG_RESULT([$with_gstreamer])
348
349 GSTREAMER_0_10_REQUIRED_VERSION=0.10
350 GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION=0.10.30
351 GSTREAMER_1_0_REQUIRED_VERSION=0.11.90
352 GSTREAMER_1_0_PLUGINS_BASE_REQUIRED_VERSION=0.11.90
353
354 case "$with_gstreamer" in
355      0.10) GSTREAMER_REQUIRED_VERSION=$GSTREAMER_0_10_REQUIRED_VERSION
356            GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION=$GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION
357            GST_API_VERSION=0.10
358            ;;
359      1.0) GSTREAMER_REQUIRED_VERSION=$GSTREAMER_1_0_REQUIRED_VERSION
360            GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION=$GSTREAMER_1_0_PLUGINS_BASE_REQUIRED_VERSION
361            GST_API_VERSION=1.0
362            ;;
363 esac
364
365 AC_SUBST([GST_API_VERSION])
366 if test "$GST_API_VERSION" = "1.0"; then
367 AC_DEFINE([GST_USE_UNSTABLE_API], [1], [Using unstable GStreamer API])
368 AC_DEFINE([GST_API_VERSION_1],[1], [Using GStreamer 1.0])
369 fi
370
371 # minimum base dependencies
372 CAIRO_REQUIRED_VERSION=1.10
373 FONTCONFIG_REQUIRED_VERSION=2.4
374 FREETYPE2_REQUIRED_VERSION=9.0
375 GLIB_REQUIRED_VERSION=2.32.0
376 LIBSOUP_REQUIRED_VERSION=2.39.2
377 LIBXML_REQUIRED_VERSION=2.6
378 PANGO_REQUIRED_VERSION=1.21.0
379
380 # optional modules
381 LIBXSLT_REQUIRED_VERSION=1.1.7
382 SQLITE_REQUIRED_VERSION=3.0
383 ENCHANT_REQUIRED_VERSION=0.22
384 CLUTTER_REQUIRED_VERSION=1.8.2
385 CLUTTER_GTK_REQUIRED_VERSION=1.0.2
386 ATSPI2_REQUIRED_VERSION=2.2.1
387
388 # Check for glib and required utilities
389 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :, :, gmodule gobject gthread gio)
390 if test -z "$GLIB_GENMARSHAL" || test -z "$GLIB_MKENUMS"; then
391    AC_MSG_ERROR([You need the GLib dev tools in your path])
392 fi
393 GLIB_GSETTINGS
394
395 # Check and identify which unicode backend to use
396 AC_MSG_CHECKING([which Unicode backend to use])
397 AC_ARG_WITH(unicode_backend,
398             AC_HELP_STRING([--with-unicode-backend=@<:@icu/glib@:>@],
399                            [Select Unicode backend (WARNING: the glib-based backend is slow, and incomplete) [default=icu]]),
400             [],[with_unicode_backend="icu"])
401
402 case "$with_unicode_backend" in
403      icu|glib) ;;
404      *) AC_MSG_ERROR([Invalid Unicode backend: must be icu or glib.]) ;;
405 esac
406
407 AC_MSG_RESULT([$with_unicode_backend])
408
409 if test "$with_unicode_backend" = "icu"; then
410     # TODO: use pkg-config (after CFLAGS in their .pc files are cleaned up)
411     case "$host" in
412         *-*-darwin*)
413             UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
414             UNICODE_LIBS="-licucore"
415             ;;
416         *-*-mingw*)
417             UNICODE_CFLAGS=""
418             UNICODE_LIBS="-licui18n -licuuc"
419             ;;
420         *)
421             AC_PATH_PROG(icu_config, icu-config, no)
422             if test "$icu_config" = "no"; then
423                 AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
424             fi
425
426             # We don't use --cflags as this gives us a lot of things that we don't
427             # necessarily want, like debugging and optimization flags
428             # See man (1) icu-config for more info.
429             UNICODE_CFLAGS=`$icu_config --cppflags`
430             UNICODE_LIBS=`$icu_config --ldflags-libsonly`
431             ;;
432     esac
433 fi
434
435 if test "$with_unicode_backend" = "glib"; then
436     PKG_CHECK_MODULES([UNICODE], [glib-2.0 pango >= $PANGO_REQUIRED_VERSION])
437 fi
438
439 AC_SUBST([UNICODE_CFLAGS])
440 AC_SUBST([UNICODE_LIBS])
441
442 PKG_CHECK_MODULES([ZLIB], [zlib])
443 AC_SUBST([ZLIB_CFLAGS])
444 AC_SUBST([ZLIB_LIBS])
445
446 GETTEXT_PACKAGE=$PACKAGE-$GTK_API_VERSION
447 AC_SUBST(GETTEXT_PACKAGE)
448 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
449                    [The gettext catalog name])
450
451 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED_VERSION)
452 AC_SUBST(LIBXML_CFLAGS)
453 AC_SUBST(LIBXML_LIBS)
454
455 PKG_CHECK_MODULES(PANGO, 
456                   [pango >= $PANGO_REQUIRED_VERSION
457                    pangoft2])
458 AC_SUBST(PANGO_CFLAGS)
459 AC_SUBST(PANGO_LIBS)
460
461 AC_MSG_CHECKING([whether to enable spellcheck support])
462 AC_ARG_ENABLE([spellcheck],
463   [AS_HELP_STRING([--enable-spellcheck],[enable support for spellcheck])],
464   [],[enable_spellcheck="yes"])
465 AC_MSG_RESULT([$enable_spellcheck])
466
467 if test "$enable_spellcheck" = "yes"; then
468 PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED_VERSION, [], [enable_spellcheck="no"])
469 AC_SUBST(ENCHANT_CFLAGS)
470 AC_SUBST(ENCHANT_LIBS)
471 fi
472
473 # farstream-0.1 depends on gstreamer 0.10 currently. Disable
474 # media_stream if gstreamer 0.11 build support is enabled.
475 if test "$GST_API_VERSION" = "1.0"; then
476    enable_media_stream=false
477 fi
478 if test "$enable_media_stream" = "yes"; then
479    PKG_CHECK_MODULES([FARSTREAM], [farstream-0.1],
480                      [have_farstream=yes], [enable_media_stream=false])
481    AC_SUBST([FARSTREAM_CFLAGS])
482    AC_SUBST([FARSTREAM_LIBS])
483 fi
484
485 PKG_CHECK_MODULES(GAIL, $GAIL_PC_NAME >= $GAIL_REQUIRED_VERSION)
486 AC_SUBST(GAIL_CFLAGS)
487 AC_SUBST(GAIL_LIBS)
488
489 # check for target-specific dependencies
490 if test "$with_target" = "directfb"; then
491    PKG_CHECK_MODULES(CAIRO, cairo-directfb >= $CAIRO_REQUIRED_VERSION)
492    PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
493    AC_DEFINE([WTF_PLATFORM_DIRECTFB],[1],[Define if target is DirectFB])
494 else
495    PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED_VERSION)
496    PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
497
498    if test "$with_target" = "x11" && test "$os_win32" = "no"; then
499       # check for XT
500       PKG_CHECK_MODULES([XT],
501                         [xt],
502                         [xt_has_pkg_config=yes],
503                         [xt_has_pkg_config=no])
504       # some old versions of Xt do not provide xt.pc, so try to link against Xt
505       # and if it's installed fall back to just adding -lXt
506       if test "$xt_has_pkg_config" = "no"; then
507          # using AC_CHECK_LIB instead of AC_SEARCH_LIB is fine in this case as
508          # we don't care about the XtOpenDisplay symbol but only about the
509          # existence of libXt
510          AC_CHECK_LIB([Xt], [XtOpenDisplay],
511                       [XT_CFLAGS=""; XT_LIBS="-lXt"],
512                       [AC_MSG_ERROR([X Toolkit Intrinsics library (libXt) not found])])
513       fi
514       AC_SUBST([XT_CFLAGS])
515       AC_SUBST([XT_LIBS])
516       AC_DEFINE([WTF_PLATFORM_X11],[1],[Define if target is X11])
517    fi
518 fi
519 AC_SUBST(GTK_CFLAGS)
520 AC_SUBST(GTK_LIBS)
521 AC_SUBST(CAIRO_CFLAGS)
522 AC_SUBST(CAIRO_LIBS)
523
524 # check whether to build with debugging enabled
525 AC_MSG_CHECKING([whether to do a debug build])
526 AC_ARG_ENABLE(debug,
527               AC_HELP_STRING([--enable-debug],
528                              [turn on debugging [default=no]]),
529               [],[enable_debug="no"])
530 AC_MSG_RESULT([$enable_debug])
531
532 # check whether to enable optimized builds
533 AC_MSG_CHECKING([whether to enable optimized builds])
534 AC_ARG_ENABLE(optimizations,
535               AC_HELP_STRING([--enable-optimizations],
536                              [turn on optimize builds (GCC only)
537                              [default=yes]]),
538               [enable_optimizations=$enableval],
539               [if test "$enable_debug" = "yes"; then enable_optimizations="no"; else enable_optimizations="yes"; fi])
540 AC_MSG_RESULT([$enable_optimizations])
541
542 # check whether to enable unstable features
543 AC_MSG_CHECKING([whether to enable unstable features])
544 AC_ARG_ENABLE(unstable_features,
545               AC_HELP_STRING([--enable-unstable-features],
546                              [enable unstable features [default=no]]),
547               [],[enable_unstable_features="no"])
548 AC_MSG_RESULT([$enable_unstable_features])
549
550 found_opengl="no"
551 if test "$with_target" = "x11"; then
552     AC_CHECK_HEADERS([GL/gl.h], [found_opengl="yes"], [])
553     AC_CHECK_HEADERS([GL/glx.h], [], [found_opengl="no"])
554 fi
555 AC_MSG_CHECKING([which GPU acceleration backend to use])
556 AC_ARG_WITH(acceleration_backend,
557             AC_HELP_STRING([--with-acceleration-backend=@<:@opengl/clutter/none@:>@],
558                            [Select accelerated backend (Clutter currently unsupported, OpenGL autodetected) [default=autodetect]]), [],
559                            [
560                                 if test "$found_opengl" = "yes"; then
561                                    with_acceleration_backend="opengl";
562                                 else
563                                    with_acceleration_backend="none";
564                                 fi
565                            ])
566 AC_MSG_RESULT([$with_acceleration_backend])
567
568 if test "$with_acceleration_backend" = "opengl"; then
569     PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite]);
570     PKG_CHECK_MODULES([XDAMAGE], [xdamage]);
571     AC_SUBST(XCOMPOSITE_CFLAGS)
572     AC_SUBST(XCOMPOSITE_LIBS)
573     AC_SUBST(XDAMAGE_CFLAGS)
574     AC_SUBST(XDAMAGE_LIBS)
575 fi
576
577 # OpenGL is turned on by default (along with WebGL and accelerated compositing), but if
578 # Clutter is chosen as the accelerated drawing backend, we want to disable it. COGL does 
579 # not play well with OpenGL.
580 AC_MSG_CHECKING([whether to enable WebGL support])
581 AC_ARG_ENABLE(webgl,
582               AC_HELP_STRING([--enable-webgl], [enable support for WebGL [default=check]]), [],
583               [
584                 if test "$with_acceleration_backend" = "opengl"; then
585                     enable_webgl="yes";
586                 else
587                     enable_webgl="no";
588                 fi
589              ])
590 AC_MSG_RESULT([$enable_webgl])
591 if test "$enable_webgl" = "yes" && test "$with_acceleration_backend" != "opengl"; then
592     AC_MSG_ERROR([OpenGL must be active (and Clutter disabled) to use WebGL.])
593 fi;
594
595 AC_MSG_CHECKING([whether to enable accelerated compositing support])
596 AC_ARG_ENABLE(accelerated_compositing,
597             AC_HELP_STRING([--enable-accelerated-compositing], [enable support for accelerated compositing [default=check]]),
598             [
599                 if test "$enableval" = "yes" && test "$with_acceleration_backend" = "none"; then
600                     AC_MSG_ERROR([OpenGL or Clutter must be active to use accelerated compositing.])
601                 fi
602                 enable_accelerated_compositing=$enableval;
603             ],
604             [
605                 if test "$with_acceleration_backend" != "none"; then
606                     enable_accelerated_compositing="yes";
607                 else
608                     enable_accelerated_compositing="no";
609                 fi
610             ])
611 AC_MSG_RESULT([$enable_accelerated_compositing])
612
613 # check whether to enable Gamepad support
614 AC_MSG_CHECKING([whether to enable Gamepad support])
615 AC_ARG_ENABLE(gamepad,
616               AC_HELP_STRING([--enable-gamepad],
617                              [enable Gamepad support [default=no]]),
618               [],[enable_gamepad=$enable_unstable_features])
619 AC_MSG_RESULT([$enable_gamepad])
620
621 if test "$enable_gamepad" = "yes" && test "$os_linux" = no; then
622    AC_MSG_WARN([Gamepad support is only available on Linux. Disabling Gamepad support.])
623    enable_gamepad=no;
624 fi
625
626 # check whether to enable the indexed database API
627 AC_MSG_CHECKING([whether to enable the indexed database API])
628 AC_ARG_ENABLE(indexed_database,
629               AC_HELP_STRING([--enable-indexed-database],
630                              [enable the indexed database API (incomplete) [default=no]]),
631               [],[enable_indexed_database="no"])
632 AC_MSG_RESULT([$enable_indexed_database])
633
634 # check whether to enable HTML5 audio/video support
635 AC_MSG_CHECKING([whether to enable HTML5 video support])
636 AC_ARG_ENABLE(video,
637               AC_HELP_STRING([--enable-video],
638                              [enable HTML5 video support [default=yes]]),
639               [],[enable_video="yes"])
640 AC_MSG_RESULT([$enable_video])
641
642 # check whether to enable media stream support
643 AC_MSG_CHECKING([whether to enable media stream support])
644 AC_ARG_ENABLE(media_stream,
645               AC_HELP_STRING([--enable-media-stream],
646                              [enable media stream support (incomplete) [default=no]]),
647               [],[enable_media_stream=$enable_unstable_features])
648 AC_MSG_RESULT([$enable_media_stream])
649
650 # check whether to enable XSLT support
651 AC_MSG_CHECKING([whether to enable XSLT support])
652 AC_ARG_ENABLE(xslt,
653               AC_HELP_STRING([--enable-xslt],
654                              [enable support for XSLT [default=yes]]),
655               [],[enable_xslt="yes"])
656 AC_MSG_RESULT([$enable_xslt])
657
658 # check whether to enable geolocation support
659 AC_MSG_CHECKING([whether to enable geolocation support])
660 AC_ARG_ENABLE(geolocation,
661               AC_HELP_STRING([--enable-geolocation],
662                              [enable support for geolocation [default=yes]]),
663               [],[enable_geolocation="yes"])
664 AC_MSG_RESULT([$enable_geolocation])
665
666 # check whether to enable SVG support
667 AC_MSG_CHECKING([whether to enable SVG support])
668 AC_ARG_ENABLE(svg,
669               AC_HELP_STRING([--enable-svg],
670                              [enable support for SVG [default=yes]]),
671               [],[enable_svg="yes"])
672 AC_MSG_RESULT([$enable_svg])
673
674 # turn off svg features if --disable-svg is requested
675 if test "$enable_svg" = "no"; then
676    enable_svg_fonts=no
677 fi
678
679 # check whether to enable support for filters
680 AC_MSG_CHECKING([whether to enable support for filters])
681 AC_ARG_ENABLE(filters,
682               AC_HELP_STRING([--enable-filters],
683                              [enable support for filters (experimental) [default=yes]]),
684               [],[enable_filters="yes"])
685 AC_MSG_RESULT([$enable_filters])
686
687 # check whether to enable support for SVG fonts
688 AC_MSG_CHECKING([whether to enable support for SVG fonts])
689 AC_ARG_ENABLE(svg_fonts,
690               AC_HELP_STRING([--enable-svg-fonts],
691                              [enable support for SVG fonts (experimental) [default=yes]]),
692               [],[enable_svg_fonts="yes"])
693 AC_MSG_RESULT([$enable_svg_fonts])
694
695 # check for SVG features, enabling SVG if necessary
696 if test "$enable_svg_fonts" = "yes" && test "$enable_svg" = "no"; then
697    AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
698    enable_svg=yes
699 fi
700
701 # check whether to enable Web Socket support
702 AC_MSG_CHECKING([whether to enable Web Sockets support])
703 AC_ARG_ENABLE(web_sockets,
704               AC_HELP_STRING([--enable-web-sockets],
705                              [enable support for Web Sockets [default=yes]]),
706               [],[enable_web_sockets="yes"])
707 AC_MSG_RESULT([$enable_web_sockets])
708
709 # check whether to enable Web Audio support
710 AC_MSG_CHECKING([whether to enable Web Audio support])
711 AC_ARG_ENABLE(web_audio,
712               AC_HELP_STRING([--enable-web-audio],
713                              [enable support for Web Audio [default=no]]),
714               [],[enable_web_audio="no"])
715 AC_MSG_RESULT([$enable_web_audio])
716
717 # check whether to enable code coverage
718 AC_MSG_CHECKING([whether to enable code coverage support])
719 AC_ARG_ENABLE(coverage,
720               AC_HELP_STRING([--enable-coverage],
721                              [enable code coverage support [default=no]]),
722               [],[enable_coverage="no"])
723 AC_MSG_RESULT([$enable_coverage])
724
725 # check whether to enable FastMalloc
726 AC_MSG_CHECKING([whether to enable optimized memory allocator])
727 AC_ARG_ENABLE(fast_malloc,
728               AC_HELP_STRING([--enable-fast-malloc],
729                              [enable optimized memory allocator default=yes, default=no for debug builds]),
730               [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
731 AC_MSG_RESULT([$enable_fast_malloc])
732
733 # check whether to enable debug symbols
734 AC_MSG_CHECKING([whether to enable debug symbols])
735 AC_ARG_ENABLE(debug_symbols,
736               AC_HELP_STRING([--enable-debug-symbols],
737                              [enable debug symbols default=no, default=yes for debug builds]),
738               [],[if test "$enable_debug" = "yes"; then enable_debug_symbols="yes"; else enable_debug_symbols="no"; fi])
739 AC_MSG_RESULT([$enable_debug_symbols])
740
741 # check whether to enable debug features
742 AC_MSG_CHECKING([whether to enable debug features])
743 AC_ARG_ENABLE(debug_features,
744               AC_HELP_STRING([--enable-debug-features],
745                              [enable debug features default=no, default=yes for debug builds]),
746               [],[if test "$enable_debug" = "yes"; then enable_debug_features="yes"; else enable_debug_features="no"; fi])
747 AC_MSG_RESULT([$enable_debug_features])
748
749 AC_MSG_CHECKING([whether to enable JIT compilation])
750 AC_ARG_ENABLE(jit,
751               AS_HELP_STRING([--enable-jit],
752                              [Enable JIT compilation (default: autodetect)]))
753 case "$enable_jit" in
754   yes) JSC_CPPFLAGS="-DENABLE_JIT=1" ;;
755   no) JSC_CPPFLAGS="-DENABLE_JIT=0" ;;
756   *) enable_jit="autodetect" ;;
757 esac
758 AC_SUBST(JSC_CPPFLAGS)
759 AC_MSG_RESULT([$enable_jit])
760
761 # Opcode stats
762 AC_MSG_CHECKING([whether to enable opcode stats])
763 AC_ARG_ENABLE([opcode-stats],
764   [AS_HELP_STRING([--enable-opcode-stats], [Enable Opcode statistics (default: disabled)])],
765   [], [enable_opcode_stats=no])
766 AC_MSG_RESULT([$enable_opcode_stats])
767
768 if test "$enable_opcode_stats" = "yes"; then
769   if test "$enable_jit" = "yes"; then
770     AC_MSG_ERROR([JIT must be disabled for Opcode stats to work.])
771   fi
772   AC_DEFINE([ENABLE_OPCODE_STATS], [1], [Define to enable Opcode statistics])
773 fi
774
775 # GObject Introspection
776 AC_MSG_CHECKING([whether to enable GObject introspection support])
777 AC_ARG_ENABLE([introspection],
778   [AS_HELP_STRING([--enable-introspection],[Enable GObject introspection (default: disabled)])],
779   [],[enable_introspection=no])
780 AC_MSG_RESULT([$enable_introspection])
781
782 # Enable css shaders if unstable_features, css_filters and
783 # accelerated_compositing are turned on.
784 AC_MSG_CHECKING([whether to enable CSS Shaders])
785 if test "$enable_unstable_features" = "yes" && test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"; then
786     enable_css_shaders=yes;
787     enable_css_filters=yes;
788 fi
789 AC_MSG_RESULT([$enable_css_filters])
790 AC_MSG_RESULT([$enable_css_shaders])
791
792 G_IR_SCANNER=
793 G_IR_COMPILER=
794 G_IR_GENERATE=
795 GIRDIR=
796 GIRTYPELIBDIR=
797
798 if test "$enable_introspection" = "yes"; then
799   GOBJECT_INTROSPECTION_REQUIRED=0.9.5
800   PKG_CHECK_MODULES([INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
801   
802   G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
803   G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
804   G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
805   AC_DEFINE([ENABLE_INTROSPECTION],[1],[Define to enable GObject introspection support])
806 fi
807
808 AC_SUBST([G_IR_SCANNER])
809 AC_SUBST([G_IR_COMPILER])
810 AC_SUBST([G_IR_GENERATE])
811
812 # determine the font backend
813 AC_MSG_CHECKING([the font backend to use])
814 AC_ARG_WITH(font_backend,
815             AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
816                            [Select font backend [default=freetype]]),
817             [],[with_font_backend="freetype"])
818
819 case "$with_font_backend" in
820      freetype|pango) ;;
821      *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
822 esac
823 AC_MSG_RESULT([$with_font_backend])
824
825 if test "$host_cpu" = "sh4"; then
826    CXXFLAGS="$CXXFLAGS -mieee -w"
827    CFLAGS="$CFLAGS -mieee -w"
828 fi
829
830 # Add '-g' flag to gcc to build with debug symbols
831 if test "$enable_debug_symbols" = "yes"; then
832    CXXFLAGS="$CXXFLAGS -g"
833    CFLAGS="$CFLAGS -g"
834 fi
835
836 if test "$enable_debug_features" = "no"; then
837    AC_DEFINE([NDEBUG], [1], [Define to disable debugging features])
838 fi
839
840 # Add the appropriate 'O' level for optimized builds
841 if test "$enable_optimizations" = "yes"; then
842    CXXFLAGS="$CXXFLAGS -O2"
843    CFLAGS="$CFLAGS -O2"
844 else
845    CXXFLAGS="$CXXFLAGS -O0"
846    CFLAGS="$CFLAGS -O0"
847 fi
848
849 PKG_CHECK_MODULES([LIBSOUP],
850                   [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
851 AC_SUBST([LIBSOUP_CFLAGS])
852 AC_SUBST([LIBSOUP_LIBS])
853
854 # check if FreeType/FontConfig are available
855 if test "$with_font_backend" = "freetype"; then
856    if test "$with_target" = "directfb"; then
857    PKG_CHECK_MODULES([FREETYPE],
858                      [fontconfig >= $FONTCONFIG_REQUIRED_VERSION
859                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
860    else
861    PKG_CHECK_MODULES([FREETYPE],
862                      [cairo-ft
863                      fontconfig >= $FONTCONFIG_REQUIRED_VERSION
864                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
865    fi
866    AC_SUBST([FREETYPE_CFLAGS])
867    AC_SUBST([FREETYPE_LIBS])
868 fi
869
870 # check if SQLite3 is available. Error out only if one of the
871 # features hard-depending on it is enabled while SQLite3 is
872 # unavailable.
873 PKG_CHECK_MODULES([SQLITE3],
874                   [sqlite3 >= $SQLITE_REQUIRED_VERSION],
875                   [sqlite3_has_pkg_config=yes],
876                   [sqlite3_has_pkg_config=no])
877 if test "$sqlite3_has_pkg_config" = "no"; then
878    AC_SEARCH_LIBS([sqlite3_open16], [sqlite3],
879                   [sqlite3_found=yes;SQLITE3_LIBS="$LIBS";SQLITE3_CFLAGS="-I $srcdir/WebKitLibraries/WebCoreSQLite3"],
880                   [sqlite3_found=no])
881 fi
882 AC_SUBST([SQLITE3_CFLAGS])
883 AC_SUBST([SQLITE3_LIBS])
884
885 if (test "$sqlite3_found" = "no"); then
886    AC_MSG_ERROR([SQLite3 is required for the Database related features])
887 fi
888
889 # check if libxslt is available
890 if test "$enable_xslt" = "yes"; then
891    PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
892    AC_SUBST([LIBXSLT_CFLAGS])
893    AC_SUBST([LIBXSLT_LIBS])
894 fi
895
896 # check if geoclue is available
897 if test "$enable_geolocation" = "yes"; then
898     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
899     AC_SUBST([GEOCLUE_CFLAGS])
900     AC_SUBST([GEOCLUE_LIBS])
901 fi
902
903 # check for XRender under Linux/Unix. Some linkers require explicit
904 # linkage (like GNU Gold), so we cannot rely on GTK+ pulling XRender
905 if test "$os_win32" = "no"; then
906    PKG_CHECK_MODULES([XRENDER], [xrender])
907    AC_SUBST([XRENDER_CFLAGS])
908    AC_SUBST([XRENDER_LIBS])
909 fi
910
911 # check if gstreamer is available
912 if test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"; then
913     gstreamer_modules="gstreamer-$GST_API_VERSION >= $GSTREAMER_REQUIRED_VERSION
914                        gstreamer-app-$GST_API_VERSION
915                        gstreamer-audio-$GST_API_VERSION
916                        gstreamer-fft-$GST_API_VERSION
917                        gstreamer-base-$GST_API_VERSION
918                        gstreamer-pbutils-$GST_API_VERSION
919                        gstreamer-plugins-base-$GST_API_VERSION >= $GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION
920                        gstreamer-video-$GST_API_VERSION";
921    if test "$GST_API_VERSION" != "1.0"; then
922        gstreamer_modules="$gstreamer_modules gstreamer-interfaces-$GST_API_VERSION";
923    fi
924    PKG_CHECK_MODULES([GSTREAMER], [$gstreamer_modules], [have_gstreamer=yes])
925    AC_SUBST([GSTREAMER_CFLAGS])
926    AC_SUBST([GSTREAMER_LIBS])
927 fi
928
929
930 if test "$with_acceleration_backend" = "clutter"; then
931    PKG_CHECK_MODULES(CLUTTER, clutter-1.0 >= $CLUTTER_REQUIRED_VERSION)
932    PKG_CHECK_MODULES([CLUTTER_GTK],
933                      [clutter-gtk-1.0 >= $CLUTTER_GTK_REQUIRED_VERSION])
934
935    AC_SUBST(CLUTTER_CFLAGS)
936    AC_SUBST(CLUTTER_LIBS)
937    AC_SUBST(CLUTTER_GTK_CFLAGS)
938    AC_SUBST(CLUTTER_GTK_LIBS)
939 fi
940
941 if test "$with_acceleration_backend" = "opengl"; then
942     OPENGL_LIBS="-lGL -ldl"
943 fi
944 AC_SUBST([OPENGL_LIBS])
945
946 # check if atspi2 is available (only needed for Webkit2 unit tests)
947 if test "$enable_webkit2" = "yes"; then
948    PKG_CHECK_MODULES([ATSPI2],
949                      [atspi-2 >= $ATSPI2_REQUIRED_VERSION],
950                      [have_atspi2=yes], [have_atspi2=no])
951
952    AC_SUBST([ATSPI2_CFLAGS])
953    AC_SUBST([ATSPI2_LIBS])
954 fi
955
956 if test "$enable_gamepad" = "yes"; then
957    PKG_CHECK_MODULES([GAMEPAD], [gio-unix-2.0 gudev-1.0])
958
959    AC_SUBST(GAMEPAD_CFLAGS)
960    AC_SUBST(GAMEPAD_LIBS)
961 fi
962
963 # check for code coverage support
964 if test "$enable_coverage" = "yes"; then
965    COVERAGE_CFLAGS="-MD"
966    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
967    AC_SUBST([COVERAGE_CFLAGS])
968    AC_SUBST([COVERAGE_LDFLAGS])
969 fi
970
971 # WebKit2
972 # If you change the default here, please also make sure the assumptions made
973 # in Tools/Scripts/webkitdirs.pm:buildAutotoolsProject still make sense.
974 AC_MSG_CHECKING([whether to build Webkit2])
975 AC_ARG_ENABLE(webkit2,
976     AC_HELP_STRING([--enable-webkit2], [build webkit2 [default=yes]]),
977     [], [enable_webkit2="yes"])
978 AC_MSG_RESULT([$enable_webkit2])
979 if test "$enable_webkit2" = "yes"; then
980    if test "$GTK_API_VERSION" = "2.0"; then
981       AC_MSG_ERROR([WebKit2 requires GTK+ 3.x, use --with-gtk=3.0])
982    fi
983
984    # Check Unix printing
985    PKG_CHECK_MODULES(GTK_UNIX_PRINTING, gtk+-unix-print-3.0,
986                      [have_gtk_unix_printing=yes],
987                      [have_gtk_unix_printing=no])
988    AC_SUBST(GTK_UNIX_PRINTING_CFLAGS)
989    AC_SUBST(GTK_UNIX_PRINTING_LIBS)
990    if test "$have_gtk_unix_printing" = "yes"; then
991        AC_DEFINE([HAVE_GTK_UNIX_PRINTING], [1], [Define if GTK+ UNIX Printing is available])
992    fi
993 fi
994
995 # Plugin Process
996 AC_MSG_CHECKING([whether to build plugin process for WebKit2])
997 AC_ARG_ENABLE(plugin_process,
998             AC_HELP_STRING([--enable-plugin-process], [build plugin process for WebKit2 [default=yes]]),
999                            [], [enable_plugin_process="yes"])
1000 AC_MSG_RESULT([$enable_plugin_process])
1001
1002 # Build the plugin process only when building Webkit2.
1003 if test "$enable_webkit2" = "no"; then
1004     enable_plugin_process=no
1005 fi
1006
1007 # Make sure we have GTK+ 2.x to build the plugin process.
1008 if test "$enable_plugin_process" = "yes"; then
1009    PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= $GTK2_REQUIRED_VERSION gail >= $GAIL2_REQUIRED_VERSION)
1010 fi
1011 AC_SUBST(GTK2_CFLAGS)
1012 AC_SUBST(GTK2_LIBS)
1013
1014 GTK_DOC_CHECK([1.10])
1015
1016 # OS conditionals
1017 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
1018 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
1019 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
1020 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
1021 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
1022
1023 # target conditionals
1024 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
1025 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
1026 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
1027 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
1028
1029 # Unicode backend conditionals
1030 AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
1031 AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
1032
1033 # Font backend conditionals
1034 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
1035 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
1036
1037 # GStreamer feature conditional
1038 AM_CONDITIONAL([USE_GSTREAMER], [test "$have_gstreamer" = "yes"])
1039 AM_CONDITIONAL([USE_WEBAUDIO_GSTREAMER], [test "$enable_web_audio" = "yes"])
1040
1041 # ATSPI2 conditional
1042 AM_CONDITIONAL([HAVE_ATSPI2], [test "$have_atspi2" = "yes"])
1043
1044 # Accelerated compositing conditional
1045 AM_CONDITIONAL([USE_ACCELERATED_COMPOSITING], [test "$enable_accelerated_compositing" = "yes"])
1046 AM_CONDITIONAL([USE_TEXTURE_MAPPER_CAIRO], [test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "none"])
1047 AM_CONDITIONAL([USE_TEXTURE_MAPPER_GL], [test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"])
1048 AM_CONDITIONAL([USE_CLUTTER], [test "$with_acceleration_backend" = "clutter"])
1049
1050 # These are the same now, but they will soon be separate.
1051 AM_CONDITIONAL([USE_GLX], [test "$with_acceleration_backend" = "opengl"])
1052 AM_CONDITIONAL([USE_OPENGL], [test "$with_acceleration_backend" = "opengl"])
1053
1054 # IndexedDB implies LevelDB, but other features may one day require LevelDB.
1055 AM_CONDITIONAL([ENABLE_INDEXED_DATABASE],[test "$enable_indexed_database" = "yes"])
1056 AM_CONDITIONAL([USE_LEVELDB],[test "$enable_indexed_database" = "yes"])
1057
1058 # Farstream feature conditional
1059 AM_CONDITIONAL([USE_FARSTREAM], [test "$have_farstream" = "yes"])
1060
1061 # WebKit feature conditionals
1062 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug_features" = "yes"])
1063 AM_CONDITIONAL([ENABLE_UNSTABLE_FEATURES],[test "$enable_unstable_features" = "yes"])
1064 AM_CONDITIONAL([ENABLE_WEBGL],[test "$enable_webgl" = "yes"])
1065 AM_CONDITIONAL([ENABLE_GAMEPAD],[test "$enable_gamepad" = "yes"])
1066 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
1067 AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"])
1068 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
1069 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
1070 AM_CONDITIONAL([ENABLE_MEDIA_STREAM],[test "$enable_media_stream" = "yes"])
1071 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
1072 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
1073 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
1074 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
1075 AM_CONDITIONAL([ENABLE_WEB_AUDIO],[test "$enable_web_audio" = "yes"])
1076 AM_CONDITIONAL([ENABLE_OPCODE_STATS],[test "$enable_opcode_stats" = "yes"])
1077 AM_CONDITIONAL([ENABLE_WEBKIT2],[test "$enable_webkit2" = "yes"])
1078 AM_CONDITIONAL([ENABLE_PLUGIN_PROCESS],[test "$enable_plugin_process" = "yes"])
1079 AM_CONDITIONAL([ENABLE_SPELLCHECK],[test "$enable_spellcheck" = "yes"])
1080 AM_CONDITIONAL([ENABLE_CSS_FILTERS],[test "$enable_css_filters" = "yes"])
1081 AM_CONDITIONAL([ENABLE_CSS_SHADERS],[test "$enable_css_shaders" = "yes"])
1082
1083 # Gtk conditionals
1084 AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
1085
1086 AC_CONFIG_FILES([
1087 GNUmakefile
1088 ])
1089  
1090
1091 AC_CONFIG_FILES([
1092 Source/WebKit/gtk/webkit/webkitversion.h
1093 DerivedSources/WebCore/UserAgentGtk.h:Source/WebCore/platform/gtk/UserAgentGtk.h.in
1094 ])
1095
1096 AC_CONFIG_FILES([
1097 Source/WebKit/gtk/${WEBKITGTK_PC_NAME}-${WEBKITGTK_API_VERSION}.pc:Source/WebKit/gtk/webkit.pc.in
1098 Source/WebKit/gtk/JSCore-${WEBKITGTK_API_VERSION}.gir:Source/WebKit/gtk/JSCore.gir.in
1099 Source/JavaScriptCore/javascriptcoregtk-${WEBKITGTK_API_VERSION}.pc:Source/JavaScriptCore/javascriptcoregtk.pc.in
1100 ]
1101 ,[WEBKITGTK_API_VERSION=$WEBKITGTK_API_VERSION,WEBKITGTK_PC_NAME=$WEBKITGTK_PC_NAME]
1102 )
1103
1104
1105 if test "$enable_webkit2" = "yes"; then
1106     AC_CONFIG_FILES([
1107     DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitVersion.h:Source/WebKit2/UIProcess/API/gtk/WebKitVersion.h.in
1108     ])
1109
1110     AC_CONFIG_FILES([
1111     Source/WebKit2/webkit2gtk-${WEBKITGTK_API_VERSION}.pc:Source/WebKit2/webkit2gtk.pc.in
1112     ]
1113     ,[WEBKITGTK_API_VERSION=$WEBKITGTK_API_VERSION,WEBKITGTK_PC_NAME=$WEBKITGTK_PC_NAME]
1114     )
1115 fi
1116
1117 AC_OUTPUT
1118
1119 echo "
1120 WebKit was configured with the following options:
1121
1122 Build configuration:
1123  Enable debugging (slow)                                  : $enable_debug
1124  Compile with debug symbols (slow)                        : $enable_debug_symbols
1125  Enable debug features (slow)                             : $enable_debug_features
1126  Enable GCC build optimization                            : $enable_optimizations
1127  Code coverage support                                    : $enable_coverage
1128  Unicode backend                                          : $with_unicode_backend
1129  Font backend                                             : $with_font_backend
1130  Optimized memory allocator                               : $enable_fast_malloc
1131  Accelerated rendering backend                            : $with_acceleration_backend
1132
1133 Features:
1134 =======
1135  Accelerated Compositing                                  : $enable_accelerated_compositing
1136  Filters support                                          : $enable_filters
1137  Gamepad support                                          : $enable_gamepad
1138  Geolocation support                                      : $enable_geolocation
1139  HTML5 video element support                              : $enable_video
1140  JIT compilation                                          : $enable_jit
1141  Media stream support                                     : $enable_media_stream
1142  Opcode stats                                             : $enable_opcode_stats
1143  SVG fonts support                                        : $enable_svg_fonts
1144  SVG support                                              : $enable_svg
1145  Spellcheck support                                       : $enable_spellcheck
1146  Web Audio support                                        : $enable_web_audio
1147  WebGL                                                    : $enable_webgl
1148  XSLT support                                             : $enable_xslt
1149
1150 WebKit2 support:
1151  WebKit2 support                                          : $enable_webkit2
1152  WebKit2 plugin process                                   : $enable_plugin_process
1153
1154 GTK+ configuration:
1155  GTK+ version                                             : $with_gtk
1156  GDK target                                               : $with_target
1157  GStreamer version                                        : $with_gstreamer
1158  Introspection support                                    : $enable_introspection
1159  Generate documentation                                   : $enable_gtk_doc
1160 "
1161 if test "$with_unicode_backend" = "glib"; then
1162    echo "     >> WARNING: the glib-based unicode backend is slow and incomplete <<"
1163    echo
1164    echo
1165 fi