FindDependencies.m4 17 KB

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