1 AC_INIT([WebKit],[0.1],[http://bugs.webkit.org/])
5 AC_CONFIG_HEADERS([aconfig.h])
6 AC_CONFIG_SRCDIR([WebCore/config.h])
8 # see http://www.gnu.org/software/libtool/manual.html#Versioning
9 LIBWEBKITGTK_VERSION=1:0:0
10 AC_SUBST([LIBWEBKITGTK_VERSION])
12 AM_INIT_AUTOMAKE([foreign subdir-objects])
16 # host checking - inspired by the GTK+ configure.in
17 # TODO: os_mac, os_bsd
18 AC_MSG_CHECKING([for native Win32])
27 AC_MSG_RESULT([$os_win32])
41 # If CXXFLAGS and CFLAGS are unset, default to -O2
42 # This is to tell automake not to include '-g' if CXXFLAGS is not set
43 # For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
44 if test -z "$CXXFLAGS"; then
47 if test -z "$CFLAGS"; then
59 # check for -fvisibility=hidden compiler support (GCC >= 4)
60 saved_CFLAGS="$CFLAGS"
61 CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
62 AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
63 AC_COMPILE_IFELSE([char foo;],
64 [ AC_MSG_RESULT([yes])
65 SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden" ],
67 CFLAGS="$saved_CFLAGS"
68 AC_SUBST(SYMBOL_VISIBILITY)
69 AC_SUBST(SYMBOL_VISIBILITY_INLINES)
71 AC_PATH_PROG(PERL, perl)
72 if test -z "$PERL"; then
73 AC_MSG_ERROR([You need 'perl' to compile WebKit])
76 AC_PATH_PROG(BISON, bison)
77 if test -z "$BISON"; then
78 AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
81 AC_PATH_PROG(FLEX, flex)
82 if test -z "$FLEX"; then
83 AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
86 AC_PATH_PROG(GPERF, gperf)
87 if test -z "$GPERF"; then
88 AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
92 if test -z "$MV"; then
93 AC_MSG_ERROR([You need 'mv' to compile WebKit])
97 # Check for glib-genmarshal and glib-mkenums
98 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
99 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
101 # Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
104 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
107 # C/C++ Language Features
116 # pthread (not needed on Windows)
117 if test "$os_win32" = "no"; then
118 AC_CHECK_HEADERS([pthread.h],
119 AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exist]),
120 AC_MSG_ERROR([pthread support is required to build WebKit]))
124 AC_CHECK_HEADERS([jpeglib.h])
126 # check for pkg-config
127 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
128 if test "$PKG_CONFIG" = "no"; then
129 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
132 # determine the Unicode backend
133 AC_MSG_CHECKING([the Unicode backend to use])
134 AC_ARG_WITH(unicode_backend,
135 AC_HELP_STRING([--with-unicode-backend=@<:@icu@:>@],
136 [Select Unicode backend [default=icu]]),
137 [],[unicode_backend="icu"])
139 case "$unicode_backend" in
141 *) AC_MSG_ERROR([Invalid Unicode backend: must be icu.]) ;;
144 AC_MSG_RESULT([$unicode_backend])
146 if test "$unicode_backend" = "icu"; then
147 # check for icu-config
148 if test "$os_darwin" = "yes"; then
149 UNICODE_CFLAGS="-I\$(srcdir)/JavaScriptCore/icu -I\$(srcdir)/WebCore/icu"
150 UNICODE_LIBS="-licucore"
152 AC_PATH_PROG(icu_config, icu-config, no)
153 if test "$icu_config" = "no"; then
154 AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
157 # We don't use --cflags as this gives us a lot of things that we don't
158 # necessarily want, like debugging and optimization flags
159 # See man (1) icu-config for more info.
160 UNICODE_CFLAGS=`$icu_config --cppflags`
161 UNICODE_LIBS=`$icu_config --ldflags`
165 AC_SUBST([UNICODE_CFLAGS])
166 AC_SUBST([UNICODE_LIBS])
168 # determine the GDK/GTK+ target
169 AC_MSG_CHECKING([the target windowing system])
171 AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@],
172 [Select webkit target [default=x11]]),
173 [],[with_target="x11"])
175 case "$with_target" in
176 x11|win32|quartz|directfb) ;;
177 *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
180 AC_MSG_RESULT([$with_target])
182 AC_MSG_CHECKING([for Hildon UI extensions])
184 AC_HELP_STRING([--with-hildon],
185 [Use Hildon UI extensions [default=no]]),
186 [],[with_hildon="no"])
187 AC_MSG_RESULT([$with_hildon])
189 if test "$with_hildon" = "yes"; then
190 HILDON_CPPFLAGS="-DMAEMO_CHANGES"
191 PKG_CHECK_MODULES([HILDON], [hildon-1])
192 AC_SUBST([HILDON_CPPFLAGS])
193 AC_SUBST([HILDON_CFLAGS])
194 AC_SUBST([HILDON_LIBS])
197 # determine the http backend
198 AC_MSG_CHECKING([the HTTP backend to use])
199 AC_ARG_WITH(http_backend,
200 AC_HELP_STRING([--with-http-backend=@<:@curl/soup@:>@],
201 [Select HTTP backend [default=curl]]),
202 [],[with_http_backend="curl"])
204 case "$with_http_backend" in
206 *) AC_MSG_ERROR([Invalid HTTP backend: must be curl, soup.]) ;;
209 AC_MSG_RESULT([$with_http_backend])
211 # minimum base dependencies
212 CAIRO_REQUIRED_VERSION=1.4
213 FONTCONFIG_REQUIRED_VERSION=2.4
214 FREETYPE2_REQUIRED_VERSION=9.0
215 LIBXML_REQUIRED_VERSION=2.6
217 # minimum GTK+ base dependencies
218 GLIB_REQUIRED_VERSION=2.0
219 GOBJECT_REQUIRED_VERSION=2.0
220 GTHREAD_REQUIRED_VERSION=2.0
221 PANGO_REQUIRED_VERSION=1.0
222 GTK_REQUIRED_VERSION=2.8
225 LIBCURL_REQUIRED_VERSION=7.15
226 LIBSOUP_REQUIRED_VERSION=2.4
227 LIBXSLT_REQUIRED_VERSION=1.1.7
228 SQLITE_REQUIRED_VERSION=3.0
229 GSTREAMER_REQUIRED_VERSION=0.10
230 GNOME_VFS_REQUIRED_VERSION=2.0
232 PKG_CHECK_MODULES([GLOBALDEPS],
233 [glib-2.0 >= $GLIB_REQUIRED_VERSION
234 gobject-2.0 >= $GOBJECT_REQUIRED_VERSION
235 gthread-2.0 >= $GTHREAD_REQUIRED_VERSION])
236 AC_SUBST([GLOBALDEPS_CFLAGS])
237 AC_SUBST([GLOBALDEPS_LIBS])
239 PKG_CHECK_MODULES([WEBKITDEPS],
240 [gtk+-2.0 >= $GTK_REQUIRED_VERSION
241 pango >= $PANGO_REQUIRED_VERSION
242 cairo >= $CAIRO_REQUIRED_VERSION
244 fontconfig >= $FONTCONFIG_REQUIRED_VERSION
245 freetype2 >= $FREETYPE2_REQUIRED_VERSION
246 libxml-2.0 >= $LIBXML_REQUIRED_VERSION])
247 AC_SUBST([WEBKITDEPS_CFLAGS])
248 AC_SUBST([WEBKITDEPS_LIBS])
250 # check whether to build with debugging enabled
251 AC_MSG_CHECKING([whether to do a debug build])
253 AC_HELP_STRING([--enable-debug],
254 [turn on debugging [default=no]]),
255 [],[enable_debug="no"])
256 AC_MSG_RESULT([$enable_debug])
258 # check whether to build with cross-document messaging support
259 AC_MSG_CHECKING([whether to enable HTML5 cross-document messaging support])
260 AC_ARG_ENABLE(cross_document_messaging,
261 AC_HELP_STRING([--enable-cross-document-messaging],
262 [enable HTML5 cross-document messaging support [default=yes]]),
263 [],[enable_cross_document_messaging="yes"])
264 AC_MSG_RESULT([$enable_cross_document_messaging])
266 # check whether to build with database support
267 AC_MSG_CHECKING([whether to enable HTML5 client-side storage support])
268 AC_ARG_ENABLE(database,
269 AC_HELP_STRING([--enable-database],
270 [enable HTML5 client-side storage support [default=yes]]),
271 [],[enable_database="yes"])
272 AC_MSG_RESULT([$enable_database])
274 # check whether to build with icon database support
275 AC_MSG_CHECKING([whether to enable icon database support])
276 AC_ARG_ENABLE(icon_database,
277 AC_HELP_STRING([--enable-icon-database],
278 [enable icon database [default=no]]),
279 [],[enable_icon_database="no"])
280 AC_MSG_RESULT([$enable_icon_database])
282 # check whether to enable HTML5 audio/video support
283 AC_MSG_CHECKING([whether to enable HTML5 video support])
285 AC_HELP_STRING([--enable-video],
286 [enable HTML5 video support [default=no]]),
287 [],[enable_video="no"])
288 AC_MSG_RESULT([$enable_video])
290 # check whether to enable XPath support
291 AC_MSG_CHECKING([whether to enable XPath support])
293 AC_HELP_STRING([--enable-xpath],
294 [enable support for XPath [default=yes]]),
295 [],[enable_xpath="yes"])
296 AC_MSG_RESULT([$enable_xpath])
298 # check whether to enable XSLT support
299 AC_MSG_CHECKING([whether to enable XSLT support])
301 AC_HELP_STRING([--enable-xslt],
302 [enable support for XSLT [default=yes]]),
303 [],[enable_xslt="yes"])
304 AC_MSG_RESULT([$enable_xslt])
306 # check whether to enable SVG experimental features
307 # Enable all SVG if it is
308 AC_MSG_CHECKING([whether to enable SVG experimental features])
309 AC_ARG_ENABLE(svg_experimental,
310 AC_HELP_STRING([--enable-svg-experimental],
311 [enable support for SVG experimental features [default=no]]),
312 [],[enable_svg_experimental="no"])
313 AC_MSG_RESULT([$enable_svg_experimental])
315 if test "$enable_svg_experimental" = "yes"; then
317 enable_svg_animation=yes
318 # enable_svg_filters=yes
320 enable_svg_foreign_object=yes
321 enable_svg_as_image=yes
322 enable_svg_use_element=yes
325 # check whether to enable SVG support
326 AC_MSG_CHECKING([whether to enable SVG support])
328 AC_HELP_STRING([--enable-svg],
329 [enable support for SVG [default=no]]),
330 [],[enable_svg="no"])
331 AC_MSG_RESULT([$enable_svg])
333 # check whether to enable support for SVG animation
334 AC_MSG_CHECKING([whether to enable support for SVG animation])
335 AC_ARG_ENABLE(svg_animation,
336 AC_HELP_STRING([--enable-svg-animation],
337 [enable support for SVG animation (experimental) [default=no]]),
338 [],[enable_svg_animation="no"])
339 AC_MSG_RESULT([$enable_svg_animation])
341 # check whether to enable support for SVG filters
342 AC_MSG_CHECKING([whether to enable support for SVG filters])
343 AC_ARG_ENABLE(svg_filters,
344 AC_HELP_STRING([--enable-svg-filters],
345 [enable support for SVG filters (experimental) [default=no]]),
346 [],[enable_svg_filters="no"])
347 AC_MSG_RESULT([$enable_svg_filters])
349 # check whether to enable support for SVG fonts
350 AC_MSG_CHECKING([whether to enable support for SVG fonts])
351 AC_ARG_ENABLE(svg_fonts,
352 AC_HELP_STRING([--enable-svg-fonts],
353 [enable support for SVG fonts (experimental) [default=no]]),
354 [],[enable_svg_fonts="no"])
355 AC_MSG_RESULT([$enable_svg_fonts])
357 # check whether to enable foreign objects support for SVG
358 AC_MSG_CHECKING([whether to enable support for SVG foreign objects])
359 AC_ARG_ENABLE(svg_foreign_object,
360 AC_HELP_STRING([--enable-svg-foreign-object],
361 [enable support for SVG foreign objects (experimental) [default=no]]),
362 [],[enable_svg_foreign_object="no"])
363 AC_MSG_RESULT([$enable_svg_foreign_object])
365 # check whether to enable SVG As Image support
366 AC_MSG_CHECKING([whether to enable SVG as Image support])
367 AC_ARG_ENABLE(svg_as_image,
368 AC_HELP_STRING([--enable-svg-as-image],
369 [enable SVG as Image support (experimental) [default=no]]),
370 [],[enable_svg_as_image="no"])
371 AC_MSG_RESULT([$enable_svg_as_image])
373 # check whether to enable SVG USE element support
374 AC_MSG_CHECKING([whether to enable support for SVG use element])
375 AC_ARG_ENABLE(svg_use_element,
376 AC_HELP_STRING([--enable-svg-use-element],
377 [enable SVG use element support (experimental) [default=no]]),
378 [],[enable_svg_use_element="no"])
379 AC_MSG_RESULT([$enable_svg_use_element])
381 # check whether to enable code coverage
382 AC_MSG_CHECKING([whether to enable code coverage support])
383 AC_ARG_ENABLE(coverage,
384 AC_HELP_STRING([--enable-coverage],
385 [enable code coverage support [default=no]]),
386 [],[enable_coverage="no"])
387 AC_MSG_RESULT([$enable_coverage])
389 # check whether to enable FastMalloc
390 AC_MSG_CHECKING([whether to enable optimized memory allocator])
391 AC_ARG_ENABLE(fast_malloc,
392 AC_HELP_STRING([--enable-fast-malloc],
393 [enable optimized memory allocator default=yes, default=no for debug builds]),
394 [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
395 AC_MSG_RESULT([$enable_fast_malloc])
397 # determine the font backend
398 AC_MSG_CHECKING([the font backend to use])
399 AC_ARG_WITH(font_backend,
400 AC_HELP_STRING([--with-font-backend=@<:@freetype/pango@:>@],
401 [Select font backend [default=freetype]]),
402 [],[with_font_backend="freetype"])
404 case "$with_font_backend" in
406 *) AC_MSG_ERROR([Invalid font backend: must be freetype or pango.]) ;;
408 AC_MSG_RESULT([$with_font_backend])
410 # Add '-g' flag to gcc if it's debug build
411 if test "$enable_debug" = "yes"; then
412 CXXFLAGS="$CXXFLAGS -g"
416 # check if curl is available
417 if test "$with_http_backend" = "curl"; then
418 PKG_CHECK_MODULES([LIBCURL],
419 [libcurl >= $LIBCURL_REQUIRED_VERSION])
420 AC_SUBST([LIBCURL_CFLAGS])
421 AC_SUBST([LIBCURL_LIBS])
424 if test "$with_http_backend" = "soup"; then
425 PKG_CHECK_MODULES([LIBSOUP],
426 [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
427 AC_SUBST([LIBSOUP_CFLAGS])
428 AC_SUBST([LIBSOUP_LIBS])
431 # check if sqlite 3 is available
432 if test "$enable_icon_database" = "yes" || test "$enable_database" = "yes"; then
433 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
434 AC_SUBST([SQLITE3_CFLAGS])
435 AC_SUBST([SQLITE3_LIBS])
438 # check if libxslt is available
439 if test "$enable_xslt" = "yes"; then
440 PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
441 AC_SUBST([LIBXSLT_CFLAGS])
442 AC_SUBST([LIBXSLT_LIBS])
445 # check if gstreamer is available
446 if test "$enable_video" = "yes"; then
447 PKG_CHECK_MODULES([GSTREAMER],
448 [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
450 gstreamer-plugins-base-0.10,
451 gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION])
452 AC_SUBST([GSTREAMER_CFLAGS])
453 AC_SUBST([GSTREAMER_LIBS])
456 # check for code coverage support
457 if test "$enable_coverage" = "yes"; then
458 COVERAGE_CFLAGS="-MD"
459 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
460 AC_SUBST([COVERAGE_CFLAGS])
461 AC_SUBST([COVERAGE_LDFLAGS])
464 # check for SVG features, enabling SVG if necessary
465 if test "$enable_svg_animation" = "yes" || \
466 test "$enable_svg_filters" = "yes" || \
467 test "$enable_svg_fonts" = "yes" || \
468 test "$enable_svg_foreign_object" = "yes" || \
469 test "$enable_svg_as_image" = "yes" || \
470 test "$enable_svg_use_element" = "yes"; then
472 if test "$enable_svg" = "no"; then
473 AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
479 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
480 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
481 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
482 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
484 # target conditionals
485 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
486 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
487 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
488 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
490 # HTTP backend conditionals
491 AM_CONDITIONAL([USE_CURL], [test "$with_http_backend" = "curl"])
492 AM_CONDITIONAL([USE_SOUP], [test "$with_http_backend" = "soup"])
494 # Font backend conditionals
495 AM_CONDITIONAL([USE_FREETYPE], [test "$with_font_backend" = "freetype"])
496 AM_CONDITIONAL([USE_PANGO], [test "$with_font_backend" = "pango"])
498 # WebKit feature conditionals
499 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
500 AM_CONDITIONAL([ENABLE_CROSS_DOCUMENT_MESSAGING],[test "$enable_cross_document_messaging" = "yes"])
501 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
502 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
503 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
504 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
505 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
506 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
507 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
508 AM_CONDITIONAL([ENABLE_SVG_FILTERS],[test "$enable_svg_filters" = "yes"])
509 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
510 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
511 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
512 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use_element" = "yes"])
513 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
514 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
515 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
519 WebKit/gtk/webkit-1.0.pc:WebKit/gtk/webkit.pc.in
526 WebKit was configured with the following options:
529 Enable debugging (slow) : $enable_debug
530 Code coverage support : $enable_coverage
531 Unicode backend : $unicode_backend
532 HTTP backend : $with_http_backend
533 Font backend : $with_font_backend
534 Optimized memory allocator : $enable_fast_malloc
536 HTML5 cross-document messaging : $enable_cross_document_messaging
537 HTML5 client-side storage support : $enable_database
538 HTML5 video element support : $enable_video
539 Icon database support : $enable_icon_database
540 SVG support : $enable_svg
541 SVG animation support : $enable_svg_animation
542 SVG filters support : $enable_svg_filters
543 SVG fonts support : $enable_svg_fonts
544 SVG foreign object support : $enable_svg_foreign_object
545 SVG as image support : $enable_svg_as_image
546 SVG use element support : $enable_svg_use_element
547 XPATH support : $enable_xpath
548 XSLT support : $enable_xslt
550 GDK target : $with_target
551 Hildon UI extensions : $with_hildon