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