* platform/win/Skipped: Added some more failures.
[WebKit-https.git] / configure.ac
1 AC_INIT([WebKit],[0.1],[http://bugs.webkit.org/])
2
3 AC_PREREQ(2.59)
4
5 AC_CONFIG_HEADERS([aconfig.h])
6 AC_CONFIG_SRCDIR([WebCore/config.h])
7
8 # see http://www.gnu.org/software/libtool/manual.html#Versioning
9 LIBWEBKITGTK_VERSION=1:0:0
10 AC_SUBST([LIBWEBKITGTK_VERSION])
11
12 AM_INIT_AUTOMAKE([foreign subdir-objects])
13
14 AM_MAINTAINER_MODE
15
16 AC_CANONICAL_HOST
17
18 # host checking - inspired by the GTK+ configure.in
19 # TODO: os_mac, os_bsd
20 AC_MSG_CHECKING([for native Win32])
21 case "$host" in
22      *-*-mingw*)
23        os_win32=yes
24        ;;
25      *)
26        os_win32=no
27        ;;
28 esac
29 AC_MSG_RESULT([$os_win32])
30
31 case "$host" in
32      *-*-linux*)
33        os_linux=yes
34        ;;
35      *-*-freebsd*)
36        os_freebsd=yes
37        ;;
38 esac
39
40 # If CXXFLAGS and CFLAGS are unset, default to -O2
41 # This is to tell automake not to include '-g' if CXXFLAGS is not set
42 # For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
43 if test -z "$CXXFLAGS"; then
44    CXXFLAGS="-O2"
45 fi
46 if test -z "$CFLAGS"; then
47    CFLAGS="-O2"
48 fi
49
50 # programs
51 AC_DISABLE_STATIC
52 AM_PROG_LIBTOOL
53 AC_PROG_INSTALL
54 AM_PROG_CC_STDC
55 AC_PROG_CXX
56 AM_PROG_CC_C_O
57
58 AC_PATH_PROG(PERL, perl)
59 if test -z "$PERL"; then
60    AC_MSG_ERROR([You need 'perl' to compile WebKit])
61 fi
62
63 AC_PATH_PROG(BISON, bison)
64 if test -z "$BISON"; then
65    AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
66 fi
67
68 AC_PATH_PROG(FLEX, flex)
69 if test -z "$FLEX"; then
70    AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
71 fi
72
73 AC_PATH_PROG(GPERF, gperf)
74 if test -z "$GPERF"; then
75    AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
76 fi
77
78 AC_PATH_PROG(MV, mv)
79 if test -z "$MV"; then
80    AC_MSG_ERROR([You need 'mv' to compile WebKit])
81 fi
82
83 # GTK+ port only
84 # Check for glib-genmarshal and glib-mkenums
85 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
86 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
87
88 # Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
89 # doesn't exist)
90 AC_LANG_PUSH([C++])
91 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
92 AC_LANG_POP([C++])
93
94 # C/C++ Language Features
95 AC_C_CONST
96 AC_C_INLINE
97 AC_C_VOLATILE
98
99 # C/C++ Headers
100 AC_HEADER_STDC
101 AC_HEADER_STDBOOL
102
103 # pthread
104 AC_CHECK_HEADERS([pthread.h],
105                  AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exist]),
106                  AC_MSG_ERROR([pthread support is required to build WebKit]))
107
108 # libjpeg headers
109 AC_CHECK_HEADERS([jpeglib.h])
110
111 # check for pkg-config
112 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
113 if test "$PKG_CONFIG" = "no"; then
114    AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed in your PATH])
115 fi
116
117 # check for icu-config
118 AC_PATH_PROG(icu_config, icu-config, no)
119 if test "$icu_config" = "no"; then
120    AC_MSG_ERROR([Cannot find icu-config. ICU library is needed.])
121 fi
122 ICU_CFLAGS=`$icu_config --cflags`
123 ICU_LIBS=`$icu_config --ldflags`
124 AC_SUBST([ICU_CFLAGS])
125 AC_SUBST([ICU_LIBS])
126
127 # determine the GDK/GTK+ target
128 AC_MSG_CHECKING([the target for WebKit GTK+])
129 AC_ARG_WITH(webkit_target,
130             AC_HELP_STRING([--with-webkit-target=@<:@x11/win32/quartz/directfb@:>@],
131                            [Select webkit target [default=x11]]),
132             [],[with_webkit_target="x11"])
133
134 case "$with_webkit_target" in
135      x11|win32|quartz|directfb) ;;
136      *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
137 esac
138
139 AC_MSG_RESULT([$with_webkit_target])
140
141 # minimum base dependencies
142 GLIB_REQUIRED_VERSION=2.0
143 GOBJECT_REQUIRED_VERSION=2.0
144 GTHREAD_REQUIRED_VERSION=2.0
145 PANGO_REQUIRED_VERSION=1.0
146 CAIRO_REQUIRED_VERSION=1.2
147 FONTCONFIG_REQUIRED_VERSION=2.4
148 FREETYPE2_REQUIRED_VERSION=9.0
149 LIBCURL_REQUIRED_VERSION=7.15
150 LIBXML_REQUIRED_VERSION=2.6
151
152 # optional modules
153 GTK_REQUIRED_VERSION=2.0
154 LIBXSLT_REQUIRED_VERSION=1.1.7
155 SQLITE_REQUIRED_VERSION=3.0
156 GSTREAMER_REQUIRED_VERSION=0.10
157 GNOME_VFS_REQUIRED_VERSION=2.0
158
159 PKG_CHECK_MODULES([DEPENDENCIES],
160                   [glib-2.0 >= $GLIB_REQUIRED_VERSION
161                   gobject-2.0 >= $GOBJECT_REQUIRED_VERSION
162                   gthread-2.0 >= $GTHREAD_REQUIRED_VERSION
163                   gtk+-2.0 >= $GTK_REQUIRED_VERSION
164                   pango >= $PANGO_REQUIRED_VERSION
165                   libcurl >= $LIBCURL_REQUIRED_VERSION
166                   cairo >= $CAIRO_REQUIRED_VERSION
167                   cairo-ft,
168                   fontconfig >= $FONTCONFIG_REQUIRED_VERSION
169                   freetype2 >= $FREETYPE2_REQUIRED_VERSION
170                   libxml-2.0 >= $LIBXML_REQUIRED_VERSION])
171 AC_SUBST([DEPENDENCIES_CFLAGS])
172 AC_SUBST([DEPENDENCIES_LIBS])
173
174 # check whether to build with debugging enabled
175 AC_MSG_CHECKING([whether to do a debug build])
176 AC_ARG_ENABLE(debug,
177               AC_HELP_STRING([--enable-debug],
178                              [turn on debugging [default=no]]),
179               [enable_debug="yes"],[enable_debug="no"])
180 AC_MSG_RESULT([$enable_debug])
181
182 # check whether to build with database support
183 AC_MSG_CHECKING([whether to enable HTML5 client-side storage support])
184 AC_ARG_ENABLE(database,
185               AC_HELP_STRING([--enable-database],
186                              [enable HTML5 client-side storage support [default=no]]),
187               [],[enable_database="yes"])
188 AC_MSG_RESULT([$enable_database])
189
190 # check whether to build with icon database support
191 AC_MSG_CHECKING([whether to enable icon database support])
192 AC_ARG_ENABLE(icon_database,
193               AC_HELP_STRING([--enable-icon-database],
194                              [enable icon database [default=no]]),
195               [],[enable_icon_database="no"])
196 AC_MSG_RESULT([$enable_icon_database])
197
198 # check whether to enable HTML5 audio/video support
199 AC_MSG_CHECKING([whether to enable HTML5 video support])
200 AC_ARG_ENABLE(video,
201               AC_HELP_STRING([--enable-video],
202                              [enable HTML5 video support [default=no]]),
203               [enable_video="yes"],[enable_video="no"])
204 AC_MSG_RESULT([$enable_video])
205
206 # check whether to enable XPath support
207 AC_MSG_CHECKING([whether to enable XPath support])
208 AC_ARG_ENABLE(xpath,
209               AC_HELP_STRING([--enable-xpath],
210                              [enable support for XPath [default=no]]),
211               [],[enable_xpath="yes"])
212 AC_MSG_RESULT([$enable_xpath])
213
214 # check whether to enable XSLT support
215 AC_MSG_CHECKING([whether to enable XSLT support])
216 AC_ARG_ENABLE(xslt,
217               AC_HELP_STRING([--enable-xslt],
218                              [enable support for XSLT [default=no]]),
219               [],[enable_xslt="yes"])
220 AC_MSG_RESULT([$enable_xslt])
221
222 # check whether to enable SVG support
223 AC_MSG_CHECKING([whether to enable SVG support])
224 AC_ARG_ENABLE(svg,
225               AC_HELP_STRING([--enable-svg],
226                              [enable support for SVG [default=no]]),
227               [],[enable_svg="no"])
228 AC_MSG_RESULT([$enable_svg])
229
230 # check whether to enable support for SVG animation
231 AC_MSG_CHECKING([whether to enable support for SVG animataion])
232 AC_ARG_ENABLE(svg_animation,
233               AC_HELP_STRING([--enable-svg-animation],
234                              [enable support for SVG animation feature (experimental) [default=no]]),
235               [],[enable_svg_animation="no"])
236 AC_MSG_RESULT([$enable_svg_animation])
237
238 # check whether to enable support for SVG filters
239 AC_MSG_CHECKING([whether to enable support for SVG filters])
240 AC_ARG_ENABLE(svg_filters,
241               AC_HELP_STRING([--enable-svg-filters],
242                              [enable support for SVG filters (experimental) [default=no]]),
243               [],[enable_svg_filters="no"])
244 AC_MSG_RESULT([$enable_svg_filters])
245
246 # check whether to enable support for SVG fonts
247 AC_MSG_CHECKING([whether to enable support for SVG fonts])
248 AC_ARG_ENABLE(svg_fonts,
249               AC_HELP_STRING([--enable-svg-fonts],
250                              [enable support for SVG fonts (experimental) [default=no]]),
251               [],[enable_svg_fonts="no"])
252 AC_MSG_RESULT([$enable_svg_fonts])
253
254 # check whether to enable SVG As Image support
255 AC_MSG_CHECKING([whether to enable SVG as Image support])
256 AC_ARG_ENABLE(svg_as_image,
257               AC_HELP_STRING([--enable-svg-as-image],
258                              [enable SVG as Image support (experimental) [default=no]]),
259               [],[enable_svg_as_image="no"])
260 AC_MSG_RESULT([$enable_svg_as_image])
261
262 # check whether to enable SVG USE element support
263 AC_MSG_CHECKING([whether to enable support for SVG use element])
264 AC_ARG_ENABLE(svg_use_element,
265               AC_HELP_STRING([--enable-svg-use-element],
266                              [enable SVG use element support (experimental) [default=no]]),
267               [],[enable_svg_use_element="no"])
268 AC_MSG_RESULT([$enable_svg_use_element])
269
270 # check whether to enable code coverage
271 AC_MSG_CHECKING([whether to enable code coverage support])
272 AC_ARG_ENABLE(coverage,
273               AC_HELP_STRING([--enable-coverage],
274                              [enable code coverage support [default=no]]),
275               [],[enable_coverage="no"])
276 AC_MSG_RESULT([$enable_coverage])
277
278 # Add '-g' flag to gcc if it's debug build
279 if test "$enable_debug" = "yes"; then
280    CXXFLAGS="$CXXFLAGS -g"
281    CFLAGS="$CFLAGS -g"
282 fi
283
284 # check if sqlite 3 is available
285 if test "$enable_icon_database" = "yes" || test "$enable_database" = "yes"; then
286    PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION])
287    AC_SUBST([SQLITE3_CFLAGS])
288    AC_SUBST([SQLITE3_LIBS])
289 fi
290   
291 # check if libxslt is available
292 if test "$enable_xslt" = "yes"; then
293    PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
294    AC_SUBST([LIBXSLT_CFLAGS])
295    AC_SUBST([LIBXSLT_LIBS])
296 fi
297
298 # check if gstreamer is available
299 if test "$enable_video" = "yes"; then
300    PKG_CHECK_MODULES([GSTREAMER],
301                      [gstreamer-0.10 >= $GSTREAMER_REQUIRED_VERSION
302                      gstreamer-base-0.10,
303                      gstreamer-plugins-base-0.10,
304                      gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION])
305    AC_SUBST([GSTREAMER_CFLAGS])
306    AC_SUBST([GSTREAMER_LIBS])
307 fi
308
309 # check for code coverage support
310 if test "$enable_coverage" = "yes"; then
311    COVERAGE_CFLAGS="-MD"
312    COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
313    AC_SUBST([COVERAGE_CFLAGS])
314    AC_SUBST([COVERAGE_LDFLAGS])
315 fi
316
317 # check for SVG features, enabling SVG if necessary
318 if test "$enable_svg" = "no" && (\
319    test "$enable_svg_animation" = "yes" || \
320    test "$enable_svg_filters" = "yes" || \
321    test "$enable_svg_fonts" = "yes" || \
322    test "$enable_svg_as_image" = "yes" || \
323    test "$enable_svg_use_element" = "yes"); then
324
325    AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
326    enable_svg = yes
327    svg_flags = yes
328 fi
329
330 # OS conditionals
331 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
332 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
333 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
334 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
335
336 # target conditionals
337 AM_CONDITIONAL([TARGET_X11], [test "$with_webkit_target" = "x11"])
338 AM_CONDITIONAL([TARGET_WIN32], [test "$with_webkit_target" = "win32"])
339 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_webkit_target" = "quartz"])
340 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_webkit_target" = "directfb"])
341
342 # WebKit feature conditionals
343 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
344 AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
345 AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
346 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
347 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
348 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
349 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
350 AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"])
351 AM_CONDITIONAL([ENABLE_SVG_FILTERS],[test "$enable_svg_filters" = "yes"])
352 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
353 AM_CONDITIONAL([ENABLE_SVG_AS_IMAGE],[test "$enable_svg_as_image" = "yes"])
354 AM_CONDITIONAL([ENABLE_SVG_USE],[test "$enable_svg_use_element" = "yes"])
355 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
356 AM_CONDITIONAL([SVG_FLAGS],[test "$svg_flags" = "yes"])
357
358 AC_CONFIG_FILES([
359 GNUmakefile
360 WebKit/gtk/WebKitGtk.pc:WebKit/gtk/WebKitGtk.pc.in
361 ]
362 )
363
364 AC_OUTPUT
365
366 echo "
367 WebKit was configured with the following options:
368
369  Target                            : $with_webkit_target
370  Enable debug                      : $enable_debug
371  Code coverage support             : $enable_coverage
372  HTML5 client-side storage support : $enable_database
373  HTML5 video element support       : $enable_video
374  Icon database support             : $enable_icon_database
375  SVG support                       : $enable_svg
376  SVG animation support             : $enable_svg_animation
377  SVG filters support               : $enable_svg_filters
378  SVG fonts support                 : $enable_svg_fonts
379  SVG as image support              : $enable_svg_as_image
380  SVG use element support           : $enable_svg_use_element
381  XPATH support                     : $enable_xpath
382  XSLT support                      : $enable_xslt
383 "