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