summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@gnome.org>2015-03-27 19:04:20 +0100
committerMatthias Clasen <mclasen@redhat.com>2015-03-28 18:38:24 -0400
commitae430b1b808c0b930021c843b26faa259c11f3e8 (patch)
treef5da844b70ea08ef8c41a0c4763934be4e578e4a /configure.ac
parenta55ebcb4b0155c82f6f44ddeafc7756501b0e012 (diff)
downloadgtk+-ae430b1b808c0b930021c843b26faa259c11f3e8.tar.gz
make libcanberra support optional
Make it possible to control libcanberra support so we don't risk ending up with a cyclic dependency when using packages: gtk+ -> libcanberra-gtk3 -> gtk+ https://bugzilla.gnome.org/show_bug.cgi?id=746904
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 27 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index f7c6438b69..c76b8a68a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1660,11 +1660,34 @@ AM_CONDITIONAL(HAVE_COLORD, test "x$have_colord" = "xyes")
# Check for libcanberra (only used in examples)
##################################################
-PKG_CHECK_MODULES(LIBCANBERRA, libcanberra-gtk3,
- have_libcanberra=yes, have_libcanberra=no)
+AC_ARG_ENABLE(libcanberra,
+ [AS_HELP_STRING([--enable-libcanberra],
+ [enable libcanberra support in examples [default=auto]])],
+ [enable_libcanberra="$enableval"],
+ [enable_libcanberra=auto])
+
+AC_MSG_CHECKING([whether to use libcanberra])
+if test "$enable_libcanberra" != "no"; then
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+have_libcanberra=no
+if test "$enable_libcanberra" != "no"; then
+ PKG_CHECK_MODULES(LIBCANBERRA, libcanberra-gtk3,
+ have_libcanberra=yes, have_libcanberra=no)
+ if test "$enable_libcanberra" = "yes"; then
+ if test "$have_libcanberra" = "no"; then
+ AC_MSG_ERROR([--enable-libcanberra specified, but not available])
+ fi
+ fi
+fi
+
if test "$have_libcanberra" = "yes"; then
- AC_DEFINE(HAVE_LIBCANBERRA, 1, [define if we have libcanberra])
+ AC_DEFINE(HAVE_LIBCANBERRA, 1, [define if we have libcanberra])
fi
+AM_CONDITIONAL(HAVE_LIBCANBERRA, test "x$have_libcanberra" = "xyes")
##################################################
# Checks for gtk-doc and docbook-tools
@@ -1938,6 +1961,7 @@ echo " Print backends: $PRINT_BACKENDS"
echo " Dynamic modules: $build_dynamic_modules"
echo " Included immodules: $included_immodules"
echo " colord support: $have_colord"
+echo " libcanberra support: $have_libcanberra"
echo " Introspection: $found_introspection"
echo " Debugging: $enable_debug"
echo " Documentation: $enable_gtk_doc"