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])
38 # If CXXFLAGS and CFLAGS are unset, default to -O2
39 # This is to tell automake not to include '-g' if CXXFLAGS is not set
40 # For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
41 if test -z "$CXXFLAGS"; then
44 if test -z "$CFLAGS"; then
56 # check for -fvisibility=hidden compiler support (GCC >= 4)
57 saved_CFLAGS="$CFLAGS"
58 CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
59 AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
60 AC_COMPILE_IFELSE([char foo;],
61 [ AC_MSG_RESULT([yes])
62 SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden" ],
64 CFLAGS="$saved_CFLAGS"
65 AC_SUBST(SYMBOL_VISIBILITY)
66 AC_SUBST(SYMBOL_VISIBILITY_INLINES)
68 AC_PATH_PROG(PERL, perl)
69 if test -z "$PERL"; then
70 AC_MSG_ERROR([You need 'perl' to compile WebKit])
73 AC_PATH_PROG(BISON, bison)
74 if test -z "$BISON"; then
75 AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
78 AC_PATH_PROG(FLEX, flex)
79 if test -z "$FLEX"; then
80 AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
83 AC_PATH_PROG(GPERF, gperf)
84 if test -z "$GPERF"; then
85 AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
89 if test -z "$MV"; then
90 AC_MSG_ERROR([You need 'mv' to compile WebKit])
94 # Check for glib-genmarshal and glib-mkenums
95 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
96 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
98 # Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
101 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
104 # C/C++ Language Features
114 AC_CHECK_HEADERS([pthread.h],
115 AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exist]),
116 AC_MSG_ERROR([pthread support is required to build WebKit]))
119 AC_CHECK_HEADERS([jpeglib.h])
121 # check for pkg-config
122 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
123 if test "$PKG_CONFIG" = "no"; then
124 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
127 # check for icu-config
128 AC_PATH_PROG(icu_config, icu-config, no)
129 if test "$icu_config" = "no"; then
130 AC_MSG_ERROR([Cannot find icu-config. ICU library is needed.])
133 # We don't use --cflags as this gives us a lot of things that we don't
134 # necessarily want, like debugging and optimization flags
135 # See man (1) icu-config for more info.
136 ICU_CPPFLAGS=`$icu_config --cppflags`
137 ICU_LIBS=`$icu_config --ldflags`
138 AC_SUBST([ICU_CPPFLAGS])
141 # determine the GDK/GTK+ target
142 AC_MSG_CHECKING([the target for WebKit GTK+])
143 AC_ARG_WITH(webkit_target,
144 AC_HELP_STRING([--with-webkit-target=@<:@x11/win32/quartz/directfb@:>@],
145 [Select webkit target [default=x11]]),
146 [],[with_webkit_target="x11"])
148 case "$with_webkit_target" in
149 x11|win32|quartz|directfb) ;;
150 *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
153 AC_MSG_RESULT([$with_webkit_target])
155 AC_MSG_CHECKING([for Hildon UI extensions])
157 AC_HELP_STRING([--with-hildon],
158 [Use Hildon UI extensions [default=no]]),
159 [],[with_hildon="no"])
160 AC_MSG_RESULT([$with_hildon])
162 if test "$with_hildon" = "yes"; then
163 HILDON_CPPFLAGS="-DMAEMO_CHANGES"
164 PKG_CHECK_MODULES([HILDON], [hildon-1])
165 AC_SUBST([HILDON_CPPFLAGS])
166 AC_SUBST([HILDON_CFLAGS])
167 AC_SUBST([HILDON_LIBS])
170 # determine the http backend
171 AC_MSG_CHECKING([the HTTP backend to use])
172 AC_ARG_WITH(http_backend,
173 AC_HELP_STRING([--with-http-backend=@<:@curl@:>@],
174 [Select HTTP backend [default=curl]]),
175 [],[http_backend="curl"])
177 case "$http_backend" in
179 *) AC_MSG_ERROR([Invalid HTTP backend: must be curl.]) ;;
182 AC_MSG_RESULT([$http_backend])
185 # minimum base dependencies
186 GLIB_REQUIRED_VERSION=2.0
187 GOBJECT_REQUIRED_VERSION=2.0
188 GTHREAD_REQUIRED_VERSION=2.0
189 PANGO_REQUIRED_VERSION=1.0
190 CAIRO_REQUIRED_VERSION=1.4
191 FONTCONFIG_REQUIRED_VERSION=2.4
192 FREETYPE2_REQUIRED_VERSION=9.0
193 LIBXML_REQUIRED_VERSION=2.6
196 GTK_REQUIRED_VERSION=2.0
197 LIBCURL_REQUIRED_VERSION=7.15
198 LIBXSLT_REQUIRED_VERSION=1.1.7
199 SQLITE_REQUIRED_VERSION=3.0
200 GSTREAMER_REQUIRED_VERSION=0.10
201 GNOME_VFS_REQUIRED_VERSION=2.0
203 PKG_CHECK_MODULES([DEPENDENCIES],
204 [glib-2.0 >= $GLIB_REQUIRED_VERSION
205 gobject-2.0 >= $GOBJECT_REQUIRED_VERSION
206 gthread-2.0 >= $GTHREAD_REQUIRED_VERSION
207 gtk+-2.0 >= $GTK_REQUIRED_VERSION
208 pango >= $PANGO_REQUIRED_VERSION
209 cairo >= $CAIRO_REQUIRED_VERSION
211 fontconfig >= $FONTCONFIG_REQUIRED_VERSION
212 freetype2 >= $FREETYPE2_REQUIRED_VERSION
213 libxml-2.0 >= $LIBXML_REQUIRED_VERSION])
214 AC_SUBST([DEPENDENCIES_CFLAGS])
215 AC_SUBST([DEPENDENCIES_LIBS])
217 # check whether to build with debugging enabled
218 AC_MSG_CHECKING([whether to do a debug build])
220 AC_HELP_STRING([--enable-debug],
221 [turn on debugging [default=no]]),
222 [],[enable_debug="no"])
223 AC_MSG_RESULT([$enable_debug])
225 # check whether to build with cross-document messaging support
226 AC_MSG_CHECKING([whether to enable HTML5 client-side storage support])
227 AC_ARG_ENABLE(cross_document_messaging,
228 AC_HELP_STRING([--enable-cross-document-messaging],
229 [enable HTML5 cross-document messaging support [default=no]]),
230 [],[enable_cross_document_messaging="no"])
231 AC_MSG_RESULT([$enable_cross_document_messaging])
233 # check whether to build with database support
234 AC_MSG_CHECKING([whether to enable HTML5 client-side storage support])
235 AC_ARG_ENABLE(database,
236 AC_HELP_STRING([--enable-database],
237 [enable HTML5 client-side storage support [default=yes]]),
238 [],[enable_database="yes"])
239 AC_MSG_RESULT([$enable_database])
241 # check whether to build with icon database support
242 AC_MSG_CHECKING([whether to enable icon database support])
243 AC_ARG_ENABLE(icon_database,
244 AC_HELP_STRING([--enable-icon-database],
245 [enable icon database [default=no]]),
246 [],[enable_icon_database="no"])
247 AC_MSG_RESULT([$enable_icon_database])
249 # check whether to enable HTML5 audio/video support
250 AC_MSG_CHECKING([whether to enable HTML5 video support])
252 AC_HELP_STRING([--enable-video],
253 [enable HTML5 video support [default=no]]),
254 [],[enable_video="no"])
255 AC_MSG_RESULT([$enable_video])
257 # check whether to enable XPath support
258 AC_MSG_CHECKING([whether to enable XPath support])
260 AC_HELP_STRING([--enable-xpath],
261 [enable support for XPath [default=yes]]),
262 [],[enable_xpath="yes"])
263 AC_MSG_RESULT([$enable_xpath])
265 # check whether to enable XSLT support
266 AC_MSG_CHECKING([whether to enable XSLT support])
268 AC_HELP_STRING([--enable-xslt],
269 [enable support for XSLT [default=yes]]),
270 [],[enable_xslt="yes"])
271 AC_MSG_RESULT([$enable_xslt])
273 # check whether to enable SVG experimental features
274 # Enable all SVG if it is
275 AC_MSG_CHECKING([whether to enable SVG experimental features])
276 AC_ARG_ENABLE(svg_experimental,
277 AC_HELP_STRING([--enable-svg-experimental],
278 [enable support for SVG experimental features [default=no]]),
279 [],[enable_svg_experimental="no"])
280 AC_MSG_RESULT([$enable_svg_experimental])
282 if test "$enable_svg_experimental" = "yes"; then
284 enable_svg_animation=yes
285 enable_svg_filters=yes
287 enable_svg_foreign_object=yes
288 enable_svg_as_image=yes
289 enable_svg_use_element=yes
292 # check whether to enable SVG support
293 AC_MSG_CHECKING([whether to enable SVG support])
295 AC_HELP_STRING([--enable-svg],
296 [enable support for SVG [default=no]]),
297 [],[enable_svg="no"])
298 AC_MSG_RESULT([$enable_svg])
300 # check whether to enable support for SVG animation
301 AC_MSG_CHECKING([whether to enable support for SVG animataion])
302 AC_ARG_ENABLE(svg_animation,
303 AC_HELP_STRING([--enable-svg-animation],
304 [enable support for SVG animation (experimental) [default=no]]),
305 [],[enable_svg_animation="no"])
306 AC_MSG_RESULT([$enable_svg_animation])
308 # check whether to enable support for SVG filters
309 AC_MSG_CHECKING([whether to enable support for SVG filters])
310 AC_ARG_ENABLE(svg_filters,
311 AC_HELP_STRING([--enable-svg-filters],
312 [enable support for SVG filters (experimental) [default=no]]),
313 [],[enable_svg_filters="no"])
314 AC_MSG_RESULT([$enable_svg_filters])
316 # check whether to enable support for SVG fonts
317 AC_MSG_CHECKING([whether to enable support for SVG fonts])
318 AC_ARG_ENABLE(svg_fonts,
319 AC_HELP_STRING([--enable-svg-fonts],
320 [enable support for SVG fonts (experimental) [default=no]]),
321 [],[enable_svg_fonts="no"])
322 AC_MSG_RESULT([$enable_svg_fonts])
324 # check whether to enable foreign objects support for SVG
325 AC_MSG_CHECKING([whether to enable support for SVG foreign objects])
326 AC_ARG_ENABLE(svg_foreign_object,
327 AC_HELP_STRING([--enable-svg-foreign-object],
328 [enable support for SVG foreign objects (experimental) [default=no]]),
329 [],[enable_svg_foreign_object="no"])
330 AC_MSG_RESULT([$enable_svg_foreign_object])
332 # check whether to enable SVG As Image support
333 AC_MSG_CHECKING([whether to enable SVG as Image support])
334 AC_ARG_ENABLE(svg_as_image,
335 AC_HELP_STRING([--enable-svg-as-image],
336 [enable SVG as Image support (experimental) [default=no]]),
337 [],[enable_svg_as_image="no"])
338 AC_MSG_RESULT([$enable_svg_as_image])
340 # check whether to enable SVG USE element support
341 AC_MSG_CHECKING([whether to enable support for SVG use element])
342 AC_ARG_ENABLE(svg_use_element,
343 AC_HELP_STRING([--enable-svg-use-element],
344 [enable SVG use element support (experimental) [default=no]]),
345 [],[enable_svg_use_element="no"])
346 AC_MSG_RESULT([$enable_svg_use_element])
348 # check whether to enable code coverage
349 AC_MSG_CHECKING([whether to enable code coverage support])
350 AC_ARG_ENABLE(coverage,
351 AC_HELP_STRING([--enable-coverage],
352 [enable code coverage support [default=no]]),
353 [],[enable_coverage="no"])
354 AC_MSG_RESULT([$enable_coverage])
356 # check whether to enable FastMalloc
357 AC_MSG_CHECKING([whether to enable optimized memory allocator])
358 AC_ARG_ENABLE(fast_malloc,
359 AC_HELP_STRING([--enable-fast-malloc],
360 [enable optimized memory allocator default=yes, default=no for debug builds]),
361 [],[if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
362 AC_MSG_RESULT([$enable_fast_malloc])
364 # Add '-g' flag to gcc if it's debug build
365 if test "$enable_debug" = "yes"; then
366 CXXFLAGS="$CXXFLAGS -g"
370 # check if curl is available
371 if test "$http_backend" = "curl"; then
372 PKG_CHECK_MODULES([LIBCURL],
373 [libcurl >= $LIBCURL_REQUIRED_VERSION])
374 AC_SUBST([LIBCURL_CFLAGS])
375 AC_SUBST([LIBCURL_LIBS])
378 # check if sqlite 3 is available
379 if test "$enable_icon_database" = "yes" || test "$enable_database" = "yes"; then
380 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
381 AC_SUBST([SQLITE3_CFLAGS])
382 AC_SUBST([SQLITE3_LIBS])
385 # check if libxslt is available
386 if test "$enable_xslt" = "yes"; then
387 PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
388 AC_SUBST([LIBXSLT_CFLAGS])
389 AC_SUBST([LIBXSLT_LIBS])
392 # check if gstreamer is available
393 if test "$enable_video" = "yes"; then
394 PKG_CHECK_MODULES([GSTREAMER],
395 [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
397 gstreamer-plugins-base-0.10,
398 gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION])
399 AC_SUBST([GSTREAMER_CFLAGS])
400 AC_SUBST([GSTREAMER_LIBS])
403 # check for code coverage support
404 if test "$enable_coverage" = "yes"; then
405 COVERAGE_CFLAGS="-MD"
406 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
407 AC_SUBST([COVERAGE_CFLAGS])
408 AC_SUBST([COVERAGE_LDFLAGS])
411 # check for SVG features, enabling SVG if necessary
412 if test "$enable_svg_animation" = "yes" || \
413 test "$enable_svg_filters" = "yes" || \
414 test "$enable_svg_fonts" = "yes" || \
415 test "$enable_svg_foreign_object" = "yes" || \
416 test "$enable_svg_as_image" = "yes" || \
417 test "$enable_svg_use_element" = "yes"; then
419 if test "$enable_svg" = "no"; then
420 AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
426 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
427 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
428 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
429 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
431 # target conditionals
432 AM_CONDITIONAL([TARGET_X11], [test "$with_webkit_target" = "x11"])
433 AM_CONDITIONAL([TARGET_WIN32], [test "$with_webkit_target" = "win32"])
434 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_webkit_target" = "quartz"])
435 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_webkit_target" = "directfb"])
437 # HTTP backend conditionals
438 AM_CONDITIONAL([USE_CURL], [test "$http_backend" = "curl"])
440 # WebKit feature conditionals
441 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
442 AM_CONDITIONAL([ENABLE_CROSS_DOCUMENT_MESSAGING],[test "$enable_cross_document_messaging" = "yes"])
443 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
444 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
445 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
446 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
447 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
448 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
449 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
450 AM_CONDITIONAL([ENABLE_SVG_FILTERS],[test "$enable_svg_filters" = "yes"])
451 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
452 AM_CONDITIONAL([ENABLE_SVG_FOREIGN_OBJECT],[test "$enable_svg_foreign_object" = "yes"])
453 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
454 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use_element" = "yes"])
455 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
456 AM_CONDITIONAL([ENABLE_FAST_MALLOC],[test "$enable_fast_malloc" = "yes"])
457 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
461 WebKit/gtk/webkit-1.0.pc:WebKit/gtk/webkit.pc.in
468 WebKit was configured with the following options:
470 Target : $with_webkit_target
471 Hildon UI extensions : $with_hildon
472 HTTP backend : $http_backend
473 Enable debug : $enable_debug
474 Code coverage support : $enable_coverage
475 Optimized memory allocator : $enable_fast_malloc
476 HTML5 cross-document messaging : $enable_cross_document_messaging
477 HTML5 client-side storage support : $enable_database
478 HTML5 video element support : $enable_video
479 Icon database support : $enable_icon_database
480 SVG support : $enable_svg
481 SVG animation support : $enable_svg_animation
482 SVG filters support : $enable_svg_filters
483 SVG fonts support : $enable_svg_fonts
484 SVG foreign object support : $enable_svg_foreign_object
485 SVG as image support : $enable_svg_as_image
486 SVG use element support : $enable_svg_use_element
487 XPATH support : $enable_xpath
488 XSLT support : $enable_xslt