3 # Check for libjpeg the way Gtk does it.
4 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, jpeg_ok=yes, jpeg_ok=no AC_MSG_ERROR([JPEG library (libjpeg) not found]))
5 if test "$jpeg_ok" = yes; then
6 AC_MSG_CHECKING([for jpeglib])
13 ], jpeg_ok=yes, jpeg_ok=no)
14 AC_MSG_RESULT($jpeg_ok)
15 if test "$jpeg_ok" = yes; then
17 # Should we check for progressive JPEG like GTK+ as well?
19 AC_MSG_ERROR([JPEG library (libjpeg) not found])
24 # Check for libpng the way Gtk+ does it.
25 for l in libpng libpng14 libpng12; do
26 AC_MSG_CHECKING(for $l)
27 if $PKG_CONFIG --exists $l ; then
29 PNG_LIBS=`$PKG_CONFIG --libs $l`
37 if test "$png_ok" != yes; then
38 AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no)],
39 AC_MSG_ERROR([PNG library (libpng) not found]), -lz -lm)
40 if test "$png_ok" = yes; then
41 AC_MSG_CHECKING([for png_structp in png.h])
44 ], [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;], png_ok=yes, png_ok=no)
45 AC_MSG_RESULT($png_ok)
46 if test "$png_ok" = yes; then
49 AC_MSG_ERROR([PNG library (libpng) not found])
52 AC_MSG_ERROR([PNG library (libpng) not found])
57 # Check for WebP Image support.
58 AC_CHECK_HEADERS([webp/decode.h], [WEBP_LIBS='-lwebp'], [AC_MSG_ERROR([WebP library (libwebp) not found])])
61 if test "$os_win32" = "yes"; then
63 SHLWAPI_LIBS=-lshlwapi
66 AC_SUBST([WINMM_LIBS])
67 AC_SUBST([SHLWAPI_LIBS])
68 AC_SUBST([OLE32_LIBS])
71 2.0) GTK_REQUIRED_VERSION=gtk2_required_version
73 WEBKITGTK_API_MAJOR_VERSION=1
74 WEBKITGTK_API_MINOR_VERSION=0
75 WEBKITGTK_API_VERSION=1.0
76 WEBKITGTK_PC_NAME=webkit
78 GAIL_REQUIRED_VERSION=gail2_required_version
80 3.0) GTK_REQUIRED_VERSION=gtk3_required_version
82 WEBKITGTK_API_MAJOR_VERSION=3
83 WEBKITGTK_API_MINOR_VERSION=0
84 WEBKITGTK_API_VERSION=3.0
85 WEBKITGTK_PC_NAME=webkitgtk
87 GAIL_REQUIRED_VERSION=gail3_required_version
90 AC_SUBST([WEBKITGTK_API_MAJOR_VERSION])
91 AC_SUBST([WEBKITGTK_API_MINOR_VERSION])
92 AC_SUBST([WEBKITGTK_API_VERSION])
93 AC_SUBST([WEBKITGTK_PC_NAME])
94 AC_SUBST([GTK_API_VERSION])
97 # Check for glib and required utilities. This macro is named as if it interacts
98 # with automake, but it doesn't. Thus it doesn't need to be in the automake section.
99 AM_PATH_GLIB_2_0(glib_required_version, :, :, gmodule gobject gthread gio)
100 if test -z "$GLIB_GENMARSHAL" || test -z "$GLIB_MKENUMS"; then
101 AC_MSG_ERROR([You need the GLib dev tools in your path])
105 GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
106 AC_SUBST(GLIB_COMPILE_RESOURCES)
109 # TODO: use pkg-config (after CFLAGS in their .pc files are cleaned up).
112 UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
113 UNICODE_LIBS="-licucore"
117 UNICODE_LIBS="-licui18n -licuuc"
120 AC_PATH_PROG(icu_config, icu-config, no)
121 if test "$icu_config" = "no"; then
122 AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
125 # We don't use --cflags as this gives us a lot of things that we don't necessarily want,
126 # like debugging and optimization flags. See man (1) icu-config for more info.
127 UNICODE_CFLAGS=`$icu_config --cppflags`
128 UNICODE_LIBS=`$icu_config --ldflags-libsonly`
132 AC_SUBST([UNICODE_CFLAGS])
133 AC_SUBST([UNICODE_LIBS])
135 PKG_CHECK_MODULES([ZLIB], [zlib])
136 AC_SUBST([ZLIB_CFLAGS])
137 AC_SUBST([ZLIB_LIBS])
139 GETTEXT_PACKAGE=WebKitGTK-$GTK_API_VERSION
140 AC_SUBST(GETTEXT_PACKAGE)
142 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= libxml_required_version)
143 AC_SUBST(LIBXML_CFLAGS)
144 AC_SUBST(LIBXML_LIBS)
146 PKG_CHECK_MODULES(PANGO, [pango >= pango_required_version pangoft2])
147 AC_SUBST(PANGO_CFLAGS)
150 if test "$enable_spellcheck" = "yes"; then
151 PKG_CHECK_MODULES(ENCHANT, enchant >= enchant_required_version, [], [enable_spellcheck="no"])
152 AC_SUBST(ENCHANT_CFLAGS)
153 AC_SUBST(ENCHANT_LIBS)
156 PKG_CHECK_MODULES(GAIL, $GAIL_PC_NAME >= $GAIL_REQUIRED_VERSION)
157 AC_SUBST(GAIL_CFLAGS)
160 # Check for target-specific dependencies.
161 if test "$with_target" = "directfb"; then
162 PKG_CHECK_MODULES(CAIRO, cairo-directfb >= cairo_required_version)
163 PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
165 PKG_CHECK_MODULES(CAIRO, cairo >= cairo_required_version)
166 PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
168 if test "$with_target" = "x11" && test "$os_win32" = "no"; then
169 PKG_CHECK_MODULES([XT], [xt], [xt_has_pkg_config=yes], [xt_has_pkg_config=no])
171 # Some old versions of Xt do not provide xt.pc, so try to link against Xt
172 # and if it's installed fall back to just adding -lXt.
173 if test "$xt_has_pkg_config" = "no"; then
174 # Using AC_CHECK_LIB instead of AC_SEARCH_LIB is fine in this case as we don't care
175 # about the XtOpenDisplay symbol but only about the existence of libXt.
176 AC_CHECK_LIB([Xt], [XtOpenDisplay], [XT_CFLAGS=""; XT_LIBS="-lXt"],
177 [AC_MSG_ERROR([X Toolkit Intrinsics library (libXt) not found])])
180 AC_SUBST([XT_CFLAGS])
186 AC_SUBST(CAIRO_CFLAGS)
192 AC_CHECK_HEADERS([GL/glx.h], [have_glx="yes"], [have_glx="no"])
193 AC_MSG_CHECKING([whether to enable GLX support])
194 if test "$enable_glx" != "no"; then
195 if test "$have_glx" = "no"; then
196 if test "$enable_glx" = "yes"; then
197 AC_MSG_ERROR([--enable-glx specified, but not available])
201 elif test "$enable_gles2" != "yes"; then
205 AC_MSG_RESULT([$enable_glx])
208 AC_CHECK_HEADERS([EGL/egl.h], [have_egl="yes"], [have_egl="no"])
209 AC_MSG_CHECKING([whether to enable EGL support])
210 if test "$enable_egl" != "no"; then
211 if test "$have_egl" = "no"; then
212 if test "$enable_egl" = "yes"; then
213 AC_MSG_ERROR([--enable-egl specified, but not available])
221 AC_MSG_RESULT([$enable_egl])
224 AC_CHECK_HEADERS([GLES2/gl2.h], [have_gles2="yes"], [have_gles2="no"])
225 AC_MSG_CHECKING([whether to use OpenGL ES 2 support])
226 if test "$enable_glx" = "yes"; then
227 if test "$enable_gles2" = "yes"; then
228 AC_MSG_ERROR([Cannot enable OpenGL ES 2 support with GLX])
233 if test "$enable_egl" = "no"; then
234 if test "$enable_gles2" = "yes"; then
235 AC_MSG_ERROR([Cannot enable OpenGL ES 2 support without EGL])
240 if test "$enable_gles2" != "no"; then
241 if test "$have_gles2" = "no"; then
242 if test "$enable_gles2" = "yes"; then
243 AC_MSG_ERROR([--enable-gles2 specified, but not available])
252 AC_MSG_RESULT([$enable_gles2])
254 if test "$enable_gles2" != "yes"; then
255 AC_CHECK_HEADERS([GL/gl.h], [found_opengl="yes"], [])
258 if test "$with_acceleration_backend" = "auto"; then
259 if test "$found_opengl" = "yes"; then
260 with_acceleration_backend="opengl";
262 with_acceleration_backend="none";
266 if test "$with_acceleration_backend" = "opengl"; then
267 PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite]);
268 PKG_CHECK_MODULES([XDAMAGE], [xdamage]);
269 AC_SUBST(XCOMPOSITE_CFLAGS)
270 AC_SUBST(XCOMPOSITE_LIBS)
271 AC_SUBST(XDAMAGE_CFLAGS)
272 AC_SUBST(XDAMAGE_LIBS)
275 # OpenGL is turned on by default (along with WebGL and accelerated compositing), but if Clutter is chosen
276 # as the accelerated drawing backend, we want to disable it. COGL does not play well with OpenGL.
277 if test "$enable_webgl" = "auto"; then
278 if test "$with_acceleration_backend" = "opengl"; then
285 if test "$enable_webgl" = "yes" && test "$with_acceleration_backend" != "opengl"; then
286 AC_MSG_ERROR([OpenGL must be active (and Clutter disabled) to use WebGL.])
289 if test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "none"; then
290 AC_MSG_ERROR([OpenGL or Clutter must be active to use accelerated compositing.])
293 if test "$enable_accelerated_compositing" = "auto"; then
294 if test "$with_acceleration_backend" != "none"; then
295 enable_accelerated_compositing="yes";
297 enable_accelerated_compositing="no";
300 if test "$enable_gamepad" = "yes" && test "$os_linux" = no; then
301 AC_MSG_WARN([Gamepad support is only available on Linux. Disabling Gamepad support.])
305 # Turn off svg features if --disable-svg is requested.
306 if test "$enable_svg" = "no"; then
310 # Check for SVG features, enabling SVG if necessary.
311 if test "$enable_svg_fonts" = "yes" && test "$enable_svg" = "no"; then
312 AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
316 if test "$enable_opcode_stats" = "yes"; then
317 if test "$enable_jit" = "yes"; then
318 AC_MSG_ERROR([JIT must be disabled for Opcode stats to work.])
322 case "$enable_jit" in
323 yes) JSC_CPPFLAGS="-DENABLE_JIT=1" ;;
324 no) JSC_CPPFLAGS="-DENABLE_JIT=0" ;;
325 *) enable_jit="autodetect" ;;
327 AC_SUBST(JSC_CPPFLAGS)
330 # Enable CSS Filters and Shaders if accelerated_compositing is turned on.
331 enable_css_filters=no;
332 enable_css_shaders=no;
333 AC_MSG_CHECKING([whether to enable CSS Filters and Shaders])
334 if test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"; then
335 enable_css_filters=yes;
336 enable_css_shaders=yes;
338 AC_MSG_RESULT([$enable_css_filters])
346 if test "$enable_introspection" = "yes"; then
347 PKG_CHECK_MODULES([INTROSPECTION],[gobject-introspection-1.0 >= gobject_introspection_required])
349 G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
350 G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
351 G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
354 AC_SUBST([G_IR_SCANNER])
355 AC_SUBST([G_IR_COMPILER])
356 AC_SUBST([G_IR_GENERATE])
358 PKG_CHECK_MODULES([LIBSOUP], [libsoup-2.4 >= libsoup_required_version])
359 AC_SUBST([LIBSOUP_CFLAGS])
360 AC_SUBST([LIBSOUP_LIBS])
362 PKG_CHECK_MODULES([LIBSECRET], [libsecret-1])
363 AC_SUBST([LIBSECRET_CFLAGS])
364 AC_SUBST([LIBSECRET_LIBS])
366 # Check if FreeType/FontConfig are available.
367 if test "$with_target" = "directfb"; then
368 PKG_CHECK_MODULES([FREETYPE],
369 [fontconfig >= fontconfig_required_version freetype2 >= freetype2_required_version harfbuzz])
371 PKG_CHECK_MODULES([FREETYPE],
372 [cairo-ft fontconfig >= fontconfig_required_version freetype2 >= freetype2_required_version harfbuzz])
374 AC_SUBST([FREETYPE_CFLAGS])
375 AC_SUBST([FREETYPE_LIBS])
377 # Check if SQLite3 is available. Error out only if one of the features hard-depending
378 # on it is enabled while SQLite3 is unavailable.
379 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= sqlite_required_version], [sqlite3_has_pkg_config=yes], [sqlite3_has_pkg_config=no])
380 if test "$sqlite3_has_pkg_config" = "no"; then
381 AC_SEARCH_LIBS([sqlite3_open16], [sqlite3],
382 [sqlite3_found=yes; SQLITE3_LIBS="$LIBS"; SQLITE3_CFLAGS="-I $srcdir/WebKitLibraries/WebCoreSQLite3"], [sqlite3_found=no])
384 AC_SUBST([SQLITE3_CFLAGS])
385 AC_SUBST([SQLITE3_LIBS])
387 if (test "$sqlite3_found" = "no"); then
388 AC_MSG_ERROR([SQLite3 is required for the Database related features])
391 # Check if libxslt is available.
392 if test "$enable_xslt" = "yes"; then
393 PKG_CHECK_MODULES([LIBXSLT],[libxslt >= libxslt_required_version])
394 AC_SUBST([LIBXSLT_CFLAGS])
395 AC_SUBST([LIBXSLT_LIBS])
398 # Check if geoclue is available.
399 if test "$enable_geolocation" = "yes"; then
400 PKG_CHECK_MODULES([GEOCLUE], [geoclue])
401 AC_SUBST([GEOCLUE_CFLAGS])
402 AC_SUBST([GEOCLUE_LIBS])
405 # Check for XRender under Linux/Unix. Some linkers require explicit linkage (like GNU Gold),
406 # so we cannot rely on GTK+ pulling XRender.
407 if test "$os_win32" = "no"; then
408 PKG_CHECK_MODULES([XRENDER], [xrender])
409 AC_SUBST([XRENDER_CFLAGS])
410 AC_SUBST([XRENDER_LIBS])
413 if test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"; then
414 PKG_CHECK_MODULES([GSTREAMER], [
415 gstreamer-1.0 >= gstreamer_required_version
416 gstreamer-plugins-base-1.0 >= gstreamer_plugins_base_required_version
421 gstreamer-pbutils-1.0,
422 gstreamer-video-1.0])
423 AC_SUBST([GSTREAMER_CFLAGS])
424 AC_SUBST([GSTREAMER_LIBS])
427 acceleration_backend_description=$with_acceleration_backend
428 if test "$with_acceleration_backend" = "clutter"; then
429 PKG_CHECK_MODULES(CLUTTER, clutter-1.0 >= clutter_required_version)
430 PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-1.0 >= clutter_gtk_required_version])
432 AC_SUBST(CLUTTER_CFLAGS)
433 AC_SUBST(CLUTTER_LIBS)
434 AC_SUBST(CLUTTER_GTK_CFLAGS)
435 AC_SUBST(CLUTTER_GTK_LIBS)
442 if test "$with_acceleration_backend" = "opengl"; then
443 if test "$enable_gles2" = "yes"; then
444 acceleration_backend_description+= "(gles2"
445 OPENGL_LIBS="-lGLESv2"
447 acceleration_backend_description+="(gl"
450 if test "$enable_egl" = "yes"; then
451 acceleration_backend_description+=", egl"
452 OPENGL_LIBS+=" -lEGL"
454 if test "$enable_glx" = "yes"; then
455 acceleration_backend_description+=", glx"
458 # Check whether dlopen() is in the core libc like on FreeBSD, or in a separate
459 # libdl like on GNU/Linux (in which case we want to link to libdl).
460 AC_CHECK_FUNC([dlopen], [], [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
461 AC_SUBST([DLOPEN_LIBS])
463 OPENGL_LIBS+=" $DLOPEN_LIBS"
464 acceleration_backend_description+=")"
466 AC_SUBST([OPENGL_LIBS])
468 if test "$enable_gamepad" = "yes"; then
469 PKG_CHECK_MODULES([GAMEPAD], [gio-unix-2.0 gudev-1.0])
471 AC_SUBST(GAMEPAD_CFLAGS)
472 AC_SUBST(GAMEPAD_LIBS)
475 # Check whether to enable code coverage support.
476 if test "$enable_coverage" = "yes"; then
477 COVERAGE_CFLAGS="-MD"
478 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
479 AC_SUBST([COVERAGE_CFLAGS])
480 AC_SUBST([COVERAGE_LDFLAGS])
483 if test "$enable_webkit2" = "yes"; then
484 if test "$GTK_API_VERSION" = "2.0"; then
485 AC_MSG_ERROR([WebKit2 requires GTK+ 3.x, use --with-gtk=3.0])
488 # Make sure we have GTK+ 2.x to build the plugin process.
489 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= gtk2_required_version gail >= gail2_required_version)
490 AC_SUBST(GTK2_CFLAGS)
493 # Check Unix printing
494 PKG_CHECK_MODULES(GTK_UNIX_PRINTING, gtk+-unix-print-3.0, [have_gtk_unix_printing=yes], [have_gtk_unix_printing=no])
495 AC_SUBST(GTK_UNIX_PRINTING_CFLAGS)
496 AC_SUBST(GTK_UNIX_PRINTING_LIBS)
498 # On some Linux/Unix platforms, shm_* may only be available if linking against librt
499 if test "$os_win32" = "no"; then
500 AC_SEARCH_LIBS([shm_open], [rt], [SHM_LIBS="-lrt"])
505 # We need atspi2 for Webkit2 unit tests.
506 if test "$enable_webkit2" = "yes"; then
507 PKG_CHECK_MODULES([ATSPI2], [atspi-2 >= atspi2_required_version], [have_atspi2=yes], [have_atspi2=no])
508 AC_SUBST([ATSPI2_CFLAGS])
509 AC_SUBST([ATSPI2_LIBS])
512 GTK_DOC_CHECK([1.10])