2009-04-30 Dimitri Glazkov <dglazkov@chromium.org>
[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], [6])
6
7 AC_INIT([WebKit],[webkit_major_version.webkit_minor_version.webkit_micro_version],[http://bugs.webkit.org/])
8
9 AC_CONFIG_MACRO_DIR([autotools])
10 AC_CONFIG_AUX_DIR([autotools])
11 AC_SUBST(ACLOCAL_AMFLAGS, "-I autotools")
12
13 AC_CONFIG_HEADERS([autotoolsconfig.h])
14 AC_CANONICAL_SYSTEM
15
16 WEBKIT_MAJOR_VERSION=webkit_major_version
17 WEBKIT_MINOR_VERSION=webkit_minor_version
18 WEBKIT_MICRO_VERSION=webkit_micro_version
19 AC_SUBST(WEBKIT_MAJOR_VERSION)
20 AC_SUBST(WEBKIT_MINOR_VERSION)
21 AC_SUBST(WEBKIT_MICRO_VERSION)
22
23 AC_CONFIG_SRCDIR([WebCore/config.h])
24
25 dnl # Libtool library version, not to confuse with API version
26 dnl # see http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html#Libtool-versioning
27 LIBWEBKITGTK_VERSION=6:0:4
28 AC_SUBST([LIBWEBKITGTK_VERSION])
29
30 AM_INIT_AUTOMAKE([foreign subdir-objects tar-ustar])
31
32 # host checking - inspired by the GTK+ configure.in
33 # TODO: move these to webkit.m4?
34 AC_MSG_CHECKING([for native Win32])
35 case "$host" in
36      *-*-mingw*)
37        os_win32=yes
38        ;;
39      *)
40        os_win32=no
41        ;;
42 esac
43 AC_MSG_RESULT([$os_win32])
44
45 case "$host" in
46      *-*-linux*)
47        os_linux=yes
48        ;;
49      *-*-freebsd*)
50        os_freebsd=yes
51        ;;
52      *-*-darwin*)
53        os_darwin=yes
54        ;;
55 esac
56
57 case "$host_os" in
58      gnu* | linux* | k*bsd*-gnu)
59        os_gnu=yes
60        ;;
61      *)
62        os_gnu=no
63        ;;
64 esac
65
66 # initialize webkit options
67 WEBKIT_INIT
68 AC_DISABLE_STATIC
69 AC_LIBTOOL_WIN32_DLL
70 AC_PROG_LIBTOOL
71 # use dolt to speedup the build
72 DOLT
73
74 AC_PATH_PROG(FLEX, flex)
75 if test -z "$FLEX"; then
76    AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
77 else
78    FLEX_VERSION=`$FLEX --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
79    AX_COMPARE_VERSION([2.5.33],[gt],[$FLEX_VERSION],
80       AC_MSG_WARN([You need at least version 2.5.33 of the 'flex' lexer generator to compile WebKit correctly]))
81 fi
82
83 AC_PATH_PROG(GPERF, gperf)
84 if test -z "$GPERF"; then
85    AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
86 fi
87
88 # pthread (not needed on Windows)
89 if test "$os_win32" = "no"; then
90 AC_CHECK_HEADERS([pthread.h],
91                  AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exists]),
92                  AC_MSG_ERROR([pthread support is required to build WebKit]))
93 fi
94
95 # check for libjpeg the way Gtk does it.
96 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
97                    jpeg_ok=yes, jpeg_ok=no
98                    AC_MSG_ERROR([JPEG library (libjpeg) not found]))
99 if test "$jpeg_ok" = yes; then
100    AC_MSG_CHECKING([for jpeglib])
101    AC_TRY_CPP(
102 [#include <stdio.h>
103 #undef PACKAGE
104 #undef VERSION
105 #undef HAVE_STDLIB_H
106 #include <jpeglib.h>],
107          jpeg_ok=yes,
108          jpeg_ok=no)
109    AC_MSG_RESULT($jpeg_ok)
110    if test "$jpeg_ok" = yes; then
111       JPEG_LIBS="-ljpeg"
112       # should we check for progressive JPEG like GTK+ as well?
113    else
114       AC_MSG_ERROR([JPEG library (libjpeg) not found])
115    fi
116 fi
117 AC_SUBST([JPEG_LIBS])
118
119 # Check for libpng the way Gtk+ does it
120 AC_MSG_CHECKING(for libpng12)
121 if $PKG_CONFIG --exists libpng12 ; then
122     AC_MSG_RESULT(yes)
123     PNG_LIBS=`$PKG_CONFIG --libs libpng12`
124 else
125   AC_MSG_RESULT(no)
126   AC_CHECK_LIB(png, png_read_info,
127     [AC_CHECK_HEADER(png.h,
128       png_ok=yes,
129       png_ok=no)],
130     AC_MSG_ERROR([PNG library (libpng) not found]), -lz -lm)
131   if test "$png_ok" = yes; then
132     AC_MSG_CHECKING([for png_structp in png.h])
133     AC_TRY_COMPILE([#include <png.h>],
134       [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
135       png_ok=yes,
136       png_ok=no)
137     AC_MSG_RESULT($png_ok)
138     if test "$png_ok" = yes; then
139       PNG_LIBS='-lpng -lz'
140     else
141       AC_MSG_ERROR([PNG library (libpng) not found])
142     fi
143   else
144    AC_MSG_ERROR([PNG library (libpng) not found])
145   fi
146 fi
147 AC_SUBST([PNG_LIBS])
148
149 # determine the GDK/GTK+ target
150 AC_MSG_CHECKING([the target windowing system])
151 AC_ARG_WITH(target,
152             AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@],
153                            [Select webkit target [default=x11]]),
154             [],[with_target="x11"])
155
156 case "$with_target" in
157      x11|win32|quartz|directfb) ;;
158      *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
159 esac
160
161 AC_MSG_RESULT([$with_target])
162
163 AC_MSG_CHECKING([for Hildon UI extensions])
164 AC_ARG_WITH(hildon,
165             AC_HELP_STRING([--with-hildon],
166                            [Use Hildon UI extensions [default=no]]),
167             [],[with_hildon="no"])
168 AC_MSG_RESULT([$with_hildon])
169
170 if test "$with_hildon" = "yes"; then
171     HILDON_CPPFLAGS="-DMAEMO_CHANGES"
172     PKG_CHECK_MODULES([HILDON], [hildon-1])
173     AC_SUBST([HILDON_CPPFLAGS])
174     AC_SUBST([HILDON_CFLAGS])
175     AC_SUBST([HILDON_LIBS])
176 fi
177
178 # minimum base dependencies
179 CAIRO_REQUIRED_VERSION=1.2
180 FONTCONFIG_REQUIRED_VERSION=2.4
181 FREETYPE2_REQUIRED_VERSION=9.0
182 LIBXML_REQUIRED_VERSION=2.6
183
184 # minimum GTK+ base dependencies
185 PANGO_REQUIRED_VERSION=1.0
186 GTK_REQUIRED_VERSION=2.10
187
188 # optional modules
189 LIBSOUP_REQUIRED_VERSION=2.25.91
190 LIBXSLT_REQUIRED_VERSION=1.1.7
191 SQLITE_REQUIRED_VERSION=3.0
192 GSTREAMER_REQUIRED_VERSION=0.10
193 GNOME_KEYRING_REQUIRED_VERSION=2.26.0
194 ENCHANT_REQUIRED_VERSION=0.22
195
196 # Available modules
197 #
198 # glib - glib and includes gthread
199 # unicode - check and identify which unicode backend to use
200 #
201 # todo: webcore gtk
202 WEBKIT_CHECK_DEPENDENCIES([glib unicode])
203
204 GETTEXT_PACKAGE=$PACKAGE
205 AC_SUBST(GETTEXT_PACKAGE)
206 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
207                    [The gettext catalog name])
208
209 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED_VERSION)
210 AC_SUBST(LIBXML_CFLAGS)
211 AC_SUBST(LIBXML_LIBS)
212
213 PKG_CHECK_MODULES(PANGO, 
214                   [pango >= $PANGO_REQUIRED_VERSION
215                    pangoft2])
216 AC_SUBST(PANGO_CFLAGS)
217 AC_SUBST(PANGO_LIBS)
218
219 # check for target-specific dependencies
220 if test "$with_target" = "directfb"; then
221    PKG_CHECK_MODULES(CAIRO, cairo-directfb >= $CAIRO_REQUIRED_VERSION)
222    PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
223    AC_DEFINE([WTF_PLATFORM_DIRECTFB],[1],[Define if target is DirectFB])
224 else
225    PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED_VERSION)
226    PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION)
227    PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED_VERSION)
228
229    if test "$with_target" = "x11" && test "$os_win32" = "no"; then
230       # check for XT
231       PKG_CHECK_MODULES([XT],
232                         [xt],
233                         [xt_has_pkg_config=yes],
234                         [xt_has_pkg_config=no])
235       # some old versions of Xt do not provide xt.pc, so try to link against Xt
236       # and if it's installed fall back to just adding -lXt
237       if test "$xt_has_pkg_config" = "no"; then
238          # using AC_CHECK_LIB instead of AC_SEARCH_LIB is fine in this case as
239          # we don't care about the XtOpenDisplay symbol but only about the
240          # existence of libXt
241          AC_CHECK_LIB([Xt], [XtOpenDisplay],
242                       [XT_CFLAGS=""; XT_LIBS="-lXt"],
243                       [AC_MSG_ERROR([X Toolkit Intrinsics library (libXt) not found])])
244       fi
245       AC_SUBST([XT_CFLAGS])
246       AC_SUBST([XT_LIBS])
247       AC_DEFINE([WTF_PLATFORM_X11],[1],[Define if target is X11])
248    fi
249 fi
250 AC_SUBST(GTK_CFLAGS)
251 AC_SUBST(GTK_LIBS)
252 AC_SUBST(CAIRO_CFLAGS)
253 AC_SUBST(CAIRO_LIBS)
254 AC_SUBST(ENCHANT_CFLAGS)
255 AC_SUBST(ENCHANT_LIBS)
256
257 # check whether to build with debugging enabled
258 AC_MSG_CHECKING([whether to do a debug build])
259 AC_ARG_ENABLE(debug,
260               AC_HELP_STRING([--enable-debug],
261                              [turn on debugging [default=no]]),
262               [],[enable_debug="no"])
263 AC_MSG_RESULT([$enable_debug])
264
265 # check whether to enable optimized builds
266 AC_MSG_CHECKING([whether to enable optimized builds])
267 AC_ARG_ENABLE(optimizations,
268               AC_HELP_STRING([--enable-optimizations],
269                              [turn on optimize builds (GCC only)
270                              [default=yes]]),
271               [enable_optimizations=$enableval],
272               [if test "$enable_debug" = "yes"; then enable_optimizations="no"; else enable_optimizations="yes"; fi])
273 AC_MSG_RESULT([$enable_optimizations])
274
275 # check whether to enable dashboard support
276 AC_MSG_CHECKING([whether to enable Dashboard support])
277 AC_ARG_ENABLE(dashboard_support,
278               AC_HELP_STRING([--enable-dashboard-support],
279                              [enable Dashboard support [default=yes]]),
280               [],[enable_dashboard_support="yes"])
281 AC_MSG_RESULT([$enable_dashboard_support])
282
283 # check whether to enable 3D transforms support
284 AC_MSG_CHECKING([whether to enable support for 3D Transforms])
285 AC_ARG_ENABLE(3D_transforms,
286               AC_HELP_STRING([--enable-3D-transforms],
287                              [enable support for 3D transforms [default=no]]),
288               [],[enable_3D_transforms="no"])
289 AC_MSG_RESULT([$enable_3D_transforms])
290
291 # check whether to enable channel messaging support
292 AC_MSG_CHECKING([whether to enable HTML5 Channel Messaging support])
293 AC_ARG_ENABLE(channel_messaging,
294               AC_HELP_STRING([--enable-channel-messaging],
295                              [enable HTML5 channel messaging support [default=no]]),
296               [],[enable_channel_messaging="no"])
297 AC_MSG_RESULT([$enable_channel_messaging])
298
299 # check whether to enable JavaScript debugger/profiler support
300 AC_MSG_CHECKING([whether to enable JavaScript debugger/profiler support])
301 AC_ARG_ENABLE(javascript_debugger,
302               AC_HELP_STRING([--enable-javascript-debugger],
303                              [enable JavaScript debugger/profiler support [default=yes]]),
304               [],[javascript_debugger="yes"])
305 AC_MSG_RESULT([$enable_javascript_debugger])
306
307 # check whether to enable HTML5 Offline Web Applications support
308 AC_MSG_CHECKING([whether to enable HTML5 offline web applications support])
309 AC_ARG_ENABLE(offline_web_applications,
310               AC_HELP_STRING([--enable-offline-web-applications],
311                              [enable HTML5 offline web applications support [default=yes]]),
312               [],[enable_offline_web_applications="yes"])
313 AC_MSG_RESULT([$enable_offline_web_applications])
314
315 # check whether to enable HTML5 client-side session and persitent storage support
316 AC_MSG_CHECKING([whether to enable HTML5 client-side session and persistent storage support])
317 AC_ARG_ENABLE(dom_storage,
318               AC_HELP_STRING([--enable-dom-storage],
319                              [enable HTML5 client-side session and persistent storage support [default=yes]]),
320               [],[enable_dom_storage="yes"])
321 AC_MSG_RESULT([$enable_dom_storage])
322
323 # check whether to build with database support
324 AC_MSG_CHECKING([whether to enable HTML5 client-side database storage support])
325 AC_ARG_ENABLE(database,
326               AC_HELP_STRING([--enable-database],
327                              [enable HTML5 client-side database storage support [default=yes]]),
328               [],[enable_database="yes"])
329 AC_MSG_RESULT([$enable_database])
330
331 # check whether to build with icon database support
332 AC_MSG_CHECKING([whether to enable icon database support])
333 AC_ARG_ENABLE(icon_database,
334               AC_HELP_STRING([--enable-icon-database],
335                              [enable icon database [default=yes]]),
336               [],[enable_icon_database="yes"])
337 AC_MSG_RESULT([$enable_icon_database])
338
339 # check whether to enable HTML5 audio/video support
340 AC_MSG_CHECKING([whether to enable HTML5 video support])
341 AC_ARG_ENABLE(video,
342               AC_HELP_STRING([--enable-video],
343                              [enable HTML5 video support [default=yes]]),
344               [],[enable_video="yes"])
345 AC_MSG_RESULT([$enable_video])
346
347 # check whether to enable XPath support
348 AC_MSG_CHECKING([whether to enable XPath support])
349 AC_ARG_ENABLE(xpath,
350               AC_HELP_STRING([--enable-xpath],
351                              [enable support for XPath [default=yes]]),
352               [],[enable_xpath="yes"])
353 AC_MSG_RESULT([$enable_xpath])
354
355 # check whether to enable XSLT support
356 AC_MSG_CHECKING([whether to enable XSLT support])
357 AC_ARG_ENABLE(xslt,
358               AC_HELP_STRING([--enable-xslt],
359                              [enable support for XSLT [default=yes]]),
360               [],[enable_xslt="yes"])
361 AC_MSG_RESULT([$enable_xslt])
362
363 # check whether to enable geolocation support
364 AC_MSG_CHECKING([whether to enable geolocation support])
365 AC_ARG_ENABLE(geolocation,
366               AC_HELP_STRING([--enable-geolocation],
367                              [enable support for geolocation [default=no]]),
368               [],[enable_geolocation="no"])
369 AC_MSG_RESULT([$enable_geolocation])
370
371 # check whether to enable gnomekeyring support
372 AC_MSG_CHECKING([whether to enable gnomekeyring support])
373 AC_ARG_ENABLE(gnomekeyring,
374               AC_HELP_STRING([--enable-gnomekeyring],
375                              [enable support for gnomekeyring [default=no]]),
376               [],[enable_gnomekeyring="no"])
377 AC_MSG_RESULT([$enable_gnomekeyring])
378
379 # check whether to enable SVG support
380 AC_MSG_CHECKING([whether to enable SVG support])
381 AC_ARG_ENABLE(svg,
382               AC_HELP_STRING([--enable-svg],
383                              [enable support for SVG [default=yes]]),
384               [],[enable_svg="yes"])
385 AC_MSG_RESULT([$enable_svg])
386
387 # check whether to enable WML support
388 AC_MSG_CHECKING([whether to enable WML support])
389 AC_ARG_ENABLE(wml,
390               AC_HELP_STRING([--enable-wml],
391                              [enable support for WML [default=no]]),
392               [],[enable_wml="no"])
393 AC_MSG_RESULT([$enable_wml])
394
395 # check whether to enable Web Workers support
396 AC_MSG_CHECKING([whether to enable Web Workers support])
397 AC_ARG_ENABLE(web_workers,
398               AC_HELP_STRING([--enable-web-workers],
399                              [enable support for Web Workers [default=yes]]),
400               [],[enable_web_workers="yes"])
401 AC_MSG_RESULT([$enable_web_workers])
402
403 # turn off svg features if --disable-svg is requested
404 if test "$enable_svg" = "no"; then
405    enable_svg_animation=no
406    enable_svg_filters=no
407    enable_svg_fonts=no
408    enable_svg_foreign_object=no
409    enable_svg_as_image=no
410    enable_svg_use_element=no
411 fi
412
413 # check whether to enable support for SVG animation
414 AC_MSG_CHECKING([whether to enable support for SVG animation])
415 AC_ARG_ENABLE(svg_animation,
416               AC_HELP_STRING([--enable-svg-animation],
417                              [enable support for SVG animation (experimental) [default=yes]]),
418               [],[enable_svg_animation="yes"])
419 AC_MSG_RESULT([$enable_svg_animation])
420
421 # check whether to enable support for SVG filters
422 AC_MSG_CHECKING([whether to enable support for SVG filters])
423 AC_ARG_ENABLE(svg_filters,
424               AC_HELP_STRING([--enable-svg-filters],
425                              [enable support for SVG filters (experimental) [default=no]]),
426               [],[enable_svg_filters="no"])
427 AC_MSG_RESULT([$enable_svg_filters])
428
429 # check whether to enable support for SVG fonts
430 AC_MSG_CHECKING([whether to enable support for SVG fonts])
431 AC_ARG_ENABLE(svg_fonts,
432               AC_HELP_STRING([--enable-svg-fonts],
433                              [enable support for SVG fonts (experimental) [default=yes]]),
434               [],[enable_svg_fonts="yes"])
435 AC_MSG_RESULT([$enable_svg_fonts])
436
437 # check whether to enable foreign objects support for SVG
438 AC_MSG_CHECKING([whether to enable support for SVG foreign objects])
439 AC_ARG_ENABLE(svg_foreign_object,
440               AC_HELP_STRING([--enable-svg-foreign-object],
441                              [enable support for SVG foreign objects (experimental) [default=yes]]),
442               [],[enable_svg_foreign_object="yes"])
443 AC_MSG_RESULT([$enable_svg_foreign_object])
444
445 # check whether to enable SVG As Image support
446 AC_MSG_CHECKING([whether to enable SVG as Image support])
447 AC_ARG_ENABLE(svg_as_image,
448               AC_HELP_STRING([--enable-svg-as-image],
449                              [enable SVG as Image support (experimental) [default=yes]]),
450               [],[enable_svg_as_image="yes"])
451 AC_MSG_RESULT([$enable_svg_as_image])
452
453 # check whether to enable SVG USE element support
454 AC_MSG_CHECKING([whether to enable support for SVG use element])
455 AC_ARG_ENABLE(svg_use_element,
456               AC_HELP_STRING([--enable-svg-use-element],
457                              [enable SVG use element support (experimental) [default=yes]]),
458               [],[enable_svg_use_element="yes"])
459 AC_MSG_RESULT([$enable_svg_use_element])
460
461 # check for SVG features, enabling SVG if necessary
462 if test "$enable_svg_animation" = "yes" || \
463    test "$enable_svg_filters" = "yes" || \
464    test "$enable_svg_fonts" = "yes" || \
465    test "$enable_svg_foreign_object" = "yes" || \
466    test "$enable_svg_as_image" = "yes" || \
467    test "$enable_svg_use_element" = "yes"; then
468    svg_flags=yes
469    if test "$enable_svg" = "no"; then
470        AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
471        enable_svg=yes
472    fi
473 fi
474
475 # check whether to enable code coverage
476 AC_MSG_CHECKING([whether to enable code coverage support])
477 AC_ARG_ENABLE(coverage,
478               AC_HELP_STRING([--enable-coverage],
479                              [enable code coverage support [default=no]]),
480               [],[enable_coverage="no"])
481 AC_MSG_RESULT([$enable_coverage])
482
483 # check whether to enable FastMalloc
484 AC_MSG_CHECKING([whether to enable optimized memory allocator])
485 AC_ARG_ENABLE(fast_malloc,
486               AC_HELP_STRING([--enable-fast-malloc],
487                              [enable optimized memory allocator default=yes, default=no for debug builds]),
488               [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
489 AC_MSG_RESULT([$enable_fast_malloc])
490
491 AC_MSG_CHECKING([whether to enable JIT compilation])
492 AC_ARG_ENABLE([jit],
493               AC_HELP_STRING([--enable-jit],
494                              [Enable JIT compilation default=yes]),
495               [],[enable_jit="yes"])
496 if test "$enable_jit" = "yes"; then
497     case "$target_cpu" in
498         i*86)
499             AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
500             AC_DEFINE([ENABLE_WREC], [1], [Define to enable WREC])
501             AC_DEFINE([ENABLE_JIT_OPTIMIZE_CALL], [1], [Define to enable optimizing calls])
502             AC_DEFINE([ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS], [1], [Define to enable optimized property access])
503             AC_DEFINE([ENABLE_JIT_OPTIMIZE_ARITHMETIC], [1], [Define to enable optimized arithmetic])
504             AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_VA_LIST], [1], [Use stub va_list])
505         ;;
506         *)
507             enable_jit="no (CPU '$target_cpu' not supported)"
508         ;;
509     esac
510 fi
511 AC_MSG_RESULT([$enable_jit])
512
513 # determine the font backend
514 AC_MSG_CHECKING([the font backend to use])
515 AC_ARG_WITH(font_backend,
516             AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
517                            [Select font backend [default=freetype]]),
518             [],[with_font_backend="freetype"])
519
520 case "$with_font_backend" in
521      freetype|pango) ;;
522      *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
523 esac
524 AC_MSG_RESULT([$with_font_backend])
525
526 # Add '-g' flag to gcc if it's debug build
527 if test "$enable_debug" = "yes"; then
528    CXXFLAGS="$CXXFLAGS -g"
529    CFLAGS="$CFLAGS -g"
530 else
531    AC_DEFINE([NDEBUG], [1], [Define to disable debugging features])
532 fi
533
534 # Add the appropriate 'O' level for optimized builds
535 if test "$enable_optimizations" = "yes"; then
536    CXXFLAGS="$CXXFLAGS -O2"
537    CFLAGS="$CFLAGS -O2"
538 else
539    CXXFLAGS="$CXXFLAGS -O0"
540    CFLAGS="$CFLAGS -O0"
541 fi
542
543 PKG_CHECK_MODULES([LIBSOUP],
544                   [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
545 AC_SUBST([LIBSOUP_CFLAGS])
546 AC_SUBST([LIBSOUP_LIBS])
547
548 if test "$enable_gnomekeyring" = "yes"; then
549    PKG_CHECK_MODULES([GNOMEKEYRING],
550                      [gnome-keyring-1 >= $GNOME_KEYRING_REQUIRED_VERSION])
551    AC_SUBST([GNOMEKEYRING_CFLAGS])
552    AC_SUBST([GNOMEKEYRING_LIBS])
553 fi
554
555 # check if FreeType/FontConfig are available
556 if test "$with_font_backend" = "freetype"; then
557    if test "$with_target" = "directfb"; then
558    PKG_CHECK_MODULES([FREETYPE],
559                      [fontconfig >= $FONTCONFIG_REQUIRED_VERSION
560                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
561    else
562    PKG_CHECK_MODULES([FREETYPE],
563                      [cairo-ft
564                      fontconfig >= $FONTCONFIG_REQUIRED_VERSION
565                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
566    fi
567    AC_SUBST([FREETYPE_CFLAGS])
568    AC_SUBST([FREETYPE_LIBS])
569 fi
570
571 # check if sqlite 3 is available
572 if test "$enable_icon_database" = "yes" || \
573    test "$enable_database" = "yes" || \
574    test "$enable_offline_web_applications" = "yes" || \
575    test "$enable_dom_storage" = "yes"; then
576    PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
577    AC_SUBST([SQLITE3_CFLAGS])
578    AC_SUBST([SQLITE3_LIBS])
579 fi
580
581 # check if libxslt is available
582 if test "$enable_xslt" = "yes"; then
583    PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
584    AC_SUBST([LIBXSLT_CFLAGS])
585    AC_SUBST([LIBXSLT_LIBS])
586 fi
587
588 # check if geoclue is available
589 if test "$enable_geolocation" = "yes"; then
590     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
591     AC_SUBST([GEOCLUE_CFLAGS])
592     AC_SUBST([GEOCLUE_LIBS])
593 fi
594
595 # check if gstreamer is available
596 if test "$enable_video" = "yes"; then
597    PKG_CHECK_MODULES([GSTREAMER],
598                      [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
599                      gstreamer-base-0.10,
600                      gstreamer-plugins-base-0.10])
601    AC_SUBST([GSTREAMER_CFLAGS])
602    AC_SUBST([GSTREAMER_LIBS])
603 fi
604
605 # check for code coverage support
606 if test "$enable_coverage" = "yes"; then
607    COVERAGE_CFLAGS="-MD"
608    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
609    AC_SUBST([COVERAGE_CFLAGS])
610    AC_SUBST([COVERAGE_LDFLAGS])
611 fi
612
613 # check for HTML features
614 if test "$enable_video" = "yes"; then
615     html_flags=yes
616 fi
617
618 GTK_DOC_CHECK([1.10])
619
620 # OS conditionals
621 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
622 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
623 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
624 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
625 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
626
627 # target conditionals
628 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
629 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
630 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
631 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
632
633 # Auth backend conditionals
634 AM_CONDITIONAL([USE_GNOMEKEYRING], [test "$enable_gnomekeyring" = "yes"])
635
636 # Font backend conditionals
637 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
638 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
639
640 # WebKit feature conditionals
641 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
642 AM_CONDITIONAL([ENABLE_DASHBOARD_SUPPORT],[test "$enable_dashboard_support" = "yes"])
643 AM_CONDITIONAL([ENABLE_3D_TRANSFORMS],[test "$enable_3D_transforms" = "yes"])
644 AM_CONDITIONAL([ENABLE_CHANNEL_MESSAGING],[test "$enable_channel_messaging" = "yes"])
645 AM_CONDITIONAL([ENABLE_JAVASCRIPT_DEBUGGER],[test "$enable_javascript_debugger" = "yes"])
646 AM_CONDITIONAL([ENABLE_OFFLINE_WEB_APPLICATIONS],[test "$enable_offline_web_applications" = "yes"])
647 AM_CONDITIONAL([ENABLE_DOM_STORAGE],[test "$enable_dom_storage" = "yes"])
648 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
649 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
650 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
651 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
652 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
653 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
654 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
655 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
656 AM_CONDITIONAL([ENABLE_SVG_FILTERS],[test "$enable_svg_filters" = "yes"])
657 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
658 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
659 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
660 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use_element" = "yes"])
661 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
662 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
663 AM_CONDITIONAL([ENABLE_WML],[test "$enable_wml" = "yes"])
664 AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_web_workers" = "yes"])
665 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
666 AM_CONDITIONAL([HTML_FLAGS],[test "$html_flags" = "yes"])
667
668 AC_CONFIG_FILES([
669 GNUmakefile
670 WebKit/gtk/webkit-1.0.pc:WebKit/gtk/webkit.pc.in
671 WebKit/gtk/webkit/webkitversion.h
672 WebKit/gtk/docs/GNUmakefile
673 WebKit/gtk/docs/version.xml
674 ]
675 )
676
677 AC_OUTPUT
678
679 echo "
680 WebKit was configured with the following options:
681
682 Build configuration:
683  Enable debugging (slow)                                  : $enable_debug
684  Enable GCC build optimization                            : $enable_optimizations
685  Code coverage support                                    : $enable_coverage
686  Unicode backend                                          : $unicode_backend
687  Font backend                                             : $with_font_backend
688  Optimized memory allocator                               : $enable_fast_malloc
689 Features:
690  3D Transforms                                            : $enable_3D_transforms
691  JIT compilation                                          : $enable_jit
692  Dashboard support                                        : $enable_dashboard_support
693  Geolocation support                                      : $enable_geolocation
694  GNOME Keyring support                                    : $enable_gnomekeyring
695  JavaScript debugger/profiler support                     : $enable_javascript_debugger
696  HTML5 offline web applications support                   : $enable_offline_web_applications
697  HTML5 channel messaging support                          : $enable_channel_messaging
698  HTML5 client-side session and persistent storage support : $enable_dom_storage
699  HTML5 client-side database storage support               : $enable_database
700  HTML5 video element support                              : $enable_video
701  Icon database support                                    : $enable_icon_database
702  SVG support                                              : $enable_svg
703  SVG animation support                                    : $enable_svg_animation
704  SVG filters support                                      : $enable_svg_filters
705  SVG fonts support                                        : $enable_svg_fonts
706  SVG foreign object support                               : $enable_svg_foreign_object
707  SVG as image support                                     : $enable_svg_as_image
708  SVG use element support                                  : $enable_svg_use_element
709  WML support                                              : $enable_wml
710  Web Workers support                                      : $enable_web_workers
711  XPATH support                                            : $enable_xpath
712  XSLT support                                             : $enable_xslt
713 GTK+ configuration:
714  GDK target                                               : $with_target
715  Hildon UI extensions                                     : $with_hildon
716 "