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