Not reviewed. Update Chromium port test expectations.
[WebKit-https.git] / configure.ac
1 AC_PREREQ(2.59)
2
3 m4_define([webkit_major_version], [1])
4 m4_define([webkit_minor_version], [7])
5 m4_define([webkit_micro_version], [3])
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], [535])
12 m4_define([webkit_user_agent_minor_version], [14])
13
14 AC_INIT([WebKit],[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=11:3:11
39 AC_SUBST([LIBWEBKITGTK_VERSION])
40
41 AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip tar-ustar])
42
43 # Use AM_SILENT_RULES if present
44 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
45
46 # host checking - inspired by the GTK+ configure.in
47 # TODO: move these to webkit.m4?
48 AC_MSG_CHECKING([for native Win32])
49 case "$host" in
50      *-*-mingw*)
51        os_win32=yes
52        ;;
53      *)
54        os_win32=no
55        ;;
56 esac
57 AC_MSG_RESULT([$os_win32])
58
59 case "$host" in
60      *-*-linux*)
61        os_linux=yes
62        ;;
63      *-*-freebsd*)
64        os_freebsd=yes
65        ;;
66      *-*-darwin*)
67        os_darwin=yes
68        ;;
69 esac
70
71 case "$host_os" in
72      gnu* | linux* | k*bsd*-gnu)
73        os_gnu=yes
74        ;;
75      *)
76        os_gnu=no
77        ;;
78 esac
79
80 # initialize webkit options
81 WEBKIT_INIT
82 AC_DISABLE_STATIC
83 AC_LIBTOOL_WIN32_DLL
84 AC_PROG_LIBTOOL
85 # use dolt to speedup the build
86 DOLT
87
88 AC_PATH_PROG(FLEX, flex)
89 if test -z "$FLEX"; then
90    AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
91 else
92    FLEX_VERSION=`$FLEX --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
93    AX_COMPARE_VERSION([2.5.33],[gt],[$FLEX_VERSION],
94       AC_MSG_WARN([You need at least version 2.5.33 of the 'flex' lexer generator to compile WebKit correctly]))
95 fi
96
97 AC_PATH_PROG(GPERF, gperf)
98 if test -z "$GPERF"; then
99    AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
100 fi
101
102 # Disable C++0x compat warnings for GCC >= 4.6.0 until we build
103 # cleanly with that.
104 AC_LANG_PUSH(C++)
105 TMPCXXFLAGS=$CXXFLAGS
106 CXXFLAGS="-Wall -Werror"
107 AC_MSG_CHECKING([if we have to disable C++0x compat warnings for GCC >= 4.6.0])
108 AC_TRY_COMPILE([
109 namespace std {
110     class nullptr_t { };
111 }
112 extern std::nullptr_t nullptr;
113 ], [return 0;],
114 CXXFLAGS="$TMPCXXFLAGS", CXXFLAGS="$TMPCXXFLAGS -Wno-c++0x-compat")
115 AC_LANG_POP(C++)
116
117 # pthread (not needed on Windows)
118 if test "$os_win32" = "no"; then
119 AC_CHECK_HEADERS([pthread.h],
120                  AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exists]),
121                  AC_MSG_ERROR([pthread support is required to build WebKit]))
122 AC_CHECK_LIB(pthread, pthread_rwlock_init,
123                  AC_DEFINE([HAVE_PTHREAD_RWLOCK],[1],[Define if pthread rwlock is present]),
124                  AC_MSG_WARN([pthread rwlock support is not available]))
125 fi
126
127 # check for libjpeg the way Gtk does it.
128 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
129                    jpeg_ok=yes, jpeg_ok=no
130                    AC_MSG_ERROR([JPEG library (libjpeg) not found]))
131 if test "$jpeg_ok" = yes; then
132    AC_MSG_CHECKING([for jpeglib])
133    AC_TRY_CPP(
134 [#include <stdio.h>
135 #undef PACKAGE
136 #undef VERSION
137 #undef HAVE_STDLIB_H
138 #include <jpeglib.h>],
139          jpeg_ok=yes,
140          jpeg_ok=no)
141    AC_MSG_RESULT($jpeg_ok)
142    if test "$jpeg_ok" = yes; then
143       JPEG_LIBS="-ljpeg"
144       # should we check for progressive JPEG like GTK+ as well?
145    else
146       AC_MSG_ERROR([JPEG library (libjpeg) not found])
147    fi
148 fi
149 AC_SUBST([JPEG_LIBS])
150
151 # Check for libpng the way Gtk+ does it
152 for l in libpng libpng14 libpng12; do
153   AC_MSG_CHECKING(for $l)
154   if $PKG_CONFIG --exists $l ; then
155     AC_MSG_RESULT(yes)
156     PNG_LIBS=`$PKG_CONFIG --libs $l`
157     png_ok=yes
158     break
159   else
160     AC_MSG_RESULT(no)
161     png_ok=no
162   fi
163 done
164 if test "$png_ok" != yes; then
165   AC_CHECK_LIB(png, png_read_info,
166     [AC_CHECK_HEADER(png.h,
167       png_ok=yes,
168       png_ok=no)],
169     AC_MSG_ERROR([PNG library (libpng) not found]), -lz -lm)
170   if test "$png_ok" = yes; then
171     AC_MSG_CHECKING([for png_structp in png.h])
172     AC_TRY_COMPILE([#include <png.h>],
173       [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
174       png_ok=yes,
175       png_ok=no)
176     AC_MSG_RESULT($png_ok)
177     if test "$png_ok" = yes; then
178       PNG_LIBS='-lpng -lz'
179     else
180       AC_MSG_ERROR([PNG library (libpng) not found])
181     fi
182   else
183     AC_MSG_ERROR([PNG library (libpng) not found])
184   fi
185 fi
186 AC_SUBST([PNG_LIBS])
187
188
189 if test "$os_win32" = "yes"; then
190   WINMM_LIBS=-lwinmm
191   SHLWAPI_LIBS=-lshlwapi
192   OLE32_LIBS=-lole32
193 fi
194 AC_SUBST([WINMM_LIBS])
195 AC_SUBST([SHLWAPI_LIBS])
196 AC_SUBST([OLE32_LIBS])
197
198
199 # determine the GTK+ version to use
200 AC_MSG_CHECKING([the GTK+ version to use])
201 AC_ARG_WITH([gtk],
202         [AS_HELP_STRING([--with-gtk=2.0|3.0], [the GTK+ version to use (default: 3.0)])],
203         [case "$with_gtk" in
204         2.0|3.0) ;;
205         *) AC_MSG_ERROR([invalid GTK+ version specified]) ;;
206         esac],
207         [with_gtk=3.0])
208 AC_MSG_RESULT([$with_gtk])
209
210 GTK2_REQUIRED_VERSION=2.10
211 GAIL2_REQUIRED_VERSION=1.8
212 GTK3_REQUIRED_VERSION=3.0
213 GAIL3_REQUIRED_VERSION=3.0
214
215 case "$with_gtk" in
216      2.0) GTK_REQUIRED_VERSION=$GTK2_REQUIRED_VERSION
217           GTK_API_VERSION=2.0
218           WEBKITGTK_API_MAJOR_VERSION=1
219           WEBKITGTK_API_MINOR_VERSION=0
220           WEBKITGTK_API_VERSION=1.0
221           WEBKITGTK_PC_NAME=webkit
222           GAIL_PC_NAME=gail
223           GAIL_REQUIRED_VERSION=$GAIL2_REQUIRED_VERSION
224           ;;
225      3.0) GTK_REQUIRED_VERSION=$GTK3_REQUIRED_VERSION
226           GTK_API_VERSION=3.0
227           WEBKITGTK_API_MAJOR_VERSION=3
228           WEBKITGTK_API_MINOR_VERSION=0
229           WEBKITGTK_API_VERSION=3.0
230           WEBKITGTK_PC_NAME=webkitgtk
231           GAIL_PC_NAME=gail-3.0
232           GAIL_REQUIRED_VERSION=$GAIL3_REQUIRED_VERSION
233           ;;
234 esac
235
236 AC_SUBST([WEBKITGTK_API_MAJOR_VERSION])
237 AC_SUBST([WEBKITGTK_API_MINOR_VERSION])
238 AC_SUBST([WEBKITGTK_API_VERSION])
239 AC_SUBST([WEBKITGTK_PC_NAME])
240 AC_SUBST([GTK_API_VERSION])
241 AM_CONDITIONAL([GTK_API_VERSION_2],[test "$GTK_API_VERSION" = "2.0"])
242
243 # determine the GDK/GTK+ target
244 AC_MSG_CHECKING([the target windowing system])
245 AC_ARG_WITH(target,
246             AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@],
247                            [Select webkit target [default=x11]]),
248             [],[with_target="x11"])
249
250 case "$with_target" in
251      x11|win32|quartz|directfb) ;;
252      *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
253 esac
254
255 AC_MSG_RESULT([$with_target])
256
257 AC_MSG_CHECKING([for Hildon UI extensions])
258 AC_ARG_WITH(hildon,
259             AC_HELP_STRING([--with-hildon],
260                            [Use Hildon UI extensions [default=no]]),
261             [],[with_hildon="no"])
262 AC_MSG_RESULT([$with_hildon])
263
264 if test "$with_hildon" = "yes"; then
265     HILDON_CPPFLAGS="-DMAEMO_CHANGES"
266     PKG_CHECK_MODULES([HILDON], [hildon-1])
267     AC_SUBST([HILDON_CPPFLAGS])
268     AC_SUBST([HILDON_CFLAGS])
269     AC_SUBST([HILDON_LIBS])
270 fi
271
272 # minimum base dependencies
273 LIBSOUP_REQUIRED_VERSION=2.37.2.1
274 CAIRO_REQUIRED_VERSION=1.10
275 FONTCONFIG_REQUIRED_VERSION=2.4
276 FREETYPE2_REQUIRED_VERSION=9.0
277 LIBXML_REQUIRED_VERSION=2.6
278
279 # minimum GTK+ base dependencies
280 PANGO_REQUIRED_VERSION=1.12
281
282 # optional modules
283 LIBXSLT_REQUIRED_VERSION=1.1.7
284 SQLITE_REQUIRED_VERSION=3.0
285 GSTREAMER_REQUIRED_VERSION=0.10
286 GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION=0.10.30
287 ENCHANT_REQUIRED_VERSION=0.22
288 LIBFFTW_REQUIRED_VERSION=3.2.2
289 CLUTTER_REQUIRED_VERSION=1.8.2
290 CLUTTER_GTK_REQUIRED_VERSION=1.0.2
291
292 # Available modules
293 #
294 # glib - glib and includes gthread
295 # unicode - check and identify which unicode backend to use
296 #
297 # todo: webcore gtk
298 WEBKIT_CHECK_DEPENDENCIES([glib unicode])
299
300 GETTEXT_PACKAGE=$PACKAGE-$GTK_API_VERSION
301 AC_SUBST(GETTEXT_PACKAGE)
302 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
303                    [The gettext catalog name])
304
305 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED_VERSION)
306 AC_SUBST(LIBXML_CFLAGS)
307 AC_SUBST(LIBXML_LIBS)
308
309 PKG_CHECK_MODULES(PANGO, 
310                   [pango >= $PANGO_REQUIRED_VERSION
311                    pangoft2])
312 AC_SUBST(PANGO_CFLAGS)
313 AC_SUBST(PANGO_LIBS)
314
315 AC_MSG_CHECKING([whether to enable spellcheck support])
316 AC_ARG_ENABLE([spellcheck],
317   [AS_HELP_STRING([--enable-spellcheck],[enable support for spellcheck])],
318   [],[enable_spellcheck="yes"])
319 AC_MSG_RESULT([$enable_spellcheck])
320
321 if test "$enable_spellcheck" = "yes"; then
322 PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED_VERSION, [], [enable_spellcheck="no"])
323 AC_SUBST(ENCHANT_CFLAGS)
324 AC_SUBST(ENCHANT_LIBS)
325 fi
326
327 PKG_CHECK_MODULES(GAIL, $GAIL_PC_NAME >= $GAIL_REQUIRED_VERSION)
328 AC_SUBST(GAIL_CFLAGS)
329 AC_SUBST(GAIL_LIBS)
330
331 # check for target-specific dependencies
332 if test "$with_target" = "directfb"; then
333    PKG_CHECK_MODULES(CAIRO, cairo-directfb >= $CAIRO_REQUIRED_VERSION)
334    PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
335    AC_DEFINE([WTF_PLATFORM_DIRECTFB],[1],[Define if target is DirectFB])
336 else
337    PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED_VERSION)
338    PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
339
340    if test "$with_target" = "x11" && test "$os_win32" = "no"; then
341       # check for XT
342       PKG_CHECK_MODULES([XT],
343                         [xt],
344                         [xt_has_pkg_config=yes],
345                         [xt_has_pkg_config=no])
346       # some old versions of Xt do not provide xt.pc, so try to link against Xt
347       # and if it's installed fall back to just adding -lXt
348       if test "$xt_has_pkg_config" = "no"; then
349          # using AC_CHECK_LIB instead of AC_SEARCH_LIB is fine in this case as
350          # we don't care about the XtOpenDisplay symbol but only about the
351          # existence of libXt
352          AC_CHECK_LIB([Xt], [XtOpenDisplay],
353                       [XT_CFLAGS=""; XT_LIBS="-lXt"],
354                       [AC_MSG_ERROR([X Toolkit Intrinsics library (libXt) not found])])
355       fi
356       AC_SUBST([XT_CFLAGS])
357       AC_SUBST([XT_LIBS])
358       AC_DEFINE([WTF_PLATFORM_X11],[1],[Define if target is X11])
359    fi
360 fi
361 AC_SUBST(GTK_CFLAGS)
362 AC_SUBST(GTK_LIBS)
363 AC_SUBST(CAIRO_CFLAGS)
364 AC_SUBST(CAIRO_LIBS)
365
366 # check whether to build with debugging enabled
367 AC_MSG_CHECKING([whether to do a debug build])
368 AC_ARG_ENABLE(debug,
369               AC_HELP_STRING([--enable-debug],
370                              [turn on debugging [default=no]]),
371               [],[enable_debug="no"])
372 AC_MSG_RESULT([$enable_debug])
373
374 # check whether to enable optimized builds
375 AC_MSG_CHECKING([whether to enable optimized builds])
376 AC_ARG_ENABLE(optimizations,
377               AC_HELP_STRING([--enable-optimizations],
378                              [turn on optimize builds (GCC only)
379                              [default=yes]]),
380               [enable_optimizations=$enableval],
381               [if test "$enable_debug" = "yes"; then enable_optimizations="no"; else enable_optimizations="yes"; fi])
382 AC_MSG_RESULT([$enable_optimizations])
383
384 # check whether to enable 3D rendering support
385 AC_MSG_CHECKING([whether to enable support for 3D Rendering])
386 AC_ARG_ENABLE(3d_rendering,
387               AC_HELP_STRING([--enable-3d-rendering],
388                              [enable support for 3D Rendering (experimental) [default=no]]),
389               [],[enable_3d_rendering="no"])
390 AC_MSG_RESULT([$enable_3d_rendering])
391
392 # check whether to enable WebGL support
393 AC_MSG_CHECKING([whether to enable WebGL support])
394 AC_ARG_ENABLE(webgl,
395               AC_HELP_STRING([--enable-webgl], [enable support for WebGL [default=yes]]),
396               [], [if test "$with_target" = "x11"; then enable_webgl="yes"; else enable_webgl="no"; fi])
397 AC_MSG_RESULT([$enable_webgl])
398
399 # check whether to enable accelerated compositing support
400 AC_MSG_CHECKING([whether to enable accelerated compositing support])
401 AC_ARG_WITH(accelerated_compositing,
402             AC_HELP_STRING([--with-accelerated-compositing=@<:@no/opengl/cairo/clutter@:>@],
403                            [use accelerated compositing (experimental) [default=no]]),
404             [], [with_accelerated_compositing="no"])
405 AC_MSG_RESULT([$with_accelerated_compositing])
406
407 if test "$enable_webgl" = "yes" ||  test "$with_accelerated_compositing" = "opengl" ; then
408     AC_CHECK_HEADERS([GL/gl.h], [], AC_MSG_ERROR([OpenGL header not found]))
409     AC_CHECK_HEADERS([GL/glx.h], [], AC_MSG_ERROR([GLX header not found]))
410     OPENGL_LIBS="-lGL -ldl"
411 fi
412 AC_SUBST([OPENGL_LIBS])
413
414 # check whether to enable channel messaging support
415 AC_MSG_CHECKING([whether to enable HTML5 Channel Messaging support])
416 AC_ARG_ENABLE(channel_messaging,
417               AC_HELP_STRING([--enable-channel-messaging],
418                              [enable HTML5 channel messaging support [default=yes]]),
419               [],[enable_channel_messaging="yes"])
420 AC_MSG_RESULT([$enable_channel_messaging])
421
422 # check whether to enable notifications
423 AC_MSG_CHECKING([whether to enable notifications])
424 AC_ARG_ENABLE(notifications,
425               AC_HELP_STRING([--enable-notifications],
426                              [enable notifications [default=no]]),
427               [],[enable_notifications="no"])
428 AC_MSG_RESULT([$enable_notifications])
429
430 # check whether to enable the meter tag
431 AC_MSG_CHECKING([whether to enable HTML5 meter tag])
432 AC_ARG_ENABLE(meter_tag,
433               AC_HELP_STRING([--enable-meter-tag],
434                              [enable HTML5 meter [default=yes]]),
435               [],[enable_meter_tag="yes"])
436 AC_MSG_RESULT([$enable_meter_tag])
437
438 # check whether to enable HTML5 Microdata support
439 AC_MSG_CHECKING([whether to enable HTML5 Microdata support])
440 AC_ARG_ENABLE(microdata,
441               AC_HELP_STRING([--enable-microdata],
442                              [enable HTML5 microdata support [default=no]]),
443               [],[enable_microdata="no"])
444 AC_MSG_RESULT([$enable_microdata])
445
446 # check whether to enable page visibility API.
447 AC_MSG_CHECKING([whether to enable Page Visibility API support])
448 AC_ARG_ENABLE(page_visibility_api,
449               AC_HELP_STRING([--enable-page-visibility-api],
450                              [enable page visibility api[default=no]]),
451               [],[enable_page_visibility_api="no"])
452 AC_MSG_RESULT([$enable_page_visibility_api])
453
454 # check whether to enable the progress tag
455 AC_MSG_CHECKING([whether to enable HTML5 progress tag])
456 AC_ARG_ENABLE(progress_tag,
457               AC_HELP_STRING([--enable-progress-tag],
458                              [enable HTML5 progress [default=yes]]),
459               [],[enable_progress_tag="yes"])
460 AC_MSG_RESULT([$enable_progress_tag])
461
462 # check whether to enable JavaScript debugger/profiler support
463 AC_MSG_CHECKING([whether to enable JavaScript debugger/profiler support])
464 AC_ARG_ENABLE(javascript_debugger,
465               AC_HELP_STRING([--enable-javascript-debugger],
466                              [enable JavaScript debugger/profiler support [default=yes]]),
467               [],[enable_javascript_debugger="yes"])
468 AC_MSG_RESULT([$enable_javascript_debugger])
469
470 # check whether to enable Gamepad support
471 AC_MSG_CHECKING([whether to enable Gamepad support])
472 AC_ARG_ENABLE(gamepad,
473               AC_HELP_STRING([--enable-gamepad],
474                              [enable Gamepad support [default=no]]),
475               [],[enable_gamepad="no"])
476 AC_MSG_RESULT([$enable_gamepad])
477
478 # check whether to build with datagrid support
479 AC_MSG_CHECKING([whether to enable HTML5 datagrid support])
480 AC_ARG_ENABLE(datagrid,
481               AC_HELP_STRING([--enable-datagrid],
482                              [enable HTML5 datagrid support [default=no]]),
483               [],[enable_datagrid="no"])
484 AC_MSG_RESULT([$enable_datagrid])
485
486 # check whether to build with data transfer items support
487 AC_MSG_CHECKING([whether to enable HTML5 data transfer items support])
488 AC_ARG_ENABLE(data_transfer_items,
489               AC_HELP_STRING([--enable-data-transfer-items],
490                              [enable HTML5 data transfer items support [default=no]]),
491               [],[enable_data_transfer_items="no"])
492 AC_MSG_RESULT([$enable_data_transfer_items])
493
494 # check whether to enable DOM mutation observer support
495 AC_MSG_CHECKING([whether to enable DOM mutation observer support])
496 AC_ARG_ENABLE(mutation_observers,
497               AC_HELP_STRING([--enable-mutation-observers],
498                              [enable DOM mutation observer support [default=no]]),
499               [],[enable_mutation_observers="no"])
500 AC_MSG_RESULT([$enable_mutation_observers])
501
502 # check whether to enable HTML5 client-side session and persitent storage support
503 AC_MSG_CHECKING([whether to enable HTML5 client-side session and persistent storage support])
504 AC_ARG_ENABLE(dom_storage,
505               AC_HELP_STRING([--enable-dom-storage],
506                              [enable HTML5 client-side session and persistent storage support [default=yes]]),
507               [],[enable_dom_storage="yes"])
508 AC_MSG_RESULT([$enable_dom_storage])
509
510 # check whether to enable the indexed database API
511 AC_MSG_CHECKING([whether to enable the indexed database API])
512 AC_ARG_ENABLE(indexed_database,
513               AC_HELP_STRING([--enable-indexed-database],
514                              [enable the indexed database API [default=no]]),
515               [],[enable_indexed_database="no"])
516 AC_MSG_RESULT([$enable_indexed_database])
517
518 # check whether to enable the color input
519 AC_MSG_CHECKING([whether to enable the color input])
520 AC_ARG_ENABLE(input_color,
521               AC_HELP_STRING([--enable-input-color],
522                              [enable the color input [default=no]]),
523               [],[enable_input_color="no"])
524 AC_MSG_RESULT([$enable_input_color])
525
526 # check whether to enable the speech input API
527 AC_MSG_CHECKING([whether to enable the speech input API])
528 AC_ARG_ENABLE(input_speech,
529               AC_HELP_STRING([--enable-input-speech],
530                              [enable the speech input API [default=no]]),
531               [],[enable_input_speech="no"])
532 AC_MSG_RESULT([$enable_input_speech])
533
534 # check whether to build with SQL database support
535 AC_MSG_CHECKING([whether to enable SQL client-side database storage support])
536 AC_ARG_ENABLE(sql_database,
537               AC_HELP_STRING([--enable-sql-database],
538                              [enable SQL client-side database storage support [default=yes]]),
539               [],[enable_sql_database="yes"])
540 AC_MSG_RESULT([$enable_sql_database])
541
542 # check whether to build with icon database support
543 AC_MSG_CHECKING([whether to enable icon database support])
544 AC_ARG_ENABLE(icon_database,
545               AC_HELP_STRING([--enable-icon-database],
546                              [enable icon database [default=yes]]),
547               [],[enable_icon_database="yes"])
548 AC_MSG_RESULT([$enable_icon_database])
549
550 # check whether to build with image resizer API support
551 AC_MSG_CHECKING([whether to enable image resizer API support])
552 AC_ARG_ENABLE(image_resizer,
553               AC_HELP_STRING([--enable-image-resizer],
554                              [enable image resizer [default=no]]),
555               [],[enable_image_resizer="no"])
556 AC_MSG_RESULT([$enable_image_resizer])
557
558 # check whether to enable HTML5 datalist support
559 AC_MSG_CHECKING([whether to enable HTML5 datalist support])
560 AC_ARG_ENABLE(datalist,
561               AC_HELP_STRING([--enable-datalist],
562                              [enable HTML5 datalist support [default=yes]]),
563               [],[enable_datalist="yes"])
564 AC_MSG_RESULT([$enable_datalist])
565
566 # check whether to enable HTML5 sandbox iframe support
567 AC_MSG_CHECKING([whether to enable HTML5 sandboxed iframe support])
568 AC_ARG_ENABLE(sandbox,
569               AC_HELP_STRING([--enable-sandbox],
570                              [enable HTML5 sandboxed iframe support [default=yes]]),
571               [],[enable_sandbox="yes"])
572 AC_MSG_RESULT([$enable_sandbox])
573
574 # check whether to enable HTML5 audio/video support
575 AC_MSG_CHECKING([whether to enable HTML5 video support])
576 AC_ARG_ENABLE(video,
577               AC_HELP_STRING([--enable-video],
578                              [enable HTML5 video support [default=yes]]),
579               [],[enable_video="yes"])
580 AC_MSG_RESULT([$enable_video])
581
582 # turn off video features if --disable-video is requested
583 if test "$enable_video" = "no"; then
584    enable_video_track=no
585 fi
586
587 # check whether to enable HTML5 video track support
588 AC_MSG_CHECKING([whether to enable HTML5 video track support])
589 AC_ARG_ENABLE(video_track,
590               AC_HELP_STRING([--enable-video-track],
591                              [enable HTML5 video track support [default=no]]),
592               [],[enable_video_track="no"])
593 AC_MSG_RESULT([$enable_video_track])
594
595 # check whether to enable media source support
596 AC_MSG_CHECKING([whether to enable media source support])
597 AC_ARG_ENABLE(media_source,
598               AC_HELP_STRING([--enable-media-source],
599                              [enable support for media source [default=no]]),
600               [], [enable_media_source="no"])
601 AC_MSG_RESULT([$enable_media_source])
602
603 # check whether to enable media statistics support
604 AC_MSG_CHECKING([whether to enable media statistics support])
605 AC_ARG_ENABLE(media_statistics,
606               AC_HELP_STRING([--enable-media-statistics],
607                              [enable support for media statistics [default=no]]),
608               [], [enable_media_statistics="no"])
609 AC_MSG_RESULT([$enable_media_statistics])
610
611 # check whether to enable Javascript Fullscreen API support
612 AC_MSG_CHECKING([whether to enable Fullscreen API support])
613 AC_ARG_ENABLE(fullscreen_api,
614               AC_HELP_STRING([--enable-fullscreen-api],
615                              [enable the Fullscreen API support [default=yes]]),
616               [],[enable_fullscreen_api="yes"])
617 AC_MSG_RESULT([$enable_fullscreen_api])
618
619 # check whether to enable media stream support
620 AC_MSG_CHECKING([whether to enable media stream support])
621 AC_ARG_ENABLE(media_stream,
622               AC_HELP_STRING([--enable-media-stream],
623                              [enable media stream support (incomplete) [default=no]]),
624               [],[enable_media_stream="no"])
625 AC_MSG_RESULT([$enable_media_stream])
626
627 # check whether to enable XSLT support
628 AC_MSG_CHECKING([whether to enable XSLT support])
629 AC_ARG_ENABLE(xslt,
630               AC_HELP_STRING([--enable-xslt],
631                              [enable support for XSLT [default=yes]]),
632               [],[enable_xslt="yes"])
633 AC_MSG_RESULT([$enable_xslt])
634
635 # check whether to enable geolocation support
636 AC_MSG_CHECKING([whether to enable geolocation support])
637 AC_ARG_ENABLE(geolocation,
638               AC_HELP_STRING([--enable-geolocation],
639                              [enable support for geolocation [default=no]]),
640               [],[enable_geolocation="no"])
641 AC_MSG_RESULT([$enable_geolocation])
642
643 # check whether to enable MathML support
644 AC_MSG_CHECKING([whether to enable MathML support])
645 AC_ARG_ENABLE(mathml,
646               AC_HELP_STRING([--enable-mathml],
647                              [enable support for MathML [default=no]]),
648               [],[enable_mathml="no"])
649 AC_MSG_RESULT([$enable_mathml])
650
651 # check whether to enable SVG support
652 AC_MSG_CHECKING([whether to enable SVG support])
653 AC_ARG_ENABLE(svg,
654               AC_HELP_STRING([--enable-svg],
655                              [enable support for SVG [default=yes]]),
656               [],[enable_svg="yes"])
657 AC_MSG_RESULT([$enable_svg])
658
659 # check whether to enable SharedWorkers support
660 AC_MSG_CHECKING([whether to enable SharedWorkers support])
661 AC_ARG_ENABLE(shared_workers,
662               AC_HELP_STRING([--enable-shared-workers],
663                              [enable support for SharedWorkers [default=yes]]),
664               [],[enable_shared_workers="yes"])
665 AC_MSG_RESULT([$enable_shared_workers])
666
667 # check whether to enable Web Workers support
668 AC_MSG_CHECKING([whether to enable Web Workers support])
669 AC_ARG_ENABLE(workers,
670               AC_HELP_STRING([--enable-workers],
671                              [enable support for Web Workers [default=yes]]),
672               [],[enable_workers="yes"])
673 AC_MSG_RESULT([$enable_workers])
674
675 # check whether to enable directory upload support
676 AC_MSG_CHECKING([whether to enable directory upload support])
677 AC_ARG_ENABLE(directory_upload,
678               AC_HELP_STRING([--enable-directory-upload],
679                              [enable support for directory upload [default=no]]),
680               [], [enable_directory_upload="no"])
681 AC_MSG_RESULT([$enable_directory_upload])
682
683 # check whether to enable HTML5 FileSystem API support
684 AC_MSG_CHECKING([whether to enable HTML5 FileSystem API support])
685 AC_ARG_ENABLE(file_system,
686               AC_HELP_STRING([--enable-file-system],
687                              [enable support for HTML5 FileSystem API [default=no]]),
688               [], [enable_file_system="no"])
689 AC_MSG_RESULT([$enable_file_system])
690
691 # check whether to enable HTML5 <style scoped> support
692 AC_MSG_CHECKING([whether to enable HTML5 <style scoped> support])
693 AC_ARG_ENABLE(file_system,
694               AC_HELP_STRING([--enable-style-scoped],
695                              [enable support for HTML5 <style scoped> [default=no]]),
696               [], [enable_style_scoped="no"])
697 AC_MSG_RESULT([$enable_style_scoped])
698
699 # check whether to enable Quota API support
700 AC_MSG_CHECKING([whether to enable Quota API support])
701 AC_ARG_ENABLE(quota,
702               AC_HELP_STRING([--enable-quota],
703                              [enable support for Quota API [default=no]]),
704               [], [enable_quota="no"])
705 AC_MSG_RESULT([$enable_quota])
706
707 # turn off svg features if --disable-svg is requested
708 if test "$enable_svg" = "no"; then
709    enable_svg_fonts=no
710 fi
711
712 # check whether to enable support for filters
713 AC_MSG_CHECKING([whether to enable support for filters])
714 AC_ARG_ENABLE(filters,
715               AC_HELP_STRING([--enable-filters],
716                              [enable support for filters (experimental) [default=yes]]),
717               [],[enable_filters="yes"])
718 AC_MSG_RESULT([$enable_filters])
719
720 # check whether to enable support for SVG fonts
721 AC_MSG_CHECKING([whether to enable support for SVG fonts])
722 AC_ARG_ENABLE(svg_fonts,
723               AC_HELP_STRING([--enable-svg-fonts],
724                              [enable support for SVG fonts (experimental) [default=yes]]),
725               [],[enable_svg_fonts="yes"])
726 AC_MSG_RESULT([$enable_svg_fonts])
727
728 # check for SVG features, enabling SVG if necessary
729 if test "$enable_svg_fonts" = "yes"; then
730    svg_flags=yes
731    if test "$enable_svg" = "no"; then
732        AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
733        enable_svg=yes
734    fi
735 fi
736
737 # check whether to enable Web Socket support
738 AC_MSG_CHECKING([whether to enable Web Sockets support])
739 AC_ARG_ENABLE(web_sockets,
740               AC_HELP_STRING([--enable-web-sockets],
741                              [enable support for Web Sockets [default=yes]]),
742               [],[enable_web_sockets="yes"])
743 AC_MSG_RESULT([$enable_web_sockets])
744
745 # check whether to enable Web Audio support
746 enable_web_audio=no
747 AC_MSG_RESULT([$enable_web_audio])
748
749 # check whether to enable Web Timing support
750 AC_MSG_CHECKING([whether to enable Web Timing support])
751 AC_ARG_ENABLE(web_timing,
752               AC_HELP_STRING([--enable-web-timing],
753                              [enable support for Web Timing [default=no]]),
754               [],[enable_web_timing="no"])
755 AC_MSG_RESULT([$enable_web_timing])
756
757 # check whether to enable Blob support
758 AC_MSG_CHECKING([whether to enable Blob support])
759 AC_ARG_ENABLE(blob,
760               AC_HELP_STRING([--enable-blob],
761                              [enable support for Blob [default=yes]]),
762               [],[enable_blob="yes"])
763 AC_MSG_RESULT([$enable_blob])
764
765 # check whether to enable Fast Mobile Scrolling support
766 AC_MSG_CHECKING([whether to enable Fast Mobile Scrolling])
767 AC_ARG_ENABLE(fast_mobile_scrolling,
768               AC_HELP_STRING([--enable-fast-mobile-scrolling],
769                              [enable support for Fast Mobile Scrolling [default=no]]),
770               [],[enable_fast_mobile_scrolling="no"])
771 AC_MSG_RESULT([$enable_fast_mobile_scrolling])
772
773 # check whether to enable code coverage
774 AC_MSG_CHECKING([whether to enable code coverage support])
775 AC_ARG_ENABLE(coverage,
776               AC_HELP_STRING([--enable-coverage],
777                              [enable code coverage support [default=no]]),
778               [],[enable_coverage="no"])
779 AC_MSG_RESULT([$enable_coverage])
780
781 # check whether to enable FastMalloc
782 AC_MSG_CHECKING([whether to enable optimized memory allocator])
783 AC_ARG_ENABLE(fast_malloc,
784               AC_HELP_STRING([--enable-fast-malloc],
785                              [enable optimized memory allocator default=yes, default=no for debug builds]),
786               [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
787 AC_MSG_RESULT([$enable_fast_malloc])
788
789 # check whether to enable debug symbols
790 AC_MSG_CHECKING([whether to enable debug symbols])
791 AC_ARG_ENABLE(debug_symbols,
792               AC_HELP_STRING([--enable-debug-symbols],
793                              [enable debug symbols default=no, default=yes for debug builds]),
794               [],[if test "$enable_debug" = "yes"; then enable_debug_symbols="yes"; else enable_debug_symbols="no"; fi])
795 AC_MSG_RESULT([$enable_debug_symbols])
796
797 # check whether to enable debug features
798 AC_MSG_CHECKING([whether to enable debug features])
799 AC_ARG_ENABLE(debug_features,
800               AC_HELP_STRING([--enable-debug-features],
801                              [enable debug features default=no, default=yes for debug builds]),
802               [],[if test "$enable_debug" = "yes"; then enable_debug_features="yes"; else enable_debug_features="no"; fi])
803 AC_MSG_RESULT([$enable_debug_features])
804
805 # Determine JavaScript engine to use.
806 AC_MSG_CHECKING([Javascript engine])
807 AC_ARG_WITH(jsengine,
808             AC_HELP_STRING([--with-jsengine=@<:@jsc@:>@],
809                            [Select Javascript engine [default=jsc]]),
810             [],[with_jsengine="jsc"])
811
812 case "$with_jsengine" in
813      jsc) ;;
814      *) AC_MSG_ERROR([Invalid JS engine: Must be jsc]) ;;
815 esac
816 AC_MSG_RESULT([$with_jsengine])
817
818 AC_MSG_CHECKING([whether to enable JIT compilation])
819 AC_ARG_ENABLE(jit,
820               AS_HELP_STRING([--enable-jit],
821                              [Enable JIT compilation (default: autodetect)]))
822 case "$enable_jit" in
823   yes) JSC_CPPFLAGS="-DENABLE_JIT=1" ;;
824   no) JSC_CPPFLAGS="-DENABLE_JIT=0" ;;
825   *) enable_jit="autodetect" ;;
826 esac
827 AC_SUBST(JSC_CPPFLAGS)
828 AC_MSG_RESULT([$enable_jit])
829
830 # Opcode stats
831 AC_MSG_CHECKING([whether to enable opcode stats])
832 AC_ARG_ENABLE([opcode-stats],
833   [AS_HELP_STRING([--enable-opcode-stats], [Enable Opcode statistics (default: disabled)])],
834   [], [enable_opcode_stats=no])
835 AC_MSG_RESULT([$enable_opcode_stats])
836
837 if test "$enable_opcode_stats" = "yes"; then
838   if test "$enable_jit" = "yes"; then
839     AC_MSG_ERROR([JIT must be disabled for Opcode stats to work.])
840   fi
841   AC_DEFINE([ENABLE_OPCODE_STATS], [1], [Define to enable Opcode statistics])
842 fi
843
844 # Link prefetch
845 AC_MSG_CHECKING([whether to enable link prefetch support])
846 AC_ARG_ENABLE([link-prefetch],
847   [AS_HELP_STRING([--enable-link-prefetch], [Enable Link prefetch support (default: disabled)])],
848   [],[enable_link_prefetch=no])
849 AC_MSG_RESULT([$enable_link_prefetch])
850
851 if test "$enable_link_prefetch" = "yes"; then 
852   AC_DEFINE([ENABLE_LINK_PREFETCH], [1], [Define to enable link prefetch support])
853 fi
854
855 # GObject Introspection
856 AC_MSG_CHECKING([whether to enable GObject introspection support])
857 AC_ARG_ENABLE([introspection],
858   [AS_HELP_STRING([--enable-introspection],[Enable GObject introspection (default: disabled)])],
859   [],[enable_introspection=no])
860 AC_MSG_RESULT([$enable_introspection])
861
862 # check whether to enable animation API
863 AC_MSG_CHECKING([whether to enable Animation API support])
864 AC_ARG_ENABLE(animation_api,
865               AC_HELP_STRING([--enable-animation-api],
866                              [enable support for Animation API (experimental) [default=no]]),
867               [], [enable_animation_api="no"])
868 AC_MSG_RESULT([$enable_animation_api])
869
870 # check whether to enable requestAnimationFrame support
871 AC_MSG_CHECKING([whether to enable requestAnimationFrame support])
872 AC_ARG_ENABLE(request_animation_frame,
873               AC_HELP_STRING([--enable-request-animation-frame],
874                              [enable support for requestAnimationFrame (experimental) [default=no]]),
875               [],[enable_request_animation_frame="no"])
876 AC_MSG_RESULT([$enable_request_animation_frame])
877
878 # check whether to enable touch icon loading 
879 AC_MSG_CHECKING([whether to enable touch icon loading])
880 AC_ARG_ENABLE(touch_icon_loading,
881               AC_HELP_STRING([--enable-touch-icon-loading],
882                              [enable support for loading touch icons [default=no]]),
883               [], [enable_touch_icon_loading="no"])
884 AC_MSG_RESULT([$enable_touch_icon_loading])
885
886 # check whether to enable Register Protocol Handler support
887 AC_MSG_CHECKING([whether to enable Register Protocol Handler])
888 AC_ARG_ENABLE(register_protocol_handler,
889               AC_HELP_STRING([--enable-register-protocol-handler],
890                              [enable support for Register Protocol Handler (experimental) [default=no]]),
891               [],[enable_register_protocol_handler="no"])
892 AC_MSG_RESULT([$enable_register_protocol_handler])
893
894 # check whether to enable DeviceOrientation support
895 AC_MSG_CHECKING([whether to enable DeviceOrientation])
896 AC_ARG_ENABLE(device_orientation,
897               AC_HELP_STRING([--enable-device-orientation],
898                              [enable support for DeviceOrientation (experimental and incomplete) [default=no]]),
899               [],[enable_device_orientation="no"])
900 AC_MSG_RESULT([$enable_device_orientation])
901
902 G_IR_SCANNER=
903 G_IR_COMPILER=
904 G_IR_GENERATE=
905 GIRDIR=
906 GIRTYPELIBDIR=
907
908 if test "$enable_introspection" = "yes"; then
909   GOBJECT_INTROSPECTION_REQUIRED=0.9.5
910   PKG_CHECK_MODULES([INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
911   
912   G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
913   G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
914   G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
915   AC_DEFINE([ENABLE_INTROSPECTION],[1],[Define to enable GObject introspection support])
916 fi
917
918 AC_SUBST([G_IR_SCANNER])
919 AC_SUBST([G_IR_COMPILER])
920 AC_SUBST([G_IR_GENERATE])
921
922 # determine the font backend
923 AC_MSG_CHECKING([the font backend to use])
924 AC_ARG_WITH(font_backend,
925             AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
926                            [Select font backend [default=freetype]]),
927             [],[with_font_backend="freetype"])
928
929 case "$with_font_backend" in
930      freetype|pango) ;;
931      *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
932 esac
933 AC_MSG_RESULT([$with_font_backend])
934
935 if test "$host_cpu" = "sh4"; then
936    CXXFLAGS="$CXXFLAGS -mieee -w"
937    CFLAGS="$CFLAGS -mieee -w"
938 fi
939
940 # Add '-g' flag to gcc to build with debug symbols
941 if test "$enable_debug_symbols" = "yes"; then
942    CXXFLAGS="$CXXFLAGS -g"
943    CFLAGS="$CFLAGS -g"
944 fi
945
946 if test "$enable_debug_features" = "no"; then
947    AC_DEFINE([NDEBUG], [1], [Define to disable debugging features])
948 fi
949
950 # Add the appropriate 'O' level for optimized builds
951 if test "$enable_optimizations" = "yes"; then
952    CXXFLAGS="$CXXFLAGS -O2"
953    CFLAGS="$CFLAGS -O2"
954 else
955    CXXFLAGS="$CXXFLAGS -O0"
956    CFLAGS="$CFLAGS -O0"
957 fi
958
959 PKG_CHECK_MODULES([LIBSOUP],
960                   [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
961 AC_SUBST([LIBSOUP_CFLAGS])
962 AC_SUBST([LIBSOUP_LIBS])
963
964 # check if FreeType/FontConfig are available
965 if test "$with_font_backend" = "freetype"; then
966    if test "$with_target" = "directfb"; then
967    PKG_CHECK_MODULES([FREETYPE],
968                      [fontconfig >= $FONTCONFIG_REQUIRED_VERSION
969                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
970    else
971    PKG_CHECK_MODULES([FREETYPE],
972                      [cairo-ft
973                      fontconfig >= $FONTCONFIG_REQUIRED_VERSION
974                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
975    fi
976    AC_SUBST([FREETYPE_CFLAGS])
977    AC_SUBST([FREETYPE_LIBS])
978 fi
979
980 # check if SQLite3 is available. Error out only if one of the
981 # features hard-depending on it is enabled while SQLite3 is
982 # unavailable.
983 PKG_CHECK_MODULES([SQLITE3],
984                   [sqlite3 >= $SQLITE_REQUIRED_VERSION],
985                   [sqlite3_has_pkg_config=yes],
986                   [sqlite3_has_pkg_config=no])
987 if test "$sqlite3_has_pkg_config" = "no"; then
988    AC_SEARCH_LIBS([sqlite3_open16], [sqlite3],
989                   [sqlite3_found=yes;SQLITE3_LIBS="$LIBS";SQLITE3_CFLAGS="-I $srcdir/WebKitLibraries/WebCoreSQLite3"],
990                   [sqlite3_found=no])
991 fi
992 AC_SUBST([SQLITE3_CFLAGS])
993 AC_SUBST([SQLITE3_LIBS])
994
995 if (test "$sqlite3_found" = "no"); then
996    AC_MSG_ERROR([SQLite3 is required for the Database related features])
997 fi
998
999 # check if libxslt is available
1000 if test "$enable_xslt" = "yes"; then
1001    PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
1002    AC_SUBST([LIBXSLT_CFLAGS])
1003    AC_SUBST([LIBXSLT_LIBS])
1004 fi
1005
1006 # check if geoclue is available
1007 if test "$enable_geolocation" = "yes"; then
1008     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
1009     AC_SUBST([GEOCLUE_CFLAGS])
1010     AC_SUBST([GEOCLUE_LIBS])
1011 fi
1012
1013 # check for XRender under Linux/Unix. Some linkers require explicit
1014 # linkage (like GNU Gold), so we cannot rely on GTK+ pulling XRender
1015 if test "$os_win32" = "no"; then
1016    PKG_CHECK_MODULES([XRENDER], [xrender])
1017    AC_SUBST([XRENDER_CFLAGS])
1018    AC_SUBST([XRENDER_LIBS])
1019 fi
1020
1021 # check if gstreamer is available
1022 if test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"; then
1023    PKG_CHECK_MODULES([GSTREAMER],
1024                      [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
1025                      gstreamer-app-0.10
1026                      gstreamer-audio-0.10
1027                      gstreamer-base-0.10
1028                      gstreamer-interfaces-0.10
1029                      gstreamer-pbutils-0.10
1030                      gstreamer-plugins-base-0.10 >= $GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION
1031                      gstreamer-video-0.10],
1032                      [have_gstreamer=yes])
1033
1034    AC_SUBST([GSTREAMER_CFLAGS])
1035    AC_SUBST([GSTREAMER_LIBS])
1036 fi
1037
1038 # check if libfftw is available
1039 if test "$enable_web_audio" = "yes"; then
1040    PKG_CHECK_MODULES([LIBFFTW],
1041                      [fftw3 >= $LIBFFTW_REQUIRED_VERSION
1042                      fftw3f >= $LIBFFTW_REQUIRED_VERSION],
1043                      [have_fftw=yes])
1044
1045     AC_SUBST([LIBFFTW_CFLAGS])
1046     AC_SUBST([LIBFFTW_LIBS])
1047 fi
1048
1049 if test "$with_accelerated_compositing" = "clutter"; then
1050    PKG_CHECK_MODULES(CLUTTER, clutter-1.0 >= $CLUTTER_REQUIRED_VERSION)
1051    PKG_CHECK_MODULES([CLUTTER_GTK],
1052                      [clutter-gtk-1.0 >= $CLUTTER_GTK_REQUIRED_VERSION])
1053
1054    AC_SUBST(CLUTTER_CFLAGS)
1055    AC_SUBST(CLUTTER_LIBS)
1056    AC_SUBST(CLUTTER_GTK_CFLAGS)
1057    AC_SUBST(CLUTTER_GTK_LIBS)
1058 fi
1059
1060 # check for code coverage support
1061 if test "$enable_coverage" = "yes"; then
1062    COVERAGE_CFLAGS="-MD"
1063    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
1064    AC_SUBST([COVERAGE_CFLAGS])
1065    AC_SUBST([COVERAGE_LDFLAGS])
1066 fi
1067
1068 # check for HTML features
1069 if test "$enable_video" = "yes"; then
1070     html_flags=yes
1071 fi
1072
1073 # WebKit2
1074 AC_MSG_CHECKING([whether to build Webkit2])
1075 AC_ARG_ENABLE(webkit2,
1076     AC_HELP_STRING([--enable-webkit2], [build webkit2 [default=no]]),
1077     [], [enable_webkit2="no"])
1078 AC_MSG_RESULT([$enable_webkit2])
1079 if test "$enable_webkit2" = "yes"; then
1080    if test "$GTK_API_VERSION" = "2.0"; then
1081       AC_MSG_ERROR([WebKit2 requires GTK+ 3.x, use --with-gtk=3.0])
1082    fi
1083 fi
1084
1085 # Plugin Process
1086 AC_MSG_CHECKING([whether to build plugin process for WebKit2])
1087 AC_ARG_ENABLE(plugin_process,
1088             AC_HELP_STRING([--enable-plugin-process], [build plugin process for WebKit2 [default=yes]]),
1089                            [], [enable_plugin_process="yes"])
1090 AC_MSG_RESULT([$enable_plugin_process])
1091
1092 # Build the plugin process only when building Webkit2.
1093 if test "$enable_webkit2" = "no"; then
1094     enable_plugin_process=no
1095 fi
1096
1097 # Make sure we have GTK+ 2.x to build the plugin process.
1098 if test "$enable_plugin_process" = "yes"; then
1099    PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= $GTK2_REQUIRED_VERSION gail >= $GAIL2_REQUIRED_VERSION)
1100 fi
1101 AC_SUBST(GTK2_CFLAGS)
1102 AC_SUBST(GTK2_LIBS)
1103
1104 GTK_DOC_CHECK([1.10])
1105
1106 # OS conditionals
1107 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
1108 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
1109 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
1110 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
1111 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
1112
1113 # target conditionals
1114 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
1115 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
1116 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
1117 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
1118
1119 # JS engine conditionals
1120 AM_CONDITIONAL([USE_JSC], [test "$with_jsengine" = "jsc"])
1121
1122 # Unicode backend conditionals
1123 AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
1124 AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
1125
1126 # Font backend conditionals
1127 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
1128 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
1129
1130 # GStreamer feature conditional
1131 AM_CONDITIONAL([USE_GSTREAMER], [test "$have_gstreamer" = "yes"])
1132
1133 # Accelerated compositing conditional
1134 AM_CONDITIONAL([USE_ACCELERATED_COMPOSITING], [test "$with_accelerated_compositing" = "cairo" || test "$with_accelerated_compositing" = "opengl" || test "$with_accelerated_compositing" = "clutter"])
1135 AM_CONDITIONAL([USE_TEXTURE_MAPPER_CAIRO], [test "$with_accelerated_compositing" = "cairo"])
1136 AM_CONDITIONAL([USE_TEXTURE_MAPPER_GL], [test "$with_accelerated_compositing" = "opengl"])
1137 AM_CONDITIONAL([USE_CLUTTER], [test "$with_accelerated_compositing" = "clutter"])
1138
1139 # WebKit feature conditionals
1140 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug_features" = "yes"])
1141 AM_CONDITIONAL([ENABLE_3D_RENDERING],[test "$enable_3d_rendering" = "yes"])
1142 AM_CONDITIONAL([ENABLE_WEBGL],[test "$enable_webgl" = "yes"])
1143 AM_CONDITIONAL([ENABLE_BLOB],[test "$enable_blob" = "yes"])
1144 AM_CONDITIONAL([ENABLE_METER_TAG],[test "$enable_meter_tag" = "yes"])
1145 AM_CONDITIONAL([ENABLE_MICRODATA],[test "$enable_microdata" = "yes"])
1146 AM_CONDITIONAL([ENABLE_PAGE_VISIBILITY_API],[test "$enable_page_visibility_api" = "yes"])
1147 AM_CONDITIONAL([ENABLE_PROGRESS_TAG],[test "$enable_progress_tag" = "yes"])
1148 AM_CONDITIONAL([ENABLE_CHANNEL_MESSAGING],[test "$enable_channel_messaging" = "yes"])
1149 AM_CONDITIONAL([ENABLE_JAVASCRIPT_DEBUGGER],[test "$enable_javascript_debugger" = "yes"])
1150 AM_CONDITIONAL([ENABLE_GAMEPAD],[test "$enable_gamepad" = "yes"])
1151 AM_CONDITIONAL([ENABLE_DIRECTORY_UPLOAD],[test "$enable_directory_upload" = "yes"])
1152 AM_CONDITIONAL([ENABLE_DATAGRID],[test "$enable_datagrid" = "yes"])
1153 AM_CONDITIONAL([ENABLE_DATA_TRANSFER_ITEMS],[test "$enable_data_transfer_items" = "yes"])
1154 AM_CONDITIONAL([ENABLE_SQL_DATABASE],[test "$enable_sql_database" = "yes"])
1155 AM_CONDITIONAL([ENABLE_DATALIST],[test "$enable_datalist" = "yes"])
1156 AM_CONDITIONAL([ENABLE_DETAILS],[test "$enable_details" = "yes"])
1157 AM_CONDITIONAL([ENABLE_FAST_MOBILE_SCROLLING],[test "$enable_fast_mobile_scrolling" = "yes"])
1158 AM_CONDITIONAL([ENABLE_FILE_SYSTEM],[test "$enable_file_system" = "yes"])
1159 AM_CONDITIONAL([ENABLE_STYLE_SCOPED],[test "$enable_style_scoped" = "yes"])
1160 AM_CONDITIONAL([ENABLE_QUOTA],[test "$enable_quota" = "yes"])
1161 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
1162 AM_CONDITIONAL([ENABLE_IMAGE_RESIZER],[test "$enable_image_resizer" = "yes"])
1163 AM_CONDITIONAL([ENABLE_INDEXED_DATABASE],[test "$enable_indexed_database" = "yes"])
1164 AM_CONDITIONAL([ENABLE_INPUT_COLOR],[test "$enable_input_color" = "yes"])
1165 AM_CONDITIONAL([ENABLE_INPUT_SPEECH],[test "$enable_input_speech" = "yes"])
1166 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
1167 AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"])
1168 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
1169 AM_CONDITIONAL([ENABLE_MATHML], [test "$enable_mathml" = "yes"])
1170 AM_CONDITIONAL([ENABLE_MHTML], [test "$enable_mhtml" = "yes"])
1171 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
1172 AM_CONDITIONAL([ENABLE_MEDIA_SOURCE],[test "$enable_media_source" = "yes"])
1173 AM_CONDITIONAL([ENABLE_MEDIA_STATISTICS],[test "$enable_media_statistics" = "yes"])
1174 AM_CONDITIONAL([ENABLE_VIDEO_TRACK],[test "$enable_video_track" = "yes"])
1175 AM_CONDITIONAL([ENABLE_FULLSCREEN_API],[test "$enable_fullscreen_api" = "yes"])
1176 AM_CONDITIONAL([ENABLE_MEDIA_STREAM],[test "$enable_media_stream" = "yes"])
1177 AM_CONDITIONAL([ENABLE_NOTIFICATIONS],[test "$enable_notifications" = "yes"])
1178 AM_CONDITIONAL([ENABLE_ORIENTATION_EVENTS],[test "$enable_orientation_events" = "yes"])
1179 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
1180 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
1181 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
1182 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
1183 AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_workers" = "yes"])
1184 AM_CONDITIONAL([ENABLE_SHARED_WORKERS],[test "$enable_shared_workers" = "yes"])
1185 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
1186 AM_CONDITIONAL([HTML_FLAGS],[test "$html_flags" = "yes"])
1187 AM_CONDITIONAL([ENABLE_WEB_SOCKETS],[test "$enable_web_sockets" = "yes"])
1188 AM_CONDITIONAL([ENABLE_WEB_AUDIO],[test "$enable_web_audio" = "yes"])
1189 AM_CONDITIONAL([ENABLE_WEB_TIMING],[test "$enable_web_timing" = "yes"])
1190 AM_CONDITIONAL([ENABLE_OPCODE_STATS],[test "$enable_opcode_stats" = "yes"])
1191 AM_CONDITIONAL([ENABLE_WEBKIT2],[test "$enable_webkit2" = "yes"])
1192 AM_CONDITIONAL([ENABLE_PLUGIN_PROCESS],[test "$enable_plugin_process" = "yes"])
1193 AM_CONDITIONAL([ENABLE_SPELLCHECK],[test "$enable_spellcheck" = "yes"])
1194 AM_CONDITIONAL([ENABLE_ANIMATION_API],[test "$enable_animation_api" = "yes"])
1195 AM_CONDITIONAL([ENABLE_REQUEST_ANIMATION_FRAME],[test "$enable_request_animation_frame" = "yes"])
1196 AM_CONDITIONAL([ENABLE_TOUCH_ICON_LOADING],[test "$enable_touch_icon_loading" = "yes"])
1197 AM_CONDITIONAL([ENABLE_REGISTER_PROTOCOL_HANDLER],[test "$enable_register_protocol_handler" = "yes"])
1198 AM_CONDITIONAL([ENABLE_DEVICE_ORIENTATION],[test "$enable_device_orientation" = "yes"])
1199 AM_CONDITIONAL([ENABLE_MUTATION_OBSERVERS],[test "$enable_mutation_observers" = "yes"])
1200
1201 # Gtk conditionals
1202 AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
1203
1204 AC_CONFIG_FILES([
1205 GNUmakefile
1206 ])
1207  
1208
1209 AC_CONFIG_FILES([
1210 Source/WebKit/gtk/webkit/webkitversion.h
1211 ])
1212
1213 AC_CONFIG_FILES([
1214 Source/WebKit/gtk/${WEBKITGTK_PC_NAME}-${WEBKITGTK_API_VERSION}.pc:Source/WebKit/gtk/webkit.pc.in
1215 Source/WebKit/gtk/JSCore-${WEBKITGTK_API_VERSION}.gir:Source/WebKit/gtk/JSCore.gir.in
1216 Source/WebKit/gtk/org.webkitgtk-${WEBKITGTK_API_VERSION}.gschema.xml:Source/WebKit/gtk/org.webkitgtk.gschema.xml.in
1217 Source/JavaScriptCore/javascriptcoregtk-${WEBKITGTK_API_VERSION}.pc:Source/JavaScriptCore/javascriptcoregtk.pc.in
1218 ]
1219 ,[WEBKITGTK_API_VERSION=$WEBKITGTK_API_VERSION,WEBKITGTK_PC_NAME=$WEBKITGTK_PC_NAME]
1220 )
1221
1222
1223 if test "$enable_webkit2" = "yes"; then
1224     AC_CONFIG_FILES([
1225     Source/WebKit2/webkit2gtk-${WEBKITGTK_API_VERSION}.pc:Source/WebKit2/webkit2gtk.pc.in
1226     ]
1227     ,[WEBKITGTK_API_VERSION=$WEBKITGTK_API_VERSION,WEBKITGTK_PC_NAME=$WEBKITGTK_PC_NAME]
1228     )
1229 fi
1230
1231 AC_OUTPUT
1232
1233 echo "
1234 WebKit was configured with the following options:
1235
1236 Build configuration:
1237  Enable debugging (slow)                                  : $enable_debug
1238  Compile with debug symbols (slow)                        : $enable_debug_symbols
1239  Enable debug features (slow)                             : $enable_debug_features
1240  Enable GCC build optimization                            : $enable_optimizations
1241  Code coverage support                                    : $enable_coverage
1242  Unicode backend                                          : $with_unicode_backend
1243  Font backend                                             : $with_font_backend
1244  Optimized memory allocator                               : $enable_fast_malloc
1245  JavaScript Engine                                        : $with_jsengine
1246  Accelerated Compositing                                  : $with_accelerated_compositing
1247
1248 Features:
1249  3D Rendering                                             : $enable_3d_rendering
1250  WebGL                                                    : $enable_webgl
1251  Blob support                                             : $enable_blob
1252  DOM mutation observer support                            : $enable_mutation_observers
1253  DeviceOrientation support                                : $enable_device_orientation
1254  Directory upload                                         : $enable_directory_upload
1255  Fast Mobile Scrolling                                    : $enable_fast_mobile_scrolling
1256  JIT compilation                                          : $enable_jit
1257  Filters support                                          : $enable_filters
1258  Geolocation support                                      : $enable_geolocation
1259  JavaScript debugger/profiler support                     : $enable_javascript_debugger
1260  Gamepad support                                          : $enable_gamepad
1261  MathML support                                           : $enable_mathml
1262  Media source                                             : $enable_media_source
1263  Media statistics                                         : $enable_media_statistics
1264  HTML5 channel messaging support                          : $enable_channel_messaging
1265  HTML5 meter element support                              : $enable_meter_tag
1266  HTML5 microdata support                                  : $enable_microdata
1267  Page Visibility API support                              : $enable_page_visibility_api
1268  HTML5 progress element support                           : $enable_progress_tag
1269  HTML5 client-side session and persistent storage support : $enable_dom_storage
1270  SQL client-side database storage support                 : $enable_sql_database
1271  HTML5 datagrid support                                   : $enable_datagrid
1272  HTML5 data transfer items support                        : $enable_data_transfer_items
1273  HTML5 FileSystem API support                             : $enable_file_system
1274  Quota API support                                        : $enable_quota
1275  HTML5 sandboxed iframe support                           : $enable_sandbox
1276  HTML5 video element support                              : $enable_video
1277  HTML5 track element support                              : $enable_video_track
1278  Fullscreen API support                                   : $enable_fullscreen_api
1279  Media stream support                                     : $enable_media_stream
1280  Icon database support                                    : $enable_icon_database
1281  Image resizer support                                    : $enable_image_resizer
1282  Link prefetch support                                    : $enable_link_prefetch
1283  Opcode stats                                             : $enable_opcode_stats
1284  SharedWorkers support                                    : $enable_shared_workers
1285  Color input support                                      : $enable_input_color
1286  Speech input support                                     : $enable_input_speech
1287  SVG support                                              : $enable_svg
1288  SVG fonts support                                        : $enable_svg_fonts
1289  Web Audio support                                        : $enable_web_audio
1290  Web Sockets support                                      : $enable_web_sockets
1291  Web Timing support                                       : $enable_web_timing
1292  Web Workers support                                      : $enable_workers
1293  XSLT support                                             : $enable_xslt
1294  Spellcheck support                                       : $enable_spellcheck
1295  Animation API                                            : $enable_animation_api
1296  RequestAnimationFrame support                            : $enable_request_animation_frame
1297  Touch Icon Loading support                               : $enable_touch_icon_loading
1298  Register Protocol Handler support                        : $enable_register_protocol_handler
1299  WebKit2 support                                          : $enable_webkit2
1300  WebKit2 plugin process                                   : $enable_plugin_process
1301
1302 GTK+ configuration:
1303  GTK+ version                                             : $with_gtk
1304  GDK target                                               : $with_target
1305  Hildon UI extensions                                     : $with_hildon
1306  Introspection support                                    : $enable_introspection
1307  Generate documentation                                   : $enable_gtk_doc
1308 "
1309 if test "$with_unicode_backend" = "glib"; then
1310    echo "     >> WARNING: the glib-based unicode backend is slow and incomplete <<"
1311    echo
1312    echo
1313 fi