2009-07-13 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
[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 code coverage
499 AC_MSG_CHECKING([whether to enable code coverage support])
500 AC_ARG_ENABLE(coverage,
501               AC_HELP_STRING([--enable-coverage],
502                              [enable code coverage support [default=no]]),
503               [],[enable_coverage="no"])
504 AC_MSG_RESULT([$enable_coverage])
505
506 # check whether to enable FastMalloc
507 AC_MSG_CHECKING([whether to enable optimized memory allocator])
508 AC_ARG_ENABLE(fast_malloc,
509               AC_HELP_STRING([--enable-fast-malloc],
510                              [enable optimized memory allocator default=yes, default=no for debug builds]),
511               [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
512 AC_MSG_RESULT([$enable_fast_malloc])
513
514 AC_MSG_CHECKING([whether to enable JIT compilation])
515 AC_ARG_ENABLE([jit],
516               AC_HELP_STRING([--enable-jit],
517                              [Enable JIT compilation default=yes]),
518               [],[enable_jit="yes"])
519 if test "$enable_jit" = "yes"; then
520     case "$host_cpu" in
521         i*86|x86_64)
522             AC_DEFINE([ENABLE_JIT], [1], [Define to enable JIT])
523             AC_DEFINE([ENABLE_YARR], [1], [Define to enable YARR])
524             AC_DEFINE([ENABLE_YARR_JIT], [1], [Define to enable YARR JIT])
525             AC_DEFINE([ENABLE_JIT_OPTIMIZE_CALL], [1], [Define to enable optimizing calls])
526             AC_DEFINE([ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS], [1], [Define to enable optimized property access])
527             AC_DEFINE([ENABLE_JIT_OPTIMIZE_ARITHMETIC], [1], [Define to enable optimized arithmetic])
528             case "$host_cpu" in
529                 i*86)
530                     AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_VA_LIST], [1], [Use stub va_list])
531                 ;;
532                 x86_64)
533                     AC_DEFINE([WTF_USE_JIT_STUB_ARGUMENT_REGISTER], [1], [Use stub register])
534                     AC_DEFINE([WTF_USE_ALTERNATE_JSIMMEDIATE], [1], [Use alternate JSImmediate])
535                 ;;
536             esac
537         ;;
538         *)
539             enable_jit="no (CPU '$host_cpu' not supported)"
540         ;;
541     esac
542 fi
543 AC_MSG_RESULT([$enable_jit])
544
545 # determine the font backend
546 AC_MSG_CHECKING([the font backend to use])
547 AC_ARG_WITH(font_backend,
548             AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
549                            [Select font backend [default=freetype]]),
550             [],[with_font_backend="freetype"])
551
552 case "$with_font_backend" in
553      freetype|pango) ;;
554      *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
555 esac
556 AC_MSG_RESULT([$with_font_backend])
557
558 # Add '-g' flag to gcc if it's debug build
559 if test "$enable_debug" = "yes"; then
560    CXXFLAGS="$CXXFLAGS -g"
561    CFLAGS="$CFLAGS -g"
562 else
563    AC_DEFINE([NDEBUG], [1], [Define to disable debugging features])
564 fi
565
566 # Add the appropriate 'O' level for optimized builds
567 if test "$enable_optimizations" = "yes"; then
568    CXXFLAGS="$CXXFLAGS -O2"
569    CFLAGS="$CFLAGS -O2"
570 else
571    CXXFLAGS="$CXXFLAGS -O0"
572    CFLAGS="$CFLAGS -O0"
573 fi
574
575 PKG_CHECK_MODULES([LIBSOUP],
576                   [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
577 AC_SUBST([LIBSOUP_CFLAGS])
578 AC_SUBST([LIBSOUP_LIBS])
579
580 if test "$enable_gnomekeyring" = "yes"; then
581    PKG_CHECK_MODULES([GNOMEKEYRING],
582                      [gnome-keyring-1 >= $GNOME_KEYRING_REQUIRED_VERSION])
583    AC_SUBST([GNOMEKEYRING_CFLAGS])
584    AC_SUBST([GNOMEKEYRING_LIBS])
585 fi
586
587 # check if FreeType/FontConfig are available
588 if test "$with_font_backend" = "freetype"; then
589    if test "$with_target" = "directfb"; then
590    PKG_CHECK_MODULES([FREETYPE],
591                      [fontconfig >= $FONTCONFIG_REQUIRED_VERSION
592                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
593    else
594    PKG_CHECK_MODULES([FREETYPE],
595                      [cairo-ft
596                      fontconfig >= $FONTCONFIG_REQUIRED_VERSION
597                      freetype2 >= $FREETYPE2_REQUIRED_VERSION])
598    fi
599    AC_SUBST([FREETYPE_CFLAGS])
600    AC_SUBST([FREETYPE_LIBS])
601 fi
602
603 # check if sqlite 3 is available
604 if test "$enable_icon_database" = "yes" || \
605    test "$enable_database" = "yes" || \
606    test "$enable_offline_web_applications" = "yes" || \
607    test "$enable_dom_storage" = "yes"; then
608    PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
609    AC_SUBST([SQLITE3_CFLAGS])
610    AC_SUBST([SQLITE3_LIBS])
611 fi
612
613 # check if libxslt is available
614 if test "$enable_xslt" = "yes"; then
615    PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
616    AC_SUBST([LIBXSLT_CFLAGS])
617    AC_SUBST([LIBXSLT_LIBS])
618 fi
619
620 # check if geoclue is available
621 if test "$enable_geolocation" = "yes"; then
622     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
623     AC_SUBST([GEOCLUE_CFLAGS])
624     AC_SUBST([GEOCLUE_LIBS])
625 fi
626
627 # check if gstreamer is available
628 if test "$enable_video" = "yes"; then
629    PKG_CHECK_MODULES([GSTREAMER],
630                      [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
631                      gstreamer-base-0.10,
632                      gstreamer-plugins-base-0.10,
633                      gstreamer-video-0.10])
634    AC_SUBST([GSTREAMER_CFLAGS])
635    AC_SUBST([GSTREAMER_LIBS])
636 fi
637
638 # check for code coverage support
639 if test "$enable_coverage" = "yes"; then
640    COVERAGE_CFLAGS="-MD"
641    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
642    AC_SUBST([COVERAGE_CFLAGS])
643    AC_SUBST([COVERAGE_LDFLAGS])
644 fi
645
646 # check for HTML features
647 if test "$enable_video" = "yes"; then
648     html_flags=yes
649 fi
650
651 GTK_DOC_CHECK([1.10])
652
653 # OS conditionals
654 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
655 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
656 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
657 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
658 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
659
660 # target conditionals
661 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
662 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
663 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
664 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
665
666 # Unicode backend conditionals
667 AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
668 AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
669
670 # Auth backend conditionals
671 AM_CONDITIONAL([USE_GNOMEKEYRING], [test "$enable_gnomekeyring" = "yes"])
672
673 # Font backend conditionals
674 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
675 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
676
677 # WebKit feature conditionals
678 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
679 AM_CONDITIONAL([ENABLE_DASHBOARD_SUPPORT],[test "$enable_dashboard_support" = "yes"])
680 AM_CONDITIONAL([ENABLE_3D_TRANSFORMS],[test "$enable_3D_transforms" = "yes"])
681 AM_CONDITIONAL([ENABLE_CHANNEL_MESSAGING],[test "$enable_channel_messaging" = "yes"])
682 AM_CONDITIONAL([ENABLE_JAVASCRIPT_DEBUGGER],[test "$enable_javascript_debugger" = "yes"])
683 AM_CONDITIONAL([ENABLE_OFFLINE_WEB_APPLICATIONS],[test "$enable_offline_web_applications" = "yes"])
684 AM_CONDITIONAL([ENABLE_DOM_STORAGE],[test "$enable_dom_storage" = "yes"])
685 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
686 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
687 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
688 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
689 AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"])
690 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
691 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
692 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
693 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
694 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
695 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
696 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
697 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use" = "yes"])
698 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
699 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
700 AM_CONDITIONAL([ENABLE_WML],[test "$enable_wml" = "yes"])
701 AM_CONDITIONAL([ENABLE_WORKERS],[test "$enable_workers" = "yes"])
702 AM_CONDITIONAL([ENABLE_SHARED_WORKERS],[test "$enable_shared_workers" = "yes"])
703 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
704 AM_CONDITIONAL([HTML_FLAGS],[test "$html_flags" = "yes"])
705
706 AC_CONFIG_FILES([
707 GNUmakefile
708 WebKit/gtk/webkit-1.0.pc:WebKit/gtk/webkit.pc.in
709 WebKit/gtk/webkit/webkitversion.h
710 WebKit/gtk/docs/GNUmakefile
711 WebKit/gtk/docs/version.xml
712 ]
713 )
714
715 AC_OUTPUT
716
717 echo "
718 WebKit was configured with the following options:
719
720 Build configuration:
721  Enable debugging (slow)                                  : $enable_debug
722  Enable GCC build optimization                            : $enable_optimizations
723  Code coverage support                                    : $enable_coverage
724  Unicode backend                                          : $with_unicode_backend
725  Font backend                                             : $with_font_backend
726  Optimized memory allocator                               : $enable_fast_malloc
727 Features:
728  3D Transforms                                            : $enable_3D_transforms
729  JIT compilation                                          : $enable_jit
730  Dashboard support                                        : $enable_dashboard_support
731  Filters support                                          : $enable_filters
732  Geolocation support                                      : $enable_geolocation
733  GNOME Keyring support                                    : $enable_gnomekeyring
734  JavaScript debugger/profiler support                     : $enable_javascript_debugger
735  HTML5 offline web applications support                   : $enable_offline_web_applications
736  HTML5 channel messaging support                          : $enable_channel_messaging
737  HTML5 client-side session and persistent storage support : $enable_dom_storage
738  HTML5 client-side database storage support               : $enable_database
739  HTML5 video element support                              : $enable_video
740  Icon database support                                    : $enable_icon_database
741  SharedWorkers support                                    : $enable_shared_workers
742  SVG support                                              : $enable_svg
743  SVG animation support                                    : $enable_svg_animation
744  SVG fonts support                                        : $enable_svg_fonts
745  SVG foreign object support                               : $enable_svg_foreign_object
746  SVG as image support                                     : $enable_svg_as_image
747  SVG use element support                                  : $enable_svg_use
748  WML support                                              : $enable_wml
749  Web Workers support                                      : $enable_workers
750  XPATH support                                            : $enable_xpath
751  XSLT support                                             : $enable_xslt
752 GTK+ configuration:
753  GDK target                                               : $with_target
754  Hildon UI extensions                                     : $with_hildon
755 "
756 if test "$with_unicode_backend" = "glib"; then
757    echo "     >> WARNING: the glib-based unicode backend is slow and incomplete <<"
758    echo
759    echo
760 fi