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