patch 8.1.1502: cannot play any sound
Problem: Cannot play any sound.
Solution: Use libcanberra if available. Add sound functions.
diff --git a/src/configure.ac b/src/configure.ac
index 773844a..7e821e6 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -2702,6 +2702,10 @@
GNOME_INIT_HOOK([],fail)
])
+if test "X$PKG_CONFIG" = "X"; then
+ AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
+fi
+
dnl ---------------------------------------------------------------------------
dnl Check for GTK2. If it fails, then continue on for Motif as before...
@@ -2717,10 +2721,6 @@
AC_MSG_RESULT(gtk test disabled)
fi
- if test "X$PKG_CONFIG" = "X"; then
- AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
- fi
-
if test "x$PKG_CONFIG" != "xno"; then
dnl First try finding version 2.2.0 or later. The 2.0.x series has
dnl problems (bold fonts, --remote doesn't work).
@@ -2769,10 +2769,6 @@
AC_MSG_RESULT(gtk test disabled)
fi
- if test "X$PKG_CONFIG" = "X"; then
- AC_PATH_TOOL(PKG_CONFIG, pkg-config, no)
- fi
-
if test "x$PKG_CONFIG" != "xno"; then
AM_PATH_GTK(3.0.0,
[GUI_LIB_LOC="$GTK_LIBDIR"
@@ -3755,6 +3751,29 @@
dnl appropriate, so that off_t is 64 bits when needed.
AC_SYS_LARGEFILE
+
+if test "x$PKG_CONFIG" != "xno"; then
+ canberra_lib=`$PKG_CONFIG --libs libcanberra 2>/dev/null`
+ canberra_cflags=`$PKG_CONFIG --cflags libcanberra 2>/dev/null`
+fi
+if test "x$canberra_lib" = "x"; then
+ canberra_lib=-lcanberra
+ canberra_cflags=-D_REENTRANT
+fi
+AC_MSG_CHECKING(for libcanberra)
+ac_save_CFLAGS="$CFLAGS"
+ac_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $canberra_cflags"
+LIBS="$LIBS $canberra_lib"
+AC_TRY_LINK([
+# include <canberra.h>
+ ], [
+ ca_context *hello;
+ ca_context_create(&hello);],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CANBERRA),
+ AC_MSG_RESULT(no); CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS")
+
+
dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
AC_MSG_CHECKING(for st_blksize)
AC_TRY_COMPILE(