[GTK] remove bashism from configure
[WebKit-https.git] / Source / autotools / FindDependencies.m4
1 PKG_PROG_PKG_CONFIG
2
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])
7     AC_TRY_CPP([
8 #include <stdio.h>
9 #undef PACKAGE
10 #undef VERSION
11 #undef HAVE_STDLIB_H
12 #include <jpeglib.h>
13 ], jpeg_ok=yes, jpeg_ok=no)
14     AC_MSG_RESULT($jpeg_ok)
15     if test "$jpeg_ok" = yes; then
16         JPEG_LIBS="-ljpeg"
17         # Should we check for progressive JPEG like GTK+ as well?
18     else
19         AC_MSG_ERROR([JPEG library (libjpeg) not found])
20     fi
21 fi
22 AC_SUBST([JPEG_LIBS])
23
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
28         AC_MSG_RESULT(yes)
29         PNG_LIBS=`$PKG_CONFIG --libs $l`
30         png_ok=yes
31         break
32     else
33         AC_MSG_RESULT(no)
34         png_ok=no
35     fi
36 done
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])
42         AC_TRY_COMPILE([
43 #include <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
47             PNG_LIBS='-lpng -lz'
48         else
49             AC_MSG_ERROR([PNG library (libpng) not found])
50         fi
51     else
52         AC_MSG_ERROR([PNG library (libpng) not found])
53     fi
54 fi
55 AC_SUBST([PNG_LIBS])
56
57 # Check for WebP Image support.
58 AC_CHECK_HEADERS([webp/decode.h], [WEBP_LIBS='-lwebp'], [AC_MSG_ERROR([WebP library (libwebp) not found])])
59 AC_SUBST([WEBP_LIBS])
60
61 if test "$os_win32" = "yes"; then
62     WINMM_LIBS=-lwinmm
63     SHLWAPI_LIBS=-lshlwapi
64     OLE32_LIBS=-lole32
65 fi
66 AC_SUBST([WINMM_LIBS])
67 AC_SUBST([SHLWAPI_LIBS])
68 AC_SUBST([OLE32_LIBS])
69
70 case "$with_gtk" in
71     2.0) GTK_REQUIRED_VERSION=gtk2_required_version
72         GTK_API_VERSION=2.0
73         WEBKITGTK_API_MAJOR_VERSION=1
74         WEBKITGTK_API_MINOR_VERSION=0
75         WEBKITGTK_API_VERSION=1.0
76         WEBKITGTK_PC_NAME=webkit
77         GAIL_PC_NAME=gail
78         GAIL_REQUIRED_VERSION=gail2_required_version
79         ;;
80     3.0) GTK_REQUIRED_VERSION=gtk3_required_version
81         GTK_API_VERSION=3.0
82         WEBKITGTK_API_MAJOR_VERSION=3
83         WEBKITGTK_API_MINOR_VERSION=0
84         WEBKITGTK_API_VERSION=3.0
85         WEBKITGTK_PC_NAME=webkitgtk
86         GAIL_PC_NAME=gail-3.0
87         GAIL_REQUIRED_VERSION=gail3_required_version
88         ;;
89 esac
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])
95
96
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])
102 fi
103
104 # GResources
105 GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
106 AC_SUBST(GLIB_COMPILE_RESOURCES)
107 GLIB_GSETTINGS
108
109 # TODO: use pkg-config (after CFLAGS in their .pc files are cleaned up).
110 case "$host" in
111     *-*-darwin*)
112         UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
113         UNICODE_LIBS="-licucore"
114         ;;
115     *-*-mingw*)
116         UNICODE_CFLAGS=""
117         UNICODE_LIBS="-licui18n -licuuc"
118         AC_CHECK_HEADERS([unicode/uchar.h], [], [AC_MSG_ERROR([Could not find ICU headers.])])
119         ;;
120     *)
121         AC_PATH_PROG(icu_config, icu-config, no)
122         if test "$icu_config" = "no"; then
123             AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
124         fi
125
126         # We don't use --cflags as this gives us a lot of things that we don't necessarily want,
127         # like debugging and optimization flags. See man (1) icu-config for more info.
128         UNICODE_CFLAGS=`$icu_config --cppflags`
129         UNICODE_LIBS=`$icu_config --ldflags-libsonly`
130         ;;
131 esac
132
133 AC_SUBST([UNICODE_CFLAGS])
134 AC_SUBST([UNICODE_LIBS])
135
136 PKG_CHECK_MODULES([ZLIB], [zlib])
137 AC_SUBST([ZLIB_CFLAGS])
138 AC_SUBST([ZLIB_LIBS])
139
140 GETTEXT_PACKAGE=WebKitGTK-$GTK_API_VERSION
141 AC_SUBST(GETTEXT_PACKAGE)
142
143 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= libxml_required_version)
144 AC_SUBST(LIBXML_CFLAGS)
145 AC_SUBST(LIBXML_LIBS)
146
147 PKG_CHECK_MODULES(PANGO, [pango >= pango_required_version pangoft2])
148 AC_SUBST(PANGO_CFLAGS)
149 AC_SUBST(PANGO_LIBS)
150
151 if test "$enable_spellcheck" = "yes"; then
152     PKG_CHECK_MODULES(ENCHANT, enchant >= enchant_required_version, [], [enable_spellcheck="no"])
153     AC_SUBST(ENCHANT_CFLAGS)
154     AC_SUBST(ENCHANT_LIBS)
155 fi
156
157 PKG_CHECK_MODULES(GAIL, $GAIL_PC_NAME >= $GAIL_REQUIRED_VERSION)
158 AC_SUBST(GAIL_CFLAGS)
159 AC_SUBST(GAIL_LIBS)
160
161 # Check for target-specific dependencies.
162 if test "$with_target" = "directfb"; then
163     PKG_CHECK_MODULES(CAIRO, cairo-directfb >= cairo_required_version)
164     PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
165 else
166     PKG_CHECK_MODULES(CAIRO, cairo >= cairo_required_version)
167     PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
168
169     if test "$with_target" = "x11" && test "$os_win32" = "no"; then
170         PKG_CHECK_MODULES([XT], [xt], [xt_has_pkg_config=yes], [xt_has_pkg_config=no])
171
172         # Some old versions of Xt do not provide xt.pc, so try to link against Xt
173         # and if it's installed fall back to just adding -lXt.
174         if test "$xt_has_pkg_config" = "no"; then
175             # Using AC_CHECK_LIB instead of AC_SEARCH_LIB is fine in this case as we don't care
176             # about the XtOpenDisplay symbol but only about the existence of libXt.
177             AC_CHECK_LIB([Xt], [XtOpenDisplay], [XT_CFLAGS=""; XT_LIBS="-lXt"],
178                 [AC_MSG_ERROR([X Toolkit Intrinsics library (libXt) not found])])
179         fi
180
181         AC_SUBST([XT_CFLAGS])
182         AC_SUBST([XT_LIBS])
183    fi
184 fi
185 AC_SUBST(GTK_CFLAGS)
186 AC_SUBST(GTK_LIBS)
187 AC_SUBST(CAIRO_CFLAGS)
188 AC_SUBST(CAIRO_LIBS)
189
190
191 found_opengl=no
192 have_glx=no
193 AC_CHECK_HEADERS([GL/glx.h], [have_glx="yes"], [have_glx="no"])
194 AC_MSG_CHECKING([whether to enable GLX support])
195 if test "$enable_glx" != "no"; then
196     if test "$have_glx" = "no"; then
197         if test "$enable_glx" = "yes"; then
198             AC_MSG_ERROR([--enable-glx specified, but not available])
199         else
200             enable_glx=no
201         fi
202     elif test "$enable_gles2" != "yes"; then
203         enable_glx=yes
204     fi
205 fi
206 AC_MSG_RESULT([$enable_glx])
207
208 have_egl=no
209 AC_CHECK_HEADERS([EGL/egl.h], [have_egl="yes"], [have_egl="no"])
210 AC_MSG_CHECKING([whether to enable EGL support])
211 if test "$enable_egl" != "no"; then
212     if test "$have_egl" = "no"; then
213         if test "$enable_egl" = "yes"; then
214             AC_MSG_ERROR([--enable-egl specified, but not available])
215         else
216             enable_egl=no
217         fi
218     else
219         enable_egl=yes
220     fi
221 fi
222 AC_MSG_RESULT([$enable_egl])
223
224 have_gles2=no
225 AC_CHECK_HEADERS([GLES2/gl2.h], [have_gles2="yes"], [have_gles2="no"])
226 AC_MSG_CHECKING([whether to use OpenGL ES 2 support])
227 if test "$enable_glx" = "yes"; then
228     if test "$enable_gles2" = "yes"; then
229         AC_MSG_ERROR([Cannot enable OpenGL ES 2 support with GLX])
230     else
231         enable_gles2=no
232     fi
233 fi
234 if test "$enable_egl" = "no"; then
235     if test "$enable_gles2" = "yes"; then
236         AC_MSG_ERROR([Cannot enable OpenGL ES 2 support without EGL])
237     else
238         enable_gles2=no
239     fi
240 fi
241 if test "$enable_gles2" != "no"; then
242     if test "$have_gles2" = "no"; then
243         if test "$enable_gles2" = "yes"; then
244             AC_MSG_ERROR([--enable-gles2 specified, but not available])
245         else
246             enable_gles2=no
247         fi
248    else
249         enable_gles2=yes
250         found_opengl=yes
251    fi
252 fi
253 AC_MSG_RESULT([$enable_gles2])
254
255 if test "$enable_gles2" != "yes"; then
256     AC_CHECK_HEADERS([GL/gl.h], [found_opengl="yes"], [])
257 fi
258
259 if test "$with_acceleration_backend" = "auto"; then
260     if test "$found_opengl" = "yes"; then
261         with_acceleration_backend="opengl";
262     else
263         with_acceleration_backend="none";
264     fi
265 fi
266
267 if test "$with_acceleration_backend" = "opengl"; then
268     PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite]);
269     PKG_CHECK_MODULES([XDAMAGE], [xdamage]);
270     AC_SUBST(XCOMPOSITE_CFLAGS)
271     AC_SUBST(XCOMPOSITE_LIBS)
272     AC_SUBST(XDAMAGE_CFLAGS)
273     AC_SUBST(XDAMAGE_LIBS)
274 fi
275
276 # OpenGL is turned on by default (along with WebGL and accelerated compositing), but if Clutter is chosen
277 # as the accelerated drawing backend, we want to disable it. COGL does not play well with OpenGL.
278 if test "$enable_webgl" = "auto"; then
279     if test "$with_acceleration_backend" = "opengl"; then
280         enable_webgl="yes";
281     else
282         enable_webgl="no";
283     fi
284 fi
285
286 if test "$enable_webgl" = "yes" && test "$with_acceleration_backend" != "opengl"; then
287     AC_MSG_ERROR([OpenGL must be active (and Clutter disabled) to use WebGL.])
288 fi;
289
290 if test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "none"; then
291     AC_MSG_ERROR([OpenGL or Clutter must be active to use accelerated compositing.])
292 fi
293
294 if test "$enable_accelerated_compositing" = "auto"; then
295     if test "$with_acceleration_backend" != "none"; then
296         enable_accelerated_compositing="yes";
297     else
298         enable_accelerated_compositing="no";
299     fi
300 fi
301
302 if test "$enable_gamepad" = "yes" && test "$os_linux" = no; then
303     AC_MSG_WARN([Gamepad support is only available on Linux. Disabling Gamepad support.])
304     enable_gamepad=no;
305 fi
306
307 # Turn off svg features if --disable-svg is requested.
308 if test "$enable_svg" = "no"; then
309    enable_svg_fonts=no
310 fi
311
312 # Check for SVG features, enabling SVG if necessary.
313 if test "$enable_svg_fonts" = "yes" && test "$enable_svg" = "no"; then
314     AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
315     enable_svg=yes
316 fi
317
318 if test "$enable_opcode_stats" = "yes"; then
319     if test "$enable_jit" = "yes"; then
320         AC_MSG_ERROR([JIT must be disabled for Opcode stats to work.])
321     fi
322 fi
323
324 case "$enable_jit" in
325     yes) JSC_CPPFLAGS="-DENABLE_JIT=1" ;;
326     no) JSC_CPPFLAGS="-DENABLE_JIT=0" ;;
327     *) enable_jit="autodetect" ;;
328 esac
329 AC_SUBST(JSC_CPPFLAGS)
330
331
332 # Enable CSS Filters and Shaders if accelerated_compositing is turned on.
333 enable_css_filters=no;
334 enable_css_shaders=no;
335 AC_MSG_CHECKING([whether to enable CSS Filters and Shaders])
336 if test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"; then
337     enable_css_filters=yes;
338     enable_css_shaders=yes;
339 fi
340 AC_MSG_RESULT([$enable_css_filters])
341
342 G_IR_SCANNER=
343 G_IR_COMPILER=
344 G_IR_GENERATE=
345 GIRDIR=
346 GIRTYPELIBDIR=
347
348 if test "$enable_introspection" = "yes"; then
349     PKG_CHECK_MODULES([INTROSPECTION],[gobject-introspection-1.0 >= gobject_introspection_required_version])
350
351     G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
352     G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
353     G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
354 fi
355
356 AC_SUBST([G_IR_SCANNER])
357 AC_SUBST([G_IR_COMPILER])
358 AC_SUBST([G_IR_GENERATE])
359
360 PKG_CHECK_MODULES([LIBSOUP], [libsoup-2.4 >= libsoup_required_version])
361 AC_SUBST([LIBSOUP_CFLAGS])
362 AC_SUBST([LIBSOUP_LIBS])
363
364 if test "$enable_credential_storage" = "yes"; then
365     PKG_CHECK_MODULES([LIBSECRET], [libsecret-1])
366     AC_SUBST([LIBSECRET_CFLAGS])
367     AC_SUBST([LIBSECRET_LIBS])
368 fi
369
370 # Check if FreeType/FontConfig are available.
371 if test "$with_target" = "directfb"; then
372     PKG_CHECK_MODULES([FREETYPE],
373         [fontconfig >= fontconfig_required_version freetype2 >= freetype2_required_version harfbuzz >= harfbuzz_required_version])
374 else
375     PKG_CHECK_MODULES([FREETYPE],
376         [cairo-ft fontconfig >= fontconfig_required_version freetype2 >= freetype2_required_version harfbuzz >= harfbuzz_required_version])
377 fi
378 # HarfBuzz 0.9.18 splits harbuzz-icu into a separate library.
379 # Since we support earlier HarfBuzz versions we keep this conditional for now.
380 if $PKG_CONFIG --atleast-version 0.9.18 harfbuzz; then
381     PKG_CHECK_MODULES(HARFBUZZ_ICU, harfbuzz-icu >= $harfbuzz_required_version)
382     FREETYPE_CFLAGS="$FREETYPE_CFLAGS $HARFBUZZ_ICU_CFLAGS"
383     FREETYPE_LIBS="$FREETYPE_LIBS $HARFBUZZ_ICU_LIBS"
384 fi
385 AC_SUBST([FREETYPE_CFLAGS])
386 AC_SUBST([FREETYPE_LIBS])
387
388 # Check if SQLite3 is available. Error out only if one of the features hard-depending
389 # on it is enabled while SQLite3 is unavailable.
390 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= sqlite_required_version], [sqlite3_has_pkg_config=yes], [sqlite3_has_pkg_config=no])
391 if test "$sqlite3_has_pkg_config" = "no"; then
392     AC_SEARCH_LIBS([sqlite3_open16], [sqlite3],
393         [sqlite3_found=yes; SQLITE3_LIBS="$LIBS"; SQLITE3_CFLAGS="-I $srcdir/WebKitLibraries/WebCoreSQLite3"], [sqlite3_found=no])
394 fi
395 AC_SUBST([SQLITE3_CFLAGS])
396 AC_SUBST([SQLITE3_LIBS])
397
398 if (test "$sqlite3_found" = "no"); then
399     AC_MSG_ERROR([SQLite3 is required for the Database related features])
400 fi
401
402 PKG_CHECK_MODULES([LIBXSLT],[libxslt >= libxslt_required_version])
403 AC_SUBST([LIBXSLT_CFLAGS])
404 AC_SUBST([LIBXSLT_LIBS])
405
406 # Check if geoclue is available.
407 if test "$enable_geolocation" = "yes"; then
408     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
409     AC_SUBST([GEOCLUE_CFLAGS])
410     AC_SUBST([GEOCLUE_LIBS])
411 fi
412
413 # Check for XRender under Linux/Unix. Some linkers require explicit linkage (like GNU Gold),
414 # so we cannot rely on GTK+ pulling XRender.
415 if test "$with_target" = "x11"; then
416     PKG_CHECK_MODULES([XRENDER], [xrender])
417     AC_SUBST([XRENDER_CFLAGS])
418     AC_SUBST([XRENDER_LIBS])
419 fi
420
421 if test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"; then
422     PKG_CHECK_MODULES([GSTREAMER], [
423         gstreamer-1.0 >= gstreamer_required_version
424         gstreamer-plugins-base-1.0 >= gstreamer_plugins_base_required_version
425         gstreamer-app-1.0
426         gstreamer-audio-1.0,
427         gstreamer-fft-1.0,
428         gstreamer-base-1.0,
429         gstreamer-pbutils-1.0,
430         gstreamer-video-1.0])
431     AC_SUBST([GSTREAMER_CFLAGS])
432     AC_SUBST([GSTREAMER_LIBS])
433 fi
434
435 acceleration_backend_description=$with_acceleration_backend
436 if test "$with_acceleration_backend" = "clutter"; then
437     PKG_CHECK_MODULES(CLUTTER, clutter-1.0 >= clutter_required_version)
438     PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-1.0 >= clutter_gtk_required_version])
439
440     AC_SUBST(CLUTTER_CFLAGS)
441     AC_SUBST(CLUTTER_LIBS)
442     AC_SUBST(CLUTTER_GTK_CFLAGS)
443     AC_SUBST(CLUTTER_GTK_LIBS)
444
445     enable_gles2=no
446     enable_glx=no
447     enable_egl=no
448 fi
449
450 if test "$with_acceleration_backend" = "opengl"; then
451     if test "$enable_gles2" = "yes"; then
452         acceleration_backend_description="$acceleration_backend_description (gles2"
453         OPENGL_LIBS="-lGLESv2"
454     else
455         acceleration_backend_description="$acceleration_backend_description (gl"
456         OPENGL_LIBS="-lGL"
457     fi
458     if test "$enable_egl" = "yes"; then
459         acceleration_backend_description="$acceleration_backend_description, egl"
460         OPENGL_LIBS="$OPENGL_LIBS -lEGL"
461     fi
462     if test "$enable_glx" = "yes"; then
463         acceleration_backend_description="$acceleration_backend_description, glx"
464     fi
465
466     # Check whether dlopen() is in the core libc like on FreeBSD, or in a separate
467     # libdl like on GNU/Linux (in which case we want to link to libdl).
468     AC_CHECK_FUNC([dlopen], [], [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
469     AC_SUBST([DLOPEN_LIBS])
470
471     OPENGL_LIBS="$OPENGL_LIBS $DLOPEN_LIBS"
472     acceleration_backend_description="$acceleration_backend_description)"
473 fi
474 AC_SUBST([OPENGL_LIBS])
475
476 enable_accelerated_canvas=no
477 if test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"; then
478     CAIRO_GL_LIBS="cairo-gl"
479     if test "$enable_glx" = "yes"; then
480         CAIRO_GL_LIBS="$CAIRO_GL_LIBS cairo-glx"
481     fi
482     if test "$enable_egl" = "yes"; then
483         CAIRO_GL_LIBS="$CAIRO_GL_LIBS cairo-egl"
484     fi
485
486     # At the moment CairoGL does not add any extra cflags and libraries, so we can
487     # safely ignore CAIRO_GL_LIBS and CAIRO_GL_CFLAGS for the moment.
488     PKG_CHECK_MODULES(CAIRO_GL, $CAIRO_GL_LIBS, [enable_accelerated_canvas=yes], [enable_accelerated_canvas=no])
489 fi
490
491 if test "$enable_gamepad" = "yes"; then
492     PKG_CHECK_MODULES([GAMEPAD], [gio-unix-2.0 gudev-1.0])
493
494     AC_SUBST(GAMEPAD_CFLAGS)
495     AC_SUBST(GAMEPAD_LIBS)
496 fi
497
498 if test "$enable_battery_status" = "yes"; then
499     PKG_CHECK_MODULES([UPOWER_GLIB], [upower-glib])
500
501     AC_SUBST(UPOWER_GLIB_CFLAGS)
502     AC_SUBST(UPOWER_GLIB_LIBS)
503 fi
504
505 # Check whether to enable code coverage support.
506 if test "$enable_coverage" = "yes"; then
507     COVERAGE_CFLAGS="-MD"
508     COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
509     AC_SUBST([COVERAGE_CFLAGS])
510     AC_SUBST([COVERAGE_LDFLAGS])
511 fi
512
513 if test "$enable_webkit2" = "yes"; then
514     if test "$GTK_API_VERSION" = "2.0"; then
515         AC_MSG_ERROR([WebKit2 requires GTK+ 3.x, use --with-gtk=3.0])
516     fi
517
518     # Make sure we have GTK+ 2.x to build the plugin process.
519     PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= gtk2_required_version gail >= gail2_required_version)
520     AC_SUBST(GTK2_CFLAGS)
521     AC_SUBST(GTK2_LIBS)
522
523     # Check Unix printing
524     PKG_CHECK_MODULES(GTK_UNIX_PRINTING, gtk+-unix-print-3.0, [have_gtk_unix_printing=yes], [have_gtk_unix_printing=no])
525     AC_SUBST(GTK_UNIX_PRINTING_CFLAGS)
526     AC_SUBST(GTK_UNIX_PRINTING_LIBS)
527
528     # On some Linux/Unix platforms, shm_* may only be available if linking against librt
529     if test "$os_win32" = "no"; then
530         AC_SEARCH_LIBS([shm_open], [rt], [SHM_LIBS="-lrt"])
531         AC_SUBST(SHM_LIBS)
532     fi
533 fi
534
535 # We need atspi2 for Webkit2 unit tests.
536 if test "$enable_webkit2" = "yes"; then
537    PKG_CHECK_MODULES([ATSPI2], [atspi-2 >= atspi2_required_version], [have_atspi2=yes], [have_atspi2=no])
538    AC_SUBST([ATSPI2_CFLAGS])
539    AC_SUBST([ATSPI2_LIBS])
540 fi
541
542 m4_ifdef([GTK_DOC_CHECK], [
543 GTK_DOC_CHECK([1.10])
544 ],[
545 AM_CONDITIONAL([ENABLE_GTK_DOC], false)
546 ])