2009-08-18 Xan Lopez <xlopez@igalia.com>
[WebKit-https.git] / configure.ac
1 AC_PREREQ(2.59)
2
3 m4_define([webkit_major_version], [1])
4 m4_define([webkit_minor_version], [1])
5 m4_define([webkit_micro_version], [12])
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 WebCore/Configurations/Version.xcconfig
11 m4_define([webkit_user_agent_major_version], [531])
12 m4_define([webkit_user_agent_minor_version], [2])
13
14 AC_INIT([WebKit],[webkit_major_version.webkit_minor_version.webkit_micro_version],[http://bugs.webkit.org/])
15
16 AC_CONFIG_MACRO_DIR([autotools])
17 AC_CONFIG_AUX_DIR([autotools])
18 AC_SUBST(ACLOCAL_AMFLAGS, "-I 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([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#Libtool-versioning
38 LIBWEBKITGTK_VERSION=10:1:8
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 # pthread (not needed on Windows)
103 if test "$os_win32" = "no"; then
104 AC_CHECK_HEADERS([pthread.h],
105                  AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exists]),
106                  AC_MSG_ERROR([pthread support is required to build WebKit]))
107 fi
108
109 # check for libjpeg the way Gtk does it.
110 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
111                    jpeg_ok=yes, jpeg_ok=no
112                    AC_MSG_ERROR([JPEG library (libjpeg) not found]))
113 if test "$jpeg_ok" = yes; then
114    AC_MSG_CHECKING([for jpeglib])
115    AC_TRY_CPP(
116 [#include <stdio.h>
117 #undef PACKAGE
118 #undef VERSION
119 #undef HAVE_STDLIB_H
120 #include <jpeglib.h>],
121          jpeg_ok=yes,
122          jpeg_ok=no)
123    AC_MSG_RESULT($jpeg_ok)
124    if test "$jpeg_ok" = yes; then
125       JPEG_LIBS="-ljpeg"
126       # should we check for progressive JPEG like GTK+ as well?
127    else
128       AC_MSG_ERROR([JPEG library (libjpeg) not found])
129    fi
130 fi
131 AC_SUBST([JPEG_LIBS])
132
133 # Check for libpng the way Gtk+ does it
134 AC_MSG_CHECKING(for libpng12)
135 if $PKG_CONFIG --exists libpng12 ; then
136     AC_MSG_RESULT(yes)
137     PNG_LIBS=`$PKG_CONFIG --libs libpng12`
138 else
139   AC_MSG_RESULT(no)
140   AC_CHECK_LIB(png, png_read_info,
141     [AC_CHECK_HEADER(png.h,
142       png_ok=yes,
143       png_ok=no)],
144     AC_MSG_ERROR([PNG library (libpng) not found]), -lz -lm)
145   if test "$png_ok" = yes; then
146     AC_MSG_CHECKING([for png_structp in png.h])
147     AC_TRY_COMPILE([#include <png.h>],
148       [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
149       png_ok=yes,
150       png_ok=no)
151     AC_MSG_RESULT($png_ok)
152     if test "$png_ok" = yes; then
153       PNG_LIBS='-lpng -lz'
154     else
155       AC_MSG_ERROR([PNG library (libpng) not found])
156     fi
157   else
158    AC_MSG_ERROR([PNG library (libpng) not found])
159   fi
160 fi
161 AC_SUBST([PNG_LIBS])
162
163 # determine the GDK/GTK+ target
164 AC_MSG_CHECKING([the target windowing system])
165 AC_ARG_WITH(target,
166             AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@],
167                            [Select webkit target [default=x11]]),
168             [],[with_target="x11"])
169
170 case "$with_target" in
171      x11|win32|quartz|directfb) ;;
172      *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
173 esac
174
175 AC_MSG_RESULT([$with_target])
176
177 AC_MSG_CHECKING([for Hildon UI extensions])
178 AC_ARG_WITH(hildon,
179             AC_HELP_STRING([--with-hildon],
180                            [Use Hildon UI extensions [default=no]]),
181             [],[with_hildon="no"])
182 AC_MSG_RESULT([$with_hildon])
183
184 if test "$with_hildon" = "yes"; then
185     HILDON_CPPFLAGS="-DMAEMO_CHANGES"
186     PKG_CHECK_MODULES([HILDON], [hildon-1])
187     AC_SUBST([HILDON_CPPFLAGS])
188     AC_SUBST([HILDON_CFLAGS])
189     AC_SUBST([HILDON_LIBS])
190 fi
191
192 # minimum base dependencies
193 LIBSOUP_REQUIRED_VERSION=2.27.91
194 CAIRO_REQUIRED_VERSION=1.2
195 FONTCONFIG_REQUIRED_VERSION=2.4
196 FREETYPE2_REQUIRED_VERSION=9.0
197 LIBXML_REQUIRED_VERSION=2.6
198
199 # minimum GTK+ base dependencies
200 PANGO_REQUIRED_VERSION=1.12
201 GTK_REQUIRED_VERSION=2.10
202
203 # optional modules
204 LIBXSLT_REQUIRED_VERSION=1.1.7
205 SQLITE_REQUIRED_VERSION=3.0
206 GSTREAMER_REQUIRED_VERSION=0.10
207 ENCHANT_REQUIRED_VERSION=0.22
208 GAIL_REQUIRED_VERSION=1.8
209
210 # Available modules
211 #
212 # glib - glib and includes gthread
213 # unicode - check and identify which unicode backend to use
214 #
215 # todo: webcore gtk
216 WEBKIT_CHECK_DEPENDENCIES([glib unicode])
217
218 GETTEXT_PACKAGE=$PACKAGE
219 AC_SUBST(GETTEXT_PACKAGE)
220 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
221                    [The gettext catalog name])
222
223 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED_VERSION)
224 AC_SUBST(LIBXML_CFLAGS)
225 AC_SUBST(LIBXML_LIBS)
226
227 PKG_CHECK_MODULES(PANGO, 
228                   [pango >= $PANGO_REQUIRED_VERSION
229                    pangoft2])
230 AC_SUBST(PANGO_CFLAGS)
231 AC_SUBST(PANGO_LIBS)
232
233 PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED_VERSION)
234 AC_SUBST(ENCHANT_CFLAGS)
235 AC_SUBST(ENCHANT_LIBS)
236
237 PKG_CHECK_MODULES(GAIL, gail >= $GAIL_REQUIRED_VERSION)
238 AC_SUBST(GAIL_CFLAGS)
239 AC_SUBST(GAIL_LIBS)
240
241 # check for target-specific dependencies
242 if test "$with_target" = "directfb"; then
243    PKG_CHECK_MODULES(CAIRO, cairo-directfb >= $CAIRO_REQUIRED_VERSION)
244    PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
245    AC_DEFINE([WTF_PLATFORM_DIRECTFB],[1],[Define if target is DirectFB])
246 else
247    PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED_VERSION)
248    PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION)
249
250    if test "$with_target" = "x11" && test "$os_win32" = "no"; then
251       # check for XT
252       PKG_CHECK_MODULES([XT],
253                         [xt],
254                         [xt_has_pkg_config=yes],
255                         [xt_has_pkg_config=no])
256       # some old versions of Xt do not provide xt.pc, so try to link against Xt
257       # and if it's installed fall back to just adding -lXt
258       if test "$xt_has_pkg_config" = "no"; then
259          # using AC_CHECK_LIB instead of AC_SEARCH_LIB is fine in this case as
260          # we don't care about the XtOpenDisplay symbol but only about the
261          # existence of libXt
262          AC_CHECK_LIB([Xt], [XtOpenDisplay],
263                       [XT_CFLAGS=""; XT_LIBS="-lXt"],
264                       [AC_MSG_ERROR([X Toolkit Intrinsics library (libXt) not found])])
265       fi
266       AC_SUBST([XT_CFLAGS])
267       AC_SUBST([XT_LIBS])
268       AC_DEFINE([WTF_PLATFORM_X11],[1],[Define if target is X11])
269    fi
270 fi
271 AC_SUBST(GTK_CFLAGS)
272 AC_SUBST(GTK_LIBS)
273 AC_SUBST(CAIRO_CFLAGS)
274 AC_SUBST(CAIRO_LIBS)
275
276 # check whether to build with debugging enabled
277 AC_MSG_CHECKING([whether to do a debug build])
278 AC_ARG_ENABLE(debug,
279               AC_HELP_STRING([--enable-debug],
280                              [turn on debugging [default=no]]),
281               [],[enable_debug="no"])
282 AC_MSG_RESULT([$enable_debug])
283
284 # check whether to enable optimized builds
285 AC_MSG_CHECKING([whether to enable optimized builds])
286 AC_ARG_ENABLE(optimizations,
287               AC_HELP_STRING([--enable-optimizations],
288                              [turn on optimize builds (GCC only)
289                              [default=yes]]),
290               [enable_optimizations=$enableval],
291               [if test "$enable_debug" = "yes"; then enable_optimizations="no"; else enable_optimizations="yes"; fi])
292 AC_MSG_RESULT([$enable_optimizations])
293
294 # check whether to enable dashboard support
295 AC_MSG_CHECKING([whether to enable Dashboard support])
296 AC_ARG_ENABLE(dashboard_support,
297               AC_HELP_STRING([--enable-dashboard-support],
298                              [enable Dashboard support [default=yes]]),
299               [],[enable_dashboard_support="yes"])
300 AC_MSG_RESULT([$enable_dashboard_support])
301
302 # check whether to enable 3D transforms support
303 AC_MSG_CHECKING([whether to enable support for 3D Transforms])
304 AC_ARG_ENABLE(3D_transforms,
305               AC_HELP_STRING([--enable-3D-transforms],
306                              [enable support for 3D transforms [default=no]]),
307               [],[enable_3D_transforms="no"])
308 AC_MSG_RESULT([$enable_3D_transforms])
309
310 # check whether to enable channel messaging support
311 AC_MSG_CHECKING([whether to enable HTML5 Channel Messaging support])
312 AC_ARG_ENABLE(channel_messaging,
313               AC_HELP_STRING([--enable-channel-messaging],
314                              [enable HTML5 channel messaging support [default=yes]]),
315               [],[enable_channel_messaging="yes"])
316 AC_MSG_RESULT([$enable_channel_messaging])
317
318 # check whether to enable JavaScript debugger/profiler support
319 AC_MSG_CHECKING([whether to enable JavaScript debugger/profiler support])
320 AC_ARG_ENABLE(javascript_debugger,
321               AC_HELP_STRING([--enable-javascript-debugger],
322                              [enable JavaScript debugger/profiler support [default=yes]]),
323               [],[enable_javascript_debugger="yes"])
324 AC_MSG_RESULT([$enable_javascript_debugger])
325
326 # check whether to enable HTML5 Offline Web Applications support
327 AC_MSG_CHECKING([whether to enable HTML5 offline web applications support])
328 AC_ARG_ENABLE(offline_web_applications,
329               AC_HELP_STRING([--enable-offline-web-applications],
330                              [enable HTML5 offline web applications support [default=yes]]),
331               [],[enable_offline_web_applications="yes"])
332 AC_MSG_RESULT([$enable_offline_web_applications])
333
334 # check whether to enable HTML5 client-side session and persitent storage support
335 AC_MSG_CHECKING([whether to enable HTML5 client-side session and persistent storage support])
336 AC_ARG_ENABLE(dom_storage,
337               AC_HELP_STRING([--enable-dom-storage],
338                              [enable HTML5 client-side session and persistent storage support [default=yes]]),
339               [],[enable_dom_storage="yes"])
340 AC_MSG_RESULT([$enable_dom_storage])
341
342 # check whether to build with database support
343 AC_MSG_CHECKING([whether to enable HTML5 client-side database storage support])
344 AC_ARG_ENABLE(database,
345               AC_HELP_STRING([--enable-database],
346                              [enable HTML5 client-side database storage support [default=yes]]),
347               [],[enable_database="yes"])
348 AC_MSG_RESULT([$enable_database])
349
350 # check whether to build with server-sent events support
351 AC_MSG_CHECKING([whether to enable HTML5 server-sent events support])
352 AC_ARG_ENABLE(eventsource,
353               AC_HELP_STRING([--enable-eventsource],
354                              [enable HTML5 server-sent events support [default=yes]]),
355               [],[enable_eventsource="yes"])
356 AC_MSG_RESULT([$enable_eventsource])
357
358 # check whether to build with icon database support
359 AC_MSG_CHECKING([whether to enable icon database support])
360 AC_ARG_ENABLE(icon_database,
361               AC_HELP_STRING([--enable-icon-database],
362                              [enable icon database [default=yes]]),
363               [],[enable_icon_database="yes"])
364 AC_MSG_RESULT([$enable_icon_database])
365
366 # check whether to enable HTML5 datalist support
367 AC_MSG_CHECKING([whether to enable HTML5 datalist support])
368 AC_ARG_ENABLE(datalist,
369               AC_HELP_STRING([--enable-datalist],
370                              [enable HTML5 datalist support [default=yes]]),
371               [],[enable_datalist="yes"])
372 AC_MSG_RESULT([$enable_datalist])
373
374 # check whether to enable HTML5 ruby support
375 AC_MSG_CHECKING([whether to enable HTML5 ruby support])
376 AC_ARG_ENABLE(ruby,
377               AC_HELP_STRING([--enable-ruby],
378                              [enable HTML5 ruby support [default=yes]]),
379               [],[enable_ruby="yes"])
380 AC_MSG_RESULT([$enable_ruby])
381
382 # check whether to enable HTML5 audio/video support
383 AC_MSG_CHECKING([whether to enable HTML5 video support])
384 AC_ARG_ENABLE(video,
385               AC_HELP_STRING([--enable-video],
386                              [enable HTML5 video support [default=yes]]),
387               [],[enable_video="yes"])
388 AC_MSG_RESULT([$enable_video])
389
390 # check whether to enable XPath support
391 AC_MSG_CHECKING([whether to enable XPath support])
392 AC_ARG_ENABLE(xpath,
393               AC_HELP_STRING([--enable-xpath],
394                              [enable support for XPath [default=yes]]),
395               [],[enable_xpath="yes"])
396 AC_MSG_RESULT([$enable_xpath])
397
398 # check whether to enable XSLT support
399 AC_MSG_CHECKING([whether to enable XSLT support])
400 AC_ARG_ENABLE(xslt,
401               AC_HELP_STRING([--enable-xslt],
402                              [enable support for XSLT [default=yes]]),
403               [],[enable_xslt="yes"])
404 AC_MSG_RESULT([$enable_xslt])
405
406 # check whether to enable geolocation support
407 AC_MSG_CHECKING([whether to enable geolocation support])
408 AC_ARG_ENABLE(geolocation,
409               AC_HELP_STRING([--enable-geolocation],
410                              [enable support for geolocation [default=no]]),
411               [],[enable_geolocation="no"])
412 AC_MSG_RESULT([$enable_geolocation])
413
414 # check whether to enable SVG support
415 AC_MSG_CHECKING([whether to enable SVG support])
416 AC_ARG_ENABLE(svg,
417               AC_HELP_STRING([--enable-svg],
418                              [enable support for SVG [default=yes]]),
419               [],[enable_svg="yes"])
420 AC_MSG_RESULT([$enable_svg])
421
422 # check whether to enable WML support
423 AC_MSG_CHECKING([whether to enable WML support])
424 AC_ARG_ENABLE(wml,
425               AC_HELP_STRING([--enable-wml],
426                              [enable support for WML [default=no]]),
427               [],[enable_wml="no"])
428 AC_MSG_RESULT([$enable_wml])
429
430 # check whether to enable SharedWorkers support
431 AC_MSG_CHECKING([whether to enable SharedWorkers support])
432 AC_ARG_ENABLE(shared_workers,
433               AC_HELP_STRING([--enable-shared-workers],
434                              [enable support for SharedWorkers [default=no]]),
435               [],[enable_shared_workers="no"])
436 AC_MSG_RESULT([$enable_shared_workers])
437
438 # check whether to enable Web Workers support
439 AC_MSG_CHECKING([whether to enable Web Workers support])
440 AC_ARG_ENABLE(workers,
441               AC_HELP_STRING([--enable-workers],
442                              [enable support for Web Workers [default=yes]]),
443               [],[enable_workers="yes"])
444 AC_MSG_RESULT([$enable_workers])
445
446 # turn off svg features if --disable-svg is requested
447 if test "$enable_svg" = "no"; then
448    enable_svg_animation=no
449    enable_svg_fonts=no
450    enable_svg_foreign_object=no
451    enable_svg_as_image=no
452    enable_svg_use=no
453 fi
454
455 # check whether to enable support for SVG animation
456 AC_MSG_CHECKING([whether to enable support for SVG animation])
457 AC_ARG_ENABLE(svg_animation,
458               AC_HELP_STRING([--enable-svg-animation],
459                              [enable support for SVG animation (experimental) [default=yes]]),
460               [],[enable_svg_animation="yes"])
461 AC_MSG_RESULT([$enable_svg_animation])
462
463 # check whether to enable support for filters
464 AC_MSG_CHECKING([whether to enable support for filters])
465 AC_ARG_ENABLE(filters,
466               AC_HELP_STRING([--enable-filters],
467                              [enable support for filters (experimental) [default=no]]),
468               [],[enable_filters="no"])
469 AC_MSG_RESULT([$enable_filters])
470
471 # check whether to enable support for SVG fonts
472 AC_MSG_CHECKING([whether to enable support for SVG fonts])
473 AC_ARG_ENABLE(svg_fonts,
474               AC_HELP_STRING([--enable-svg-fonts],
475                              [enable support for SVG fonts (experimental) [default=yes]]),
476               [],[enable_svg_fonts="yes"])
477 AC_MSG_RESULT([$enable_svg_fonts])
478
479 # check whether to enable foreign objects support for SVG
480 AC_MSG_CHECKING([whether to enable support for SVG foreign objects])
481 AC_ARG_ENABLE(svg_foreign_object,
482               AC_HELP_STRING([--enable-svg-foreign-object],
483                              [enable support for SVG foreign objects (experimental) [default=yes]]),
484               [],[enable_svg_foreign_object="yes"])
485 AC_MSG_RESULT([$enable_svg_foreign_object])
486
487 # check whether to enable SVG As Image support
488 AC_MSG_CHECKING([whether to enable SVG as Image support])
489 AC_ARG_ENABLE(svg_as_image,
490               AC_HELP_STRING([--enable-svg-as-image],
491                              [enable SVG as Image support (experimental) [default=yes]]),
492               [],[enable_svg_as_image="yes"])
493 AC_MSG_RESULT([$enable_svg_as_image])
494
495 # check whether to enable SVG USE element support
496 AC_MSG_CHECKING([whether to enable support for SVG use element])
497 AC_ARG_ENABLE(svg_use,
498               AC_HELP_STRING([--enable-svg-use],
499                              [enable SVG use element support (experimental) [default=yes]]),
500               [],[enable_svg_use="yes"])
501 AC_MSG_RESULT([$enable_svg_use])
502
503 # check for SVG features, enabling SVG if necessary
504 if test "$enable_svg_animation" = "yes" || \
505    test "$enable_svg_fonts" = "yes" || \
506    test "$enable_svg_foreign_object" = "yes" || \
507    test "$enable_svg_as_image" = "yes" || \
508    test "$enable_svg_use" = "yes"; then
509    svg_flags=yes
510    if test "$enable_svg" = "no"; then
511        AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
512        enable_svg=yes
513    fi
514 fi
515
516 # check whether to enable Web Socket support
517 AC_MSG_CHECKING([whether to enable Web Sockets support])
518 AC_ARG_ENABLE(web_sockets,
519               AC_HELP_STRING([--enable-web-sockets],
520                              [enable support for Web Sockets [default=yes]]),
521               [],[enable_web_sockets="no"])
522 AC_MSG_RESULT([$enable_web_sockets])
523
524 # check whether to enable code coverage
525 AC_MSG_CHECKING([whether to enable code coverage support])
526 AC_ARG_ENABLE(coverage,
527               AC_HELP_STRING([--enable-coverage],
528                              [enable code coverage support [default=no]]),
529               [],[enable_coverage="no"])
530 AC_MSG_RESULT([$enable_coverage])
531
532 # check whether to enable FastMalloc
533 AC_MSG_CHECKING([whether to enable optimized memory allocator])
534 AC_ARG_ENABLE(fast_malloc,
535               AC_HELP_STRING([--enable-fast-malloc],
536                              [enable optimized memory allocator default=yes, default=no for debug builds]),
537               [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
538 AC_MSG_RESULT([$enable_fast_malloc])
539
540 AC_MSG_CHECKING([whether to enable JIT compilation])
541 AC_ARG_ENABLE([jit],
542               AC_HELP_STRING([--enable-jit],
543                              [Enable JIT compilation default=yes]),
544               [],[enable_jit="yes"])
545 if test "$enable_jit" = "yes"; then
546     case "$host_cpu" in
547         i*86|x86_64)
548             AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
549             AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
550             AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
551             AC_DEFINE([ENABLE_JIT_OPTIMIZE_CALL], [1], [Define to enable optimizing calls])
552             AC_DEFINE([ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS], [1], [Define to enable optimized property access])
553             AC_DEFINE([ENABLE_JIT_OPTIMIZE_ARITHMETIC], [1], [Define to enable optimized arithmetic])
554             case "$host_cpu" in
555                 i*86)
556                     AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_VA_LIST], [1], [Use stub va_list])
557                 ;;
558                 x86_64)
559                     AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_REGISTER], [1], [Use stub register])
560                     AC_DEFINE([WTF_USE_ALTERNATE_JSIMMEDIATE], [1], [Use alternate JSImmediate])
561                 ;;
562             esac
563         ;;
564         *)
565             enable_jit="no (CPU '$host_cpu' not supported)"
566         ;;
567     esac
568 fi
569 AC_MSG_RESULT([$enable_jit])
570
571 # determine the font backend
572 AC_MSG_CHECKING([the font backend to use])
573 AC_ARG_WITH(font_backend,
574             AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
575                            [Select font backend [default=freetype]]),
576             [],[with_font_backend="freetype"])
577
578 case "$with_font_backend" in
579      freetype|pango) ;;
580      *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
581 esac
582 AC_MSG_RESULT([$with_font_backend])
583
584 # Add '-g' flag to gcc if it's debug build
585 if test "$enable_debug" = "yes"; then
586    CXXFLAGS="$CXXFLAGS -g"
587    CFLAGS="$CFLAGS -g"
588 else
589    AC_DEFINE([NDEBUG], [1], [Define to disable debugging features])
590 fi
591
592 # Add the appropriate 'O' level for optimized builds
593 if test "$enable_optimizations" = "yes"; then
594    CXXFLAGS="$CXXFLAGS -O2"
595    CFLAGS="$CFLAGS -O2"
596 else
597    CXXFLAGS="$CXXFLAGS -O0"
598    CFLAGS="$CFLAGS -O0"
599 fi
600
601 PKG_CHECK_MODULES([LIBSOUP],
602                   [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
603 AC_SUBST([LIBSOUP_CFLAGS])
604 AC_SUBST([LIBSOUP_LIBS])
605
606 # check if FreeType/FontConfig are available
607 if test "$with_font_backend" = "freetype"; then
608    if test "$with_target" = "directfb"; then
609    PKG_CHECK_MODULES([FREETYPE],
610                      [fontconfig >= $FONTCONFIG_REQUIRED_VERSION
611                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
612    else
613    PKG_CHECK_MODULES([FREETYPE],
614                      [cairo-ft
615                      fontconfig >= $FONTCONFIG_REQUIRED_VERSION
616                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
617    fi
618    AC_SUBST([FREETYPE_CFLAGS])
619    AC_SUBST([FREETYPE_LIBS])
620 fi
621
622 # check if sqlite 3 is available
623 if test "$enable_icon_database" = "yes" || \
624    test "$enable_database" = "yes" || \
625    test "$enable_offline_web_applications" = "yes" || \
626    test "$enable_dom_storage" = "yes"; then
627    PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
628    AC_SUBST([SQLITE3_CFLAGS])
629    AC_SUBST([SQLITE3_LIBS])
630 fi
631
632 # check if libxslt is available
633 if test "$enable_xslt" = "yes"; then
634    PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
635    AC_SUBST([LIBXSLT_CFLAGS])
636    AC_SUBST([LIBXSLT_LIBS])
637 fi
638
639 # check if geoclue is available
640 if test "$enable_geolocation" = "yes"; then
641     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
642     AC_SUBST([GEOCLUE_CFLAGS])
643     AC_SUBST([GEOCLUE_LIBS])
644 fi
645
646 # check if gstreamer is available
647 if test "$enable_video" = "yes"; then
648    PKG_CHECK_MODULES([GSTREAMER],
649                      [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
650                      gstreamer-base-0.10
651                      gstreamer-plugins-base-0.10
652                      gstreamer-video-0.10])
653    AC_SUBST([GSTREAMER_CFLAGS])
654    AC_SUBST([GSTREAMER_LIBS])
655 fi
656
657 # check for code coverage support
658 if test "$enable_coverage" = "yes"; then
659    COVERAGE_CFLAGS="-MD"
660    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
661    AC_SUBST([COVERAGE_CFLAGS])
662    AC_SUBST([COVERAGE_LDFLAGS])
663 fi
664
665 # check for HTML features
666 if test "$enable_video" = "yes"; then
667     html_flags=yes
668 fi
669
670 GTK_DOC_CHECK([1.10])
671
672 # OS conditionals
673 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
674 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
675 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
676 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
677 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
678
679 # target conditionals
680 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
681 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
682 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
683 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
684
685 # Unicode backend conditionals
686 AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
687 AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
688
689 # Font backend conditionals
690 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
691 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
692
693 # WebKit feature conditionals
694 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
695 AM_CONDITIONAL([ENABLE_DASHBOARD_SUPPORT],[test "$enable_dashboard_support" = "yes"])
696 AM_CONDITIONAL([ENABLE_3D_TRANSFORMS],[test "$enable_3D_transforms" = "yes"])
697 AM_CONDITIONAL([ENABLE_CHANNEL_MESSAGING],[test "$enable_channel_messaging" = "yes"])
698 AM_CONDITIONAL([ENABLE_JAVASCRIPT_DEBUGGER],[test "$enable_javascript_debugger" = "yes"])
699 AM_CONDITIONAL([ENABLE_OFFLINE_WEB_APPLICATIONS],[test "$enable_offline_web_applications" = "yes"])
700 AM_CONDITIONAL([ENABLE_DOM_STORAGE],[test "$enable_dom_storage" = "yes"])
701 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
702 AM_CONDITIONAL([ENABLE_DATALIST],[test "$enable_datalist" = "yes"])
703 AM_CONDITIONAL([ENABLE_EVENTSOURCE],[test "$enable_eventsource" = "yes"])
704 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
705 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
706 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
707 AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"])
708 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
709 AM_CONDITIONAL([ENABLE_RUBY],[test "$enable_ruby" = "yes"])
710 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
711 AM_CONDITIONAL([ENABLE_NOTIFICATIONS],[test "$enable_notifications" = "yes"])
712 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
713 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
714 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
715 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
716 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
717 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use" = "yes"])
718 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
719 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
720 AM_CONDITIONAL([ENABLE_WML],[test "$enable_wml" = "yes"])
721 AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_workers" = "yes"])
722 AM_CONDITIONAL([ENABLE_SHARED_WORKERS],[test "$enable_shared_workers" = "yes"])
723 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
724 AM_CONDITIONAL([HTML_FLAGS],[test "$html_flags" = "yes"])
725 AM_CONDITIONAL([ENABLE_WEB_SOCKETS],[test "$enable_web_sockets" = "yes"])
726
727 AC_CONFIG_FILES([
728 GNUmakefile
729 WebKit/gtk/webkit-1.0.pc:WebKit/gtk/webkit.pc.in
730 WebKit/gtk/webkit/webkitversion.h
731 WebKit/gtk/docs/GNUmakefile
732 WebKit/gtk/docs/version.xml
733 ]
734 )
735
736 AC_OUTPUT
737
738 echo "
739 WebKit was configured with the following options:
740
741 Build configuration:
742  Enable debugging (slow)                                  : $enable_debug
743  Enable GCC build optimization                            : $enable_optimizations
744  Code coverage support                                    : $enable_coverage
745  Unicode backend                                          : $with_unicode_backend
746  Font backend                                             : $with_font_backend
747  Optimized memory allocator                               : $enable_fast_malloc
748 Features:
749  3D Transforms                                            : $enable_3D_transforms
750  JIT compilation                                          : $enable_jit
751  Dashboard support                                        : $enable_dashboard_support
752  Filters support                                          : $enable_filters
753  Geolocation support                                      : $enable_geolocation
754  JavaScript debugger/profiler support                     : $enable_javascript_debugger
755  HTML5 offline web applications support                   : $enable_offline_web_applications
756  HTML5 channel messaging support                          : $enable_channel_messaging
757  HTML5 client-side session and persistent storage support : $enable_dom_storage
758  HTML5 client-side database storage support               : $enable_database
759  HTML5 ruby support                                       : $enable_ruby
760  HTML5 server-sent events support                         : $enable_eventsource
761  HTML5 video element support                              : $enable_video
762  Icon database support                                    : $enable_icon_database
763  SharedWorkers support                                    : $enable_shared_workers
764  SVG support                                              : $enable_svg
765  SVG animation support                                    : $enable_svg_animation
766  SVG fonts support                                        : $enable_svg_fonts
767  SVG foreign object support                               : $enable_svg_foreign_object
768  SVG as image support                                     : $enable_svg_as_image
769  SVG use element support                                  : $enable_svg_use
770  WML support                                              : $enable_wml
771  Web Sockets support                                      : $enable_web_sockets
772  Web Workers support                                      : $enable_workers
773  XPATH support                                            : $enable_xpath
774  XSLT support                                             : $enable_xslt
775 GTK+ configuration:
776  GDK target                                               : $with_target
777  Hildon UI extensions                                     : $with_hildon
778 "
779 if test "$with_unicode_backend" = "glib"; then
780    echo "     >> WARNING: the glib-based unicode backend is slow and incomplete <<"
781    echo
782    echo
783 fi