2009-07-12 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 CAIRO_REQUIRED_VERSION=1.2
191 FONTCONFIG_REQUIRED_VERSION=2.4
192 FREETYPE2_REQUIRED_VERSION=9.0
193 LIBXML_REQUIRED_VERSION=2.6
194
195 # minimum GTK+ base dependencies
196 PANGO_REQUIRED_VERSION=1.0
197 GTK_REQUIRED_VERSION=2.10
198
199 # optional modules
200 LIBSOUP_REQUIRED_VERSION=2.25.91
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 Web Workers support
413 AC_MSG_CHECKING([whether to enable Web Workers support])
414 AC_ARG_ENABLE(workers,
415               AC_HELP_STRING([--enable-workers],
416                              [enable support for Web Workers [default=yes]]),
417               [],[enable_workers="yes"])
418 AC_MSG_RESULT([$enable_workers])
419
420 # turn off svg features if --disable-svg is requested
421 if test "$enable_svg" = "no"; then
422    enable_svg_animation=no
423    enable_svg_fonts=no
424    enable_svg_foreign_object=no
425    enable_svg_as_image=no
426    enable_svg_use=no
427 fi
428
429 # check whether to enable support for SVG animation
430 AC_MSG_CHECKING([whether to enable support for SVG animation])
431 AC_ARG_ENABLE(svg_animation,
432               AC_HELP_STRING([--enable-svg-animation],
433                              [enable support for SVG animation (experimental) [default=yes]]),
434               [],[enable_svg_animation="yes"])
435 AC_MSG_RESULT([$enable_svg_animation])
436
437 # check whether to enable support for filters
438 AC_MSG_CHECKING([whether to enable support for filters])
439 AC_ARG_ENABLE(filters,
440               AC_HELP_STRING([--enable-filters],
441                              [enable support for filters (experimental) [default=no]]),
442               [],[enable_filters="no"])
443 AC_MSG_RESULT([$enable_filters])
444
445 # check whether to enable support for SVG fonts
446 AC_MSG_CHECKING([whether to enable support for SVG fonts])
447 AC_ARG_ENABLE(svg_fonts,
448               AC_HELP_STRING([--enable-svg-fonts],
449                              [enable support for SVG fonts (experimental) [default=yes]]),
450               [],[enable_svg_fonts="yes"])
451 AC_MSG_RESULT([$enable_svg_fonts])
452
453 # check whether to enable foreign objects support for SVG
454 AC_MSG_CHECKING([whether to enable support for SVG foreign objects])
455 AC_ARG_ENABLE(svg_foreign_object,
456               AC_HELP_STRING([--enable-svg-foreign-object],
457                              [enable support for SVG foreign objects (experimental) [default=yes]]),
458               [],[enable_svg_foreign_object="yes"])
459 AC_MSG_RESULT([$enable_svg_foreign_object])
460
461 # check whether to enable SVG As Image support
462 AC_MSG_CHECKING([whether to enable SVG as Image support])
463 AC_ARG_ENABLE(svg_as_image,
464               AC_HELP_STRING([--enable-svg-as-image],
465                              [enable SVG as Image support (experimental) [default=yes]]),
466               [],[enable_svg_as_image="yes"])
467 AC_MSG_RESULT([$enable_svg_as_image])
468
469 # check whether to enable SVG USE element support
470 AC_MSG_CHECKING([whether to enable support for SVG use element])
471 AC_ARG_ENABLE(svg_use,
472               AC_HELP_STRING([--enable-svg-use],
473                              [enable SVG use element support (experimental) [default=yes]]),
474               [],[enable_svg_use="yes"])
475 AC_MSG_RESULT([$enable_svg_use])
476
477 # check for SVG features, enabling SVG if necessary
478 if test "$enable_svg_animation" = "yes" || \
479    test "$enable_svg_fonts" = "yes" || \
480    test "$enable_svg_foreign_object" = "yes" || \
481    test "$enable_svg_as_image" = "yes" || \
482    test "$enable_svg_use" = "yes"; then
483    svg_flags=yes
484    if test "$enable_svg" = "no"; then
485        AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
486        enable_svg=yes
487    fi
488 fi
489
490 # check whether to enable code coverage
491 AC_MSG_CHECKING([whether to enable code coverage support])
492 AC_ARG_ENABLE(coverage,
493               AC_HELP_STRING([--enable-coverage],
494                              [enable code coverage support [default=no]]),
495               [],[enable_coverage="no"])
496 AC_MSG_RESULT([$enable_coverage])
497
498 # check whether to enable FastMalloc
499 AC_MSG_CHECKING([whether to enable optimized memory allocator])
500 AC_ARG_ENABLE(fast_malloc,
501               AC_HELP_STRING([--enable-fast-malloc],
502                              [enable optimized memory allocator default=yes, default=no for debug builds]),
503               [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
504 AC_MSG_RESULT([$enable_fast_malloc])
505
506 AC_MSG_CHECKING([whether to enable JIT compilation])
507 AC_ARG_ENABLE([jit],
508               AC_HELP_STRING([--enable-jit],
509                              [Enable JIT compilation default=yes]),
510               [],[enable_jit="yes"])
511 if test "$enable_jit" = "yes"; then
512     case "$host_cpu" in
513         i*86|x86_64)
514             AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
515             AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
516             AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
517             AC_DEFINE([ENABLE_JIT_OPTIMIZE_CALL], [1], [Define to enable optimizing calls])
518             AC_DEFINE([ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS], [1], [Define to enable optimized property access])
519             AC_DEFINE([ENABLE_JIT_OPTIMIZE_ARITHMETIC], [1], [Define to enable optimized arithmetic])
520             case "$host_cpu" in
521                 i*86)
522                     AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_VA_LIST], [1], [Use stub va_list])
523                 ;;
524                 x86_64)
525                     AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_REGISTER], [1], [Use stub register])
526                     AC_DEFINE([WTF_USE_ALTERNATE_JSIMMEDIATE], [1], [Use alternate JSImmediate])
527                 ;;
528             esac
529         ;;
530         *)
531             enable_jit="no (CPU '$host_cpu' not supported)"
532         ;;
533     esac
534 fi
535 AC_MSG_RESULT([$enable_jit])
536
537 # determine the font backend
538 AC_MSG_CHECKING([the font backend to use])
539 AC_ARG_WITH(font_backend,
540             AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
541                            [Select font backend [default=freetype]]),
542             [],[with_font_backend="freetype"])
543
544 case "$with_font_backend" in
545      freetype|pango) ;;
546      *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
547 esac
548 AC_MSG_RESULT([$with_font_backend])
549
550 # Add '-g' flag to gcc if it's debug build
551 if test "$enable_debug" = "yes"; then
552    CXXFLAGS="$CXXFLAGS -g"
553    CFLAGS="$CFLAGS -g"
554 else
555    AC_DEFINE([NDEBUG], [1], [Define to disable debugging features])
556 fi
557
558 # Add the appropriate 'O' level for optimized builds
559 if test "$enable_optimizations" = "yes"; then
560    CXXFLAGS="$CXXFLAGS -O2"
561    CFLAGS="$CFLAGS -O2"
562 else
563    CXXFLAGS="$CXXFLAGS -O0"
564    CFLAGS="$CFLAGS -O0"
565 fi
566
567 PKG_CHECK_MODULES([LIBSOUP],
568                   [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
569 AC_SUBST([LIBSOUP_CFLAGS])
570 AC_SUBST([LIBSOUP_LIBS])
571
572 if test "$enable_gnomekeyring" = "yes"; then
573    PKG_CHECK_MODULES([GNOMEKEYRING],
574                      [gnome-keyring-1 >= $GNOME_KEYRING_REQUIRED_VERSION])
575    AC_SUBST([GNOMEKEYRING_CFLAGS])
576    AC_SUBST([GNOMEKEYRING_LIBS])
577 fi
578
579 # check if FreeType/FontConfig are available
580 if test "$with_font_backend" = "freetype"; then
581    if test "$with_target" = "directfb"; then
582    PKG_CHECK_MODULES([FREETYPE],
583                      [fontconfig >= $FONTCONFIG_REQUIRED_VERSION
584                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
585    else
586    PKG_CHECK_MODULES([FREETYPE],
587                      [cairo-ft
588                      fontconfig >= $FONTCONFIG_REQUIRED_VERSION
589                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
590    fi
591    AC_SUBST([FREETYPE_CFLAGS])
592    AC_SUBST([FREETYPE_LIBS])
593 fi
594
595 # check if sqlite 3 is available
596 if test "$enable_icon_database" = "yes" || \
597    test "$enable_database" = "yes" || \
598    test "$enable_offline_web_applications" = "yes" || \
599    test "$enable_dom_storage" = "yes"; then
600    PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
601    AC_SUBST([SQLITE3_CFLAGS])
602    AC_SUBST([SQLITE3_LIBS])
603 fi
604
605 # check if libxslt is available
606 if test "$enable_xslt" = "yes"; then
607    PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
608    AC_SUBST([LIBXSLT_CFLAGS])
609    AC_SUBST([LIBXSLT_LIBS])
610 fi
611
612 # check if geoclue is available
613 if test "$enable_geolocation" = "yes"; then
614     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
615     AC_SUBST([GEOCLUE_CFLAGS])
616     AC_SUBST([GEOCLUE_LIBS])
617 fi
618
619 # check if gstreamer is available
620 if test "$enable_video" = "yes"; then
621    PKG_CHECK_MODULES([GSTREAMER],
622                      [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
623                      gstreamer-base-0.10,
624                      gstreamer-plugins-base-0.10,
625                      gstreamer-video-0.10])
626    AC_SUBST([GSTREAMER_CFLAGS])
627    AC_SUBST([GSTREAMER_LIBS])
628 fi
629
630 # check for code coverage support
631 if test "$enable_coverage" = "yes"; then
632    COVERAGE_CFLAGS="-MD"
633    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
634    AC_SUBST([COVERAGE_CFLAGS])
635    AC_SUBST([COVERAGE_LDFLAGS])
636 fi
637
638 # check for HTML features
639 if test "$enable_video" = "yes"; then
640     html_flags=yes
641 fi
642
643 GTK_DOC_CHECK([1.10])
644
645 # OS conditionals
646 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
647 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
648 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
649 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
650 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
651
652 # target conditionals
653 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
654 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
655 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
656 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
657
658 # Unicode backend conditionals
659 AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
660 AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
661
662 # Auth backend conditionals
663 AM_CONDITIONAL([USE_GNOMEKEYRING], [test "$enable_gnomekeyring" = "yes"])
664
665 # Font backend conditionals
666 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
667 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
668
669 # WebKit feature conditionals
670 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
671 AM_CONDITIONAL([ENABLE_DASHBOARD_SUPPORT],[test "$enable_dashboard_support" = "yes"])
672 AM_CONDITIONAL([ENABLE_3D_TRANSFORMS],[test "$enable_3D_transforms" = "yes"])
673 AM_CONDITIONAL([ENABLE_CHANNEL_MESSAGING],[test "$enable_channel_messaging" = "yes"])
674 AM_CONDITIONAL([ENABLE_JAVASCRIPT_DEBUGGER],[test "$enable_javascript_debugger" = "yes"])
675 AM_CONDITIONAL([ENABLE_OFFLINE_WEB_APPLICATIONS],[test "$enable_offline_web_applications" = "yes"])
676 AM_CONDITIONAL([ENABLE_DOM_STORAGE],[test "$enable_dom_storage" = "yes"])
677 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
678 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
679 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
680 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
681 AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"])
682 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
683 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
684 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
685 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
686 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
687 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
688 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
689 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use" = "yes"])
690 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
691 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
692 AM_CONDITIONAL([ENABLE_WML],[test "$enable_wml" = "yes"])
693 AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_workers" = "yes"])
694 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
695 AM_CONDITIONAL([HTML_FLAGS],[test "$html_flags" = "yes"])
696
697 AC_CONFIG_FILES([
698 GNUmakefile
699 WebKit/gtk/webkit-1.0.pc:WebKit/gtk/webkit.pc.in
700 WebKit/gtk/webkit/webkitversion.h
701 WebKit/gtk/docs/GNUmakefile
702 WebKit/gtk/docs/version.xml
703 ]
704 )
705
706 AC_OUTPUT
707
708 echo "
709 WebKit was configured with the following options:
710
711 Build configuration:
712  Enable debugging (slow)                                  : $enable_debug
713  Enable GCC build optimization                            : $enable_optimizations
714  Code coverage support                                    : $enable_coverage
715  Unicode backend                                          : $with_unicode_backend
716  Font backend                                             : $with_font_backend
717  Optimized memory allocator                               : $enable_fast_malloc
718 Features:
719  3D Transforms                                            : $enable_3D_transforms
720  JIT compilation                                          : $enable_jit
721  Dashboard support                                        : $enable_dashboard_support
722  Filters support                                          : $enable_filters
723  Geolocation support                                      : $enable_geolocation
724  GNOME Keyring support                                    : $enable_gnomekeyring
725  JavaScript debugger/profiler support                     : $enable_javascript_debugger
726  HTML5 offline web applications support                   : $enable_offline_web_applications
727  HTML5 channel messaging support                          : $enable_channel_messaging
728  HTML5 client-side session and persistent storage support : $enable_dom_storage
729  HTML5 client-side database storage support               : $enable_database
730  HTML5 video element support                              : $enable_video
731  Icon database support                                    : $enable_icon_database
732  SVG support                                              : $enable_svg
733  SVG animation support                                    : $enable_svg_animation
734  SVG fonts support                                        : $enable_svg_fonts
735  SVG foreign object support                               : $enable_svg_foreign_object
736  SVG as image support                                     : $enable_svg_as_image
737  SVG use element support                                  : $enable_svg_use
738  WML support                                              : $enable_wml
739  Web Workers support                                      : $enable_workers
740  XPATH support                                            : $enable_xpath
741  XSLT support                                             : $enable_xslt
742 GTK+ configuration:
743  GDK target                                               : $with_target
744  Hildon UI extensions                                     : $with_hildon
745 "
746 if test "$with_unicode_backend" = "glib"; then
747    echo "     >> WARNING: the glib-based unicode backend is slow and incomplete <<"
748    echo
749    echo
750 fi