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