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