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