2010-06-17 Kenneth Russell <kbr@google.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], [3])
5 m4_define([webkit_micro_version], [1])
6
7 # This is the version we'll be using as part of our User-Agent string
8 # e.g., AppleWebKit/$(webkit_user_agent_version) ...
9 #
10 # Sourced from 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=20:0:18
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 for l in libpng libpng14 libpng12; do
135   AC_MSG_CHECKING(for $l)
136   if $PKG_CONFIG --exists $l ; then
137     AC_MSG_RESULT(yes)
138     PNG_LIBS=`$PKG_CONFIG --libs $l`
139     png_ok=yes
140     break
141   else
142     AC_MSG_RESULT(no)
143     png_ok=no
144   fi
145 done
146 if test "$png_ok" != yes; then
147   AC_CHECK_LIB(png, png_read_info,
148     [AC_CHECK_HEADER(png.h,
149       png_ok=yes,
150       png_ok=no)],
151     AC_MSG_ERROR([PNG library (libpng) not found]), -lz -lm)
152   if test "$png_ok" = yes; then
153     AC_MSG_CHECKING([for png_structp in png.h])
154     AC_TRY_COMPILE([#include <png.h>],
155       [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
156       png_ok=yes,
157       png_ok=no)
158     AC_MSG_RESULT($png_ok)
159     if test "$png_ok" = yes; then
160       PNG_LIBS='-lpng -lz'
161     else
162       AC_MSG_ERROR([PNG library (libpng) not found])
163     fi
164   else
165     AC_MSG_ERROR([PNG library (libpng) not found])
166   fi
167 fi
168 AC_SUBST([PNG_LIBS])
169
170 # determine the GDK/GTK+ target
171 AC_MSG_CHECKING([the target windowing system])
172 AC_ARG_WITH(target,
173             AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@],
174                            [Select webkit target [default=x11]]),
175             [],[with_target="x11"])
176
177 case "$with_target" in
178      x11|win32|quartz|directfb) ;;
179      *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
180 esac
181
182 AC_MSG_RESULT([$with_target])
183
184 AC_MSG_CHECKING([for Hildon UI extensions])
185 AC_ARG_WITH(hildon,
186             AC_HELP_STRING([--with-hildon],
187                            [Use Hildon UI extensions [default=no]]),
188             [],[with_hildon="no"])
189 AC_MSG_RESULT([$with_hildon])
190
191 if test "$with_hildon" = "yes"; then
192     HILDON_CPPFLAGS="-DMAEMO_CHANGES"
193     PKG_CHECK_MODULES([HILDON], [hildon-1])
194     AC_SUBST([HILDON_CPPFLAGS])
195     AC_SUBST([HILDON_CFLAGS])
196     AC_SUBST([HILDON_LIBS])
197 fi
198
199 # minimum base dependencies
200 LIBSOUP_REQUIRED_VERSION=2.28.2
201 CAIRO_REQUIRED_VERSION=1.6
202 FONTCONFIG_REQUIRED_VERSION=2.4
203 FREETYPE2_REQUIRED_VERSION=9.0
204 LIBXML_REQUIRED_VERSION=2.6
205
206 # minimum GTK+ base dependencies
207 PANGO_REQUIRED_VERSION=1.12
208 GTK_REQUIRED_VERSION=2.10
209
210 # optional modules
211 LIBXSLT_REQUIRED_VERSION=1.1.7
212 SQLITE_REQUIRED_VERSION=3.0
213 GSTREAMER_REQUIRED_VERSION=0.10
214 GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION=0.10.25
215 ENCHANT_REQUIRED_VERSION=0.22
216 GAIL_REQUIRED_VERSION=1.8
217
218 # Available modules
219 #
220 # glib - glib and includes gthread
221 # unicode - check and identify which unicode backend to use
222 #
223 # todo: webcore gtk
224 WEBKIT_CHECK_DEPENDENCIES([glib unicode])
225
226 GETTEXT_PACKAGE=$PACKAGE
227 AC_SUBST(GETTEXT_PACKAGE)
228 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
229                    [The gettext catalog name])
230
231 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED_VERSION)
232 AC_SUBST(LIBXML_CFLAGS)
233 AC_SUBST(LIBXML_LIBS)
234
235 PKG_CHECK_MODULES(PANGO, 
236                   [pango >= $PANGO_REQUIRED_VERSION
237                    pangoft2])
238 AC_SUBST(PANGO_CFLAGS)
239 AC_SUBST(PANGO_LIBS)
240
241 PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED_VERSION)
242 AC_SUBST(ENCHANT_CFLAGS)
243 AC_SUBST(ENCHANT_LIBS)
244
245 PKG_CHECK_MODULES(GAIL, gail >= $GAIL_REQUIRED_VERSION)
246 AC_SUBST(GAIL_CFLAGS)
247 AC_SUBST(GAIL_LIBS)
248
249 # check for target-specific dependencies
250 if test "$with_target" = "directfb"; then
251    PKG_CHECK_MODULES(CAIRO, cairo-directfb >= $CAIRO_REQUIRED_VERSION)
252    PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
253    AC_DEFINE([WTF_PLATFORM_DIRECTFB],[1],[Define if target is DirectFB])
254 else
255    PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED_VERSION)
256    PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION)
257
258    if test "$with_target" = "x11" && test "$os_win32" = "no"; then
259       # check for XT
260       PKG_CHECK_MODULES([XT],
261                         [xt],
262                         [xt_has_pkg_config=yes],
263                         [xt_has_pkg_config=no])
264       # some old versions of Xt do not provide xt.pc, so try to link against Xt
265       # and if it's installed fall back to just adding -lXt
266       if test "$xt_has_pkg_config" = "no"; then
267          # using AC_CHECK_LIB instead of AC_SEARCH_LIB is fine in this case as
268          # we don't care about the XtOpenDisplay symbol but only about the
269          # existence of libXt
270          AC_CHECK_LIB([Xt], [XtOpenDisplay],
271                       [XT_CFLAGS=""; XT_LIBS="-lXt"],
272                       [AC_MSG_ERROR([X Toolkit Intrinsics library (libXt) not found])])
273       fi
274       AC_SUBST([XT_CFLAGS])
275       AC_SUBST([XT_LIBS])
276       AC_DEFINE([WTF_PLATFORM_X11],[1],[Define if target is X11])
277    fi
278 fi
279 AC_SUBST(GTK_CFLAGS)
280 AC_SUBST(GTK_LIBS)
281 AC_SUBST(CAIRO_CFLAGS)
282 AC_SUBST(CAIRO_LIBS)
283
284 # check whether to build with debugging enabled
285 AC_MSG_CHECKING([whether to do a debug build])
286 AC_ARG_ENABLE(debug,
287               AC_HELP_STRING([--enable-debug],
288                              [turn on debugging [default=no]]),
289               [],[enable_debug="no"])
290 AC_MSG_RESULT([$enable_debug])
291
292 # check whether to enable optimized builds
293 AC_MSG_CHECKING([whether to enable optimized builds])
294 AC_ARG_ENABLE(optimizations,
295               AC_HELP_STRING([--enable-optimizations],
296                              [turn on optimize builds (GCC only)
297                              [default=yes]]),
298               [enable_optimizations=$enableval],
299               [if test "$enable_debug" = "yes"; then enable_optimizations="no"; else enable_optimizations="yes"; fi])
300 AC_MSG_RESULT([$enable_optimizations])
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 enable the indexed database API
343 AC_MSG_CHECKING([whether to enable the indexed database API])
344 AC_ARG_ENABLE(indexed_database,
345               AC_HELP_STRING([--enable-indexeddb],
346                              [enable the indexed database API [default=no]]),
347               [],[enable_indexed_database="no"])
348 AC_MSG_RESULT([$enable_indexed_database])
349
350 # check whether to build with database support
351 AC_MSG_CHECKING([whether to enable HTML5 client-side database storage support])
352 AC_ARG_ENABLE(database,
353               AC_HELP_STRING([--enable-database],
354                              [enable HTML5 client-side database storage support [default=yes]]),
355               [],[enable_database="yes"])
356 AC_MSG_RESULT([$enable_database])
357
358 # check whether to build with server-sent events support
359 AC_MSG_CHECKING([whether to enable HTML5 server-sent events support])
360 AC_ARG_ENABLE(eventsource,
361               AC_HELP_STRING([--enable-eventsource],
362                              [enable HTML5 server-sent events support [default=yes]]),
363               [],[enable_eventsource="yes"])
364 AC_MSG_RESULT([$enable_eventsource])
365
366 # check whether to build with icon database support
367 AC_MSG_CHECKING([whether to enable icon database support])
368 AC_ARG_ENABLE(icon_database,
369               AC_HELP_STRING([--enable-icon-database],
370                              [enable icon database [default=yes]]),
371               [],[enable_icon_database="yes"])
372 AC_MSG_RESULT([$enable_icon_database])
373
374 # check whether to build with image resizer API support
375 AC_MSG_CHECKING([whether to enable image resizer API support])
376 AC_ARG_ENABLE(image_resizer,
377               AC_HELP_STRING([--enable-image-resizer],
378                              [enable image resizer [default=no]]),
379               [],[enable_image_resizer="no"])
380 AC_MSG_RESULT([$enable_image_resizer])
381
382 # check whether to enable HTML5 datalist support
383 AC_MSG_CHECKING([whether to enable HTML5 datalist support])
384 AC_ARG_ENABLE(datalist,
385               AC_HELP_STRING([--enable-datalist],
386                              [enable HTML5 datalist support [default=yes]]),
387               [],[enable_datalist="yes"])
388 AC_MSG_RESULT([$enable_datalist])
389
390 # check whether to enable HTML5 ruby support
391 AC_MSG_CHECKING([whether to enable HTML5 ruby support])
392 AC_ARG_ENABLE(ruby,
393               AC_HELP_STRING([--enable-ruby],
394                              [enable HTML5 ruby support [default=yes]]),
395               [],[enable_ruby="yes"])
396 AC_MSG_RESULT([$enable_ruby])
397
398 # check whether to enable HTML5 sandbox iframe support
399 AC_MSG_CHECKING([whether to enable HTML5 sandboxed iframe support])
400 AC_ARG_ENABLE(sandbox,
401               AC_HELP_STRING([--enable-sandbox],
402                              [enable HTML5 sandboxed iframe support [default=yes]]),
403               [],[enable_sandbox="yes"])
404 AC_MSG_RESULT([$enable_sandbox])
405
406 # check whether to enable HTML5 audio/video support
407 AC_MSG_CHECKING([whether to enable HTML5 video support])
408 AC_ARG_ENABLE(video,
409               AC_HELP_STRING([--enable-video],
410                              [enable HTML5 video support [default=yes]]),
411               [],[enable_video="yes"])
412 AC_MSG_RESULT([$enable_video])
413
414 # check whether to enable XHTML-MP support
415 AC_MSG_CHECKING([whether to enable XHTML-MP support])
416 AC_ARG_ENABLE(xhtmlmp,
417               AC_HELP_STRING([--enable-xhtmlmp],
418                              [enable support for XHTML-MP [default=no]]),
419               [],[enable_xhtmlmp="no"])
420 AC_MSG_RESULT([$enable_xhtmlmp])
421
422 # check whether to enable XPath support
423 AC_MSG_CHECKING([whether to enable XPath support])
424 AC_ARG_ENABLE(xpath,
425               AC_HELP_STRING([--enable-xpath],
426                              [enable support for XPath [default=yes]]),
427               [],[enable_xpath="yes"])
428 AC_MSG_RESULT([$enable_xpath])
429
430 # check whether to enable XSLT support
431 AC_MSG_CHECKING([whether to enable XSLT support])
432 AC_ARG_ENABLE(xslt,
433               AC_HELP_STRING([--enable-xslt],
434                              [enable support for XSLT [default=yes]]),
435               [],[enable_xslt="yes"])
436 AC_MSG_RESULT([$enable_xslt])
437
438 # check whether to enable geolocation support
439 AC_MSG_CHECKING([whether to enable geolocation support])
440 AC_ARG_ENABLE(geolocation,
441               AC_HELP_STRING([--enable-geolocation],
442                              [enable support for geolocation [default=no]]),
443               [],[enable_geolocation="no"])
444 AC_MSG_RESULT([$enable_geolocation])
445
446 # check whether to enable MathML support
447 AC_MSG_CHECKING([whether to enable MathML support])
448 AC_ARG_ENABLE(mathml,
449               AC_HELP_STRING([--enable-mathml],
450                              [enable support for MathML [default=no]]),
451               [],[enable_mathml="no"])
452 AC_MSG_RESULT([$enable_mathml])
453
454 # check whether to enable SVG support
455 AC_MSG_CHECKING([whether to enable SVG support])
456 AC_ARG_ENABLE(svg,
457               AC_HELP_STRING([--enable-svg],
458                              [enable support for SVG [default=yes]]),
459               [],[enable_svg="yes"])
460 AC_MSG_RESULT([$enable_svg])
461
462 # check whether to enable WML support
463 AC_MSG_CHECKING([whether to enable WML support])
464 AC_ARG_ENABLE(wml,
465               AC_HELP_STRING([--enable-wml],
466                              [enable support for WML [default=no]]),
467               [],[enable_wml="no"])
468 AC_MSG_RESULT([$enable_wml])
469
470 # check whether to enable SharedWorkers support
471 AC_MSG_CHECKING([whether to enable SharedWorkers support])
472 AC_ARG_ENABLE(shared_workers,
473               AC_HELP_STRING([--enable-shared-workers],
474                              [enable support for SharedWorkers [default=yes]]),
475               [],[enable_shared_workers="yes"])
476 AC_MSG_RESULT([$enable_shared_workers])
477
478 # check whether to enable Web Workers support
479 AC_MSG_CHECKING([whether to enable Web Workers support])
480 AC_ARG_ENABLE(workers,
481               AC_HELP_STRING([--enable-workers],
482                              [enable support for Web Workers [default=yes]]),
483               [],[enable_workers="yes"])
484 AC_MSG_RESULT([$enable_workers])
485
486 # turn off svg features if --disable-svg is requested
487 if test "$enable_svg" = "no"; then
488    enable_svg_animation=no
489    enable_svg_fonts=no
490    enable_svg_foreign_object=no
491    enable_svg_as_image=no
492    enable_svg_use=no
493 fi
494
495 # check whether to enable support for SVG animation
496 AC_MSG_CHECKING([whether to enable support for SVG animation])
497 AC_ARG_ENABLE(svg_animation,
498               AC_HELP_STRING([--enable-svg-animation],
499                              [enable support for SVG animation (experimental) [default=yes]]),
500               [],[enable_svg_animation="yes"])
501 AC_MSG_RESULT([$enable_svg_animation])
502
503 # check whether to enable support for filters
504 AC_MSG_CHECKING([whether to enable support for filters])
505 AC_ARG_ENABLE(filters,
506               AC_HELP_STRING([--enable-filters],
507                              [enable support for filters (experimental) [default=yes]]),
508               [],[enable_filters="yes"])
509 AC_MSG_RESULT([$enable_filters])
510
511 # check whether to enable support for SVG fonts
512 AC_MSG_CHECKING([whether to enable support for SVG fonts])
513 AC_ARG_ENABLE(svg_fonts,
514               AC_HELP_STRING([--enable-svg-fonts],
515                              [enable support for SVG fonts (experimental) [default=yes]]),
516               [],[enable_svg_fonts="yes"])
517 AC_MSG_RESULT([$enable_svg_fonts])
518
519 # check whether to enable foreign objects support for SVG
520 AC_MSG_CHECKING([whether to enable support for SVG foreign objects])
521 AC_ARG_ENABLE(svg_foreign_object,
522               AC_HELP_STRING([--enable-svg-foreign-object],
523                              [enable support for SVG foreign objects (experimental) [default=yes]]),
524               [],[enable_svg_foreign_object="yes"])
525 AC_MSG_RESULT([$enable_svg_foreign_object])
526
527 # check whether to enable SVG As Image support
528 AC_MSG_CHECKING([whether to enable SVG as Image support])
529 AC_ARG_ENABLE(svg_as_image,
530               AC_HELP_STRING([--enable-svg-as-image],
531                              [enable SVG as Image support (experimental) [default=yes]]),
532               [],[enable_svg_as_image="yes"])
533 AC_MSG_RESULT([$enable_svg_as_image])
534
535 # check whether to enable SVG USE element support
536 AC_MSG_CHECKING([whether to enable support for SVG use element])
537 AC_ARG_ENABLE(svg_use,
538               AC_HELP_STRING([--enable-svg-use],
539                              [enable SVG use element support (experimental) [default=yes]]),
540               [],[enable_svg_use="yes"])
541 AC_MSG_RESULT([$enable_svg_use])
542
543 # check for SVG features, enabling SVG if necessary
544 if test "$enable_svg_animation" = "yes" || \
545    test "$enable_svg_fonts" = "yes" || \
546    test "$enable_svg_foreign_object" = "yes" || \
547    test "$enable_svg_as_image" = "yes" || \
548    test "$enable_svg_use" = "yes"; then
549    svg_flags=yes
550    if test "$enable_svg" = "no"; then
551        AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
552        enable_svg=yes
553    fi
554 fi
555
556 # check whether to enable Web Socket support
557 AC_MSG_CHECKING([whether to enable Web Sockets support])
558 AC_ARG_ENABLE(web_sockets,
559               AC_HELP_STRING([--enable-web-sockets],
560                              [enable support for Web Sockets [default=no]]),
561               [],[enable_web_sockets="no"])
562 AC_MSG_RESULT([$enable_web_sockets])
563
564 # check whether to enable Blob.slice support
565 AC_MSG_CHECKING([whether to enable Blob.slice support])
566 AC_ARG_ENABLE(blob_slice,
567               AC_HELP_STRING([--enable-blob-slice],
568                              [enable support for Blob.slice [default=no]]),
569               [],[enable_blob_slice="no"])
570 AC_MSG_RESULT([$enable_blob_slice])
571
572 # check whether to enable Fast Mobile Scrolling support
573 AC_MSG_CHECKING([whether to enable Fast Mobile Scrolling])
574 AC_ARG_ENABLE(fast_mobile_scrolling,
575               AC_HELP_STRING([--enable-fast-mobile-scrolling],
576                              [enable support for Fast Mobile Scrolling [default=no]]),
577               [],[enable_fast_mobile_scrolling="no"])
578 AC_MSG_RESULT([$enable_fast_mobile_scrolling])
579
580 # check whether to enable FileReader support
581 AC_MSG_CHECKING([whether to enable FileReader support])
582 AC_ARG_ENABLE(file_reader,
583               AC_HELP_STRING([--enable-file-reader],
584                              [enable support for FileReader [default=no]]),
585               [],[enable_file_reader="no"])
586 AC_MSG_RESULT([$enable_file_reader])
587
588 # check whether to enable FileWriter support
589 AC_MSG_CHECKING([whether to enable FileWriter support])
590 AC_ARG_ENABLE(file_writer,
591               AC_HELP_STRING([--enable-file-writer],
592                              [enable support for FileWriter [default=no]]),
593               [],[enable_file_writer="no"])
594 AC_MSG_RESULT([$enable_file_writer])
595
596 # check whether to enable code coverage
597 AC_MSG_CHECKING([whether to enable code coverage support])
598 AC_ARG_ENABLE(coverage,
599               AC_HELP_STRING([--enable-coverage],
600                              [enable code coverage support [default=no]]),
601               [],[enable_coverage="no"])
602 AC_MSG_RESULT([$enable_coverage])
603
604 # check whether to enable FastMalloc
605 AC_MSG_CHECKING([whether to enable optimized memory allocator])
606 AC_ARG_ENABLE(fast_malloc,
607               AC_HELP_STRING([--enable-fast-malloc],
608                              [enable optimized memory allocator default=yes, default=no for debug builds]),
609               [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
610 AC_MSG_RESULT([$enable_fast_malloc])
611
612 AC_MSG_CHECKING([whether to enable JIT compilation])
613 AC_ARG_ENABLE([jit],
614               AC_HELP_STRING([--enable-jit],
615                              [Enable JIT compilation default=yes]),
616               [],[enable_jit="yes"])
617 if test "$enable_jit" = "yes"; then
618     case "$host_cpu" in
619         i*86|x86_64)
620             AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
621             AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
622             AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
623             AC_DEFINE([ENABLE_JIT_OPTIMIZE_CALL], [1], [Define to enable optimizing calls])
624             AC_DEFINE([ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS], [1], [Define to enable optimized property access])
625             AC_DEFINE([ENABLE_JIT_OPTIMIZE_ARITHMETIC], [1], [Define to enable optimized arithmetic])
626             case "$host_cpu" in
627                 i*86)
628                     AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_VA_LIST], [1], [Use stub va_list])
629                 ;;
630                 x86_64)
631                     AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_REGISTER], [1], [Use stub register])
632                     AC_DEFINE([WTF_USE_ALTERNATE_JSIMMEDIATE], [1], [Use alternate JSImmediate])
633                 ;;
634             esac
635         ;;
636         *)
637             enable_jit="no (CPU '$host_cpu' not supported)"
638         ;;
639     esac
640 fi
641 AC_MSG_RESULT([$enable_jit])
642
643 # GObject Introspection
644 AC_MSG_CHECKING([whether to enable GObject introspection support])
645 AC_ARG_ENABLE([introspection],
646   [AS_HELP_STRING([--enable-introspection],[Enable GObject introspection (default: disabled)])],
647   [],[enable_introspection=no])
648 AC_MSG_RESULT([$enable_introspection])
649
650 G_IR_SCANNER=
651 G_IR_COMPILER=
652 G_IR_GENERATE=
653 GIRDIR=
654 GIRTYPELIBDIR=
655
656 if test "$enable_introspection" = "yes"; then
657   GOBJECT_INTROSPECTION_REQUIRED=0.6.2
658   PKG_CHECK_MODULES([INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
659   
660   G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
661   G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
662   G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
663   AC_DEFINE([ENABLE_INTROSPECTION],[1],[Define to enable GObject introspection support])
664 fi
665
666 AC_SUBST([G_IR_SCANNER])
667 AC_SUBST([G_IR_COMPILER])
668 AC_SUBST([G_IR_GENERATE])
669
670 # determine the font backend
671 AC_MSG_CHECKING([the font backend to use])
672 AC_ARG_WITH(font_backend,
673             AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
674                            [Select font backend [default=freetype]]),
675             [],[with_font_backend="freetype"])
676
677 case "$with_font_backend" in
678      freetype|pango) ;;
679      *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
680 esac
681 AC_MSG_RESULT([$with_font_backend])
682
683 # Add '-g' flag to gcc if it's debug build
684 if test "$enable_debug" = "yes"; then
685    CXXFLAGS="$CXXFLAGS -g"
686    CFLAGS="$CFLAGS -g"
687 else
688    AC_DEFINE([NDEBUG], [1], [Define to disable debugging features])
689 fi
690
691 # Add the appropriate 'O' level for optimized builds
692 if test "$enable_optimizations" = "yes"; then
693    CXXFLAGS="$CXXFLAGS -O2"
694    CFLAGS="$CFLAGS -O2"
695 else
696    CXXFLAGS="$CXXFLAGS -O0"
697    CFLAGS="$CFLAGS -O0"
698 fi
699
700 PKG_CHECK_MODULES([LIBSOUP],
701                   [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
702 AC_SUBST([LIBSOUP_CFLAGS])
703 AC_SUBST([LIBSOUP_LIBS])
704
705 # check if we can use libSoup 2.29.90 features
706 PKG_CHECK_MODULES([LIBSOUP_2_29_90],
707                   [libsoup-2.4 >= 2.29.90],
708                   [have_libsoup_2_29_90=yes],
709                   [have_libsoup_2_29_90=no])
710 if test "$have_libsoup_2_29_90" = "yes"; then
711    AC_DEFINE([HAVE_LIBSOUP_2_29_90], 1, [Whether libSoup 2.29.90 features are available])
712 fi
713
714 # check if FreeType/FontConfig are available
715 if test "$with_font_backend" = "freetype"; then
716    if test "$with_target" = "directfb"; then
717    PKG_CHECK_MODULES([FREETYPE],
718                      [fontconfig >= $FONTCONFIG_REQUIRED_VERSION
719                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
720    else
721    PKG_CHECK_MODULES([FREETYPE],
722                      [cairo-ft
723                      fontconfig >= $FONTCONFIG_REQUIRED_VERSION
724                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
725    fi
726    AC_SUBST([FREETYPE_CFLAGS])
727    AC_SUBST([FREETYPE_LIBS])
728 fi
729
730 # check if sqlite 3 is available
731 if test "$enable_icon_database" = "yes" || \
732    test "$enable_database" = "yes" || \
733    test "$enable_offline_web_applications" = "yes" || \
734    test "$enable_dom_storage" = "yes"; then
735    PKG_CHECK_MODULES([SQLITE3],
736                      [sqlite3 >= $SQLITE_REQUIRED_VERSION],
737                      [sqlite3_has_pkg_config=yes],
738                      [sqlite3_has_pkg_config=no])
739    if test "$sqlite3_has_pkg_config" = "no"; then
740       AC_SEARCH_LIBS([sqlite3_open16], [sqlite3],
741                      [SQLITE3_LIBS="$LIBS";SQLITE3_CFLAGS="-I $srcdir/WebKitLibraries/WebCoreSQLite3"],
742                      [AC_MSG_ERROR([SQLite3 is required to enable Database support])])
743    fi
744    AC_SUBST([SQLITE3_CFLAGS])
745    AC_SUBST([SQLITE3_LIBS])
746 fi
747
748 # check if libxslt is available
749 if test "$enable_xslt" = "yes"; then
750    PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
751    AC_SUBST([LIBXSLT_CFLAGS])
752    AC_SUBST([LIBXSLT_LIBS])
753 fi
754
755 # check if geoclue is available
756 if test "$enable_geolocation" = "yes"; then
757     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
758     AC_SUBST([GEOCLUE_CFLAGS])
759     AC_SUBST([GEOCLUE_LIBS])
760 fi
761
762 # check if gstreamer is available
763 if test "$enable_video" = "yes"; then
764    PKG_CHECK_MODULES([GSTREAMER],
765                      [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
766                      gstreamer-app-0.10
767                      gstreamer-base-0.10
768                      gstreamer-pbutils-0.10
769                      gstreamer-plugins-base-0.10 >= $GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION
770                      gstreamer-video-0.10])
771    AC_SUBST([GSTREAMER_CFLAGS])
772    AC_SUBST([GSTREAMER_LIBS])
773 fi
774
775 # check for code coverage support
776 if test "$enable_coverage" = "yes"; then
777    COVERAGE_CFLAGS="-MD"
778    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
779    AC_SUBST([COVERAGE_CFLAGS])
780    AC_SUBST([COVERAGE_LDFLAGS])
781 fi
782
783 # check for HTML features
784 if test "$enable_video" = "yes"; then
785     html_flags=yes
786 fi
787
788 GTK_DOC_CHECK([1.10])
789
790 # OS conditionals
791 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
792 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
793 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
794 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
795 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
796
797 # target conditionals
798 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
799 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
800 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
801 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
802
803 # Unicode backend conditionals
804 AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
805 AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
806
807 # Font backend conditionals
808 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
809 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
810
811 # WebKit feature conditionals
812 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
813 AM_CONDITIONAL([ENABLE_3D_TRANSFORMS],[test "$enable_3D_transforms" = "yes"])
814 AM_CONDITIONAL([ENABLE_BLOB_SLICE],[test "$enable_blob_slice" = "yes"])
815 AM_CONDITIONAL([ENABLE_CHANNEL_MESSAGING],[test "$enable_channel_messaging" = "yes"])
816 AM_CONDITIONAL([ENABLE_JAVASCRIPT_DEBUGGER],[test "$enable_javascript_debugger" = "yes"])
817 AM_CONDITIONAL([ENABLE_OFFLINE_WEB_APPLICATIONS],[test "$enable_offline_web_applications" = "yes"])
818 AM_CONDITIONAL([ENABLE_DOM_STORAGE],[test "$enable_dom_storage" = "yes"])
819 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
820 AM_CONDITIONAL([ENABLE_DATALIST],[test "$enable_datalist" = "yes"])
821 AM_CONDITIONAL([ENABLE_EVENTSOURCE],[test "$enable_eventsource" = "yes"])
822 AM_CONDITIONAL([ENABLE_FAST_MOBILE_SCROLLING],[test "$enable_fast_mobile_scrolling" = "yes"])
823 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
824 AM_CONDITIONAL([ENABLE_IMAGE_RESIZER],[test "$enable_image_resizer" = "yes"])
825 AM_CONDITIONAL([ENABLE_INDEXED_DATABASE],[test "$enable_indexed_database" = "yes"])
826 AM_CONDITIONAL([ENABLE_XHTMLMP],[test "$enable_xhtmlmp" = "yes"])
827 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
828 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
829 AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"])
830 AM_CONDITIONAL([ENABLE_FILE_READER],[test "$enable_file_reader" = "yes"])
831 AM_CONDITIONAL([ENABLE_FILE_WRITER],[test "$enable_file_writer" = "yes"])
832 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
833 AM_CONDITIONAL([ENABLE_MATHML], [test "$enable_mathml" = "yes"])
834 AM_CONDITIONAL([ENABLE_RUBY],[test "$enable_ruby" = "yes"])
835 AM_CONDITIONAL([ENABLE_SANDBOX],[test "$enable_sandbox" = "yes"])
836 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
837 AM_CONDITIONAL([ENABLE_NOTIFICATIONS],[test "$enable_notifications" = "yes"])
838 AM_CONDITIONAL([ENABLE_ORIENTATION_EVENTS],[test "$enable_orientation_events" = "yes"])
839 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
840 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
841 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
842 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
843 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
844 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use" = "yes"])
845 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
846 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
847 AM_CONDITIONAL([ENABLE_WML],[test "$enable_wml" = "yes"])
848 AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_workers" = "yes"])
849 AM_CONDITIONAL([ENABLE_SHARED_WORKERS],[test "$enable_shared_workers" = "yes"])
850 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
851 AM_CONDITIONAL([HTML_FLAGS],[test "$html_flags" = "yes"])
852 AM_CONDITIONAL([ENABLE_WEB_SOCKETS],[test "$enable_web_sockets" = "yes"])
853
854 # Gtk conditionals
855 AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
856
857
858 AC_CONFIG_FILES([
859 GNUmakefile
860 WebKit/gtk/webkit-1.0.pc:WebKit/gtk/webkit.pc.in
861 WebKit/gtk/webkit/webkitversion.h
862 WebKit/gtk/docs/GNUmakefile
863 WebKit/gtk/docs/version.xml
864 ]
865 )
866
867 AC_OUTPUT
868
869 echo "
870 WebKit was configured with the following options:
871
872 Build configuration:
873  Enable debugging (slow)                                  : $enable_debug
874  Enable GCC build optimization                            : $enable_optimizations
875  Code coverage support                                    : $enable_coverage
876  Unicode backend                                          : $with_unicode_backend
877  Font backend                                             : $with_font_backend
878  Optimized memory allocator                               : $enable_fast_malloc
879 Features:
880  3D Transforms                                            : $enable_3D_transforms
881  Blob.slice support                                       : $enable_blob_slice
882  Fast Mobile Scrolling                                    : $enable_fast_mobile_scrolling
883  JIT compilation                                          : $enable_jit
884  Filters support                                          : $enable_filters
885  FileReader support                                       : $enable_file_reader
886  FileWriter support                                       : $enable_file_writer
887  Geolocation support                                      : $enable_geolocation
888  JavaScript debugger/profiler support                     : $enable_javascript_debugger
889  MathML support                                           : $enable_mathml
890  HTML5 offline web applications support                   : $enable_offline_web_applications
891  HTML5 channel messaging support                          : $enable_channel_messaging
892  HTML5 client-side session and persistent storage support : $enable_dom_storage
893  HTML5 client-side database storage support               : $enable_database
894  HTML5 ruby support                                       : $enable_ruby
895  HTML5 sandboxed iframe support                           : $enable_sandbox
896  HTML5 server-sent events support                         : $enable_eventsource
897  HTML5 video element support                              : $enable_video
898  Icon database support                                    : $enable_icon_database
899  Image resizer support                                    : $enable_image_resizer
900  SharedWorkers support                                    : $enable_shared_workers
901  SVG support                                              : $enable_svg
902  SVG animation support                                    : $enable_svg_animation
903  SVG fonts support                                        : $enable_svg_fonts
904  SVG foreign object support                               : $enable_svg_foreign_object
905  SVG as image support                                     : $enable_svg_as_image
906  SVG use element support                                  : $enable_svg_use
907  WML support                                              : $enable_wml
908  Web Sockets support                                      : $enable_web_sockets
909  Web Workers support                                      : $enable_workers
910  XHTML-MP support                                         : $enable_xhtmlmp
911  XPATH support                                            : $enable_xpath
912  XSLT support                                             : $enable_xslt
913 GTK+ configuration:
914  GDK target                                               : $with_target
915  Hildon UI extensions                                     : $with_hildon
916  Introspection support                                    : $enable_introspection
917 "
918 if test "$with_unicode_backend" = "glib"; then
919    echo "     >> WARNING: the glib-based unicode backend is slow and incomplete <<"
920    echo
921    echo
922 fi