Blob Blame History Raw
diff --git a/Makefile.am b/Makefile.am
index 507a02f..8db04da 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@
 dist_doc_DATA = README
 
 EXTRA_DIST = bootstrap.sh autogen.sh LGPL libcanberra.schemas
-SUBDIRS = libltdl src gtkdoc doc
+SUBDIRS = src gtkdoc doc
 
 MAINTAINERCLEANFILES = README
 noinst_DATA = README
@@ -51,7 +51,7 @@ ACLOCAL_AMFLAGS = -I m4
 README:
 	rm -f README
 	$(MAKE) -C doc README
-	cd $(srcdir) && ln -s doc/README README
+	ln -s doc/README README
 
 homepage: all dist
 	test -d $$HOME/homepage/private
diff --git a/bootstrap.sh b/bootstrap.sh
index abeb4f6..29d356f 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -18,7 +18,7 @@
 # License along with libcanberra. If not, see
 # <http://www.gnu.org/licenses/>.
 
-VERSION=1.9
+VERSION=1.10
 
 run_versioned() {
     local P
@@ -42,6 +42,15 @@ run_versioned() {
 
 set -ex
 
+# We check for this here, because if pkg-config is not found in the
+# system, it's likely that the pkg.m4 macro file is also not present,
+# which will make PKG_PROG_PKG_CONFIG be undefined and the generated
+# configure file faulty.
+if ! pkg-config --version &>/dev/null; then
+    echo "pkg-config is required to bootstrap this program" &>/dev/null
+    exit 1
+fi
+
 if [ "x$1" = "xam" ] ; then
     run_versioned automake "$VERSION" -a -c --foreign
     ./config.status
@@ -54,7 +63,7 @@ else
 
     mkdir -p m4
     gtkdocize --copy --flavour no-tmpl --docdir gtkdoc
-    "$LIBTOOLIZE" -c --force --ltdl --recursive
+    "$LIBTOOLIZE" -c --force --recursive
     run_versioned aclocal "$VERSION" -I m4
     run_versioned autoconf 2.63 -Wall
     run_versioned autoheader 2.63
diff --git a/configure.ac b/configure.ac
index 3f1a841..51dc305 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@
 
 AC_PREREQ(2.63)
 
-AC_INIT([libcanberra], 0.11, [mzyvopnaoreen (at) 0pointer (dot) de])
+AC_INIT([libcanberra],[0.11],[mzyvopnaoreen (at) 0pointer (dot) de])
 AC_CONFIG_SRCDIR([src/common.c])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR(m4)
@@ -65,9 +65,32 @@ done
 
 #### libtool stuff ####
 LT_PREREQ(2.2)
-LT_CONFIG_LTDL_DIR([libltdl])
 LT_INIT([dlopen win32-dll disable-static])
-LTDL_INIT([convenience recursive])
+
+dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
+dnl exactly which version of libltdl is present in the system, so we
+dnl just assume that it's a working version as long as we have the
+dnl library and the header files.
+dnl
+dnl As an extra safety device, check for lt_dladvise_init() which is
+dnl only implemented in libtool 2.x, and refine as we go if we have
+dnl refined requirements.
+dnl
+dnl Check the header files first since the system may have a
+dnl libltdl.so for runtime, but no headers, and we want to bail out as
+dnl soon as possible.
+dnl
+dnl We don't need any special variable for this though, since the user
+dnl can give the proper place to find libltdl through the standard
+dnl variables like LDFLAGS and CPPFLAGS.
+
+AC_CHECK_HEADER([ltdl.h],
+    [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
+    [LIBLTDL=])
+
+AS_IF([test "x$LIBLTDL" = "x"],
+    [AC_MSG_ERROR([Unable to find libltdl.])])
+AC_SUBST([LIBLTDL])
 
 #### Determine build environment ####
 
@@ -109,7 +132,6 @@ AC_TYPE_SIZE_T
 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
     [Define ssize_t if it is not done by the standard libs.])])
 AC_TYPE_OFF_T
-AC_TYPE_SIGNAL
 AC_TYPE_UID_T
 
 #### Check for libs ####
@@ -158,20 +180,12 @@ AM_ICONV
 
 #### pkg-config ####
 
-# Check for pkg-config manually first, as if its not installed the
-# PKG_PROG_PKG_CONFIG macro won't be defined.
-AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
-
-if test x"$have_pkg_config" = "xno"; then
-    AC_MSG_ERROR(pkg-config is required to install this program)
-fi
-
 PKG_PROG_PKG_CONFIG
 
 #### ALSA support (optional) ####
 
 AC_ARG_ENABLE([alsa],
-    AC_HELP_STRING([--disable-alsa], [Disable optional ALSA support]),
+    AS_HELP_STRING([--disable-alsa], [Disable optional ALSA support]),
         [
             case "${enableval}" in
                 yes) alsa=yes ;;
@@ -203,7 +217,7 @@ AC_SUBST(ALSA_LIBS)
 ### OSS support (optional) ###
 
 AC_ARG_ENABLE([oss],
-    AC_HELP_STRING([--disable-oss], [Disable optional OSS support]),
+    AS_HELP_STRING([--disable-oss], [Disable optional OSS support]),
         [
             case "${enableval}" in
                 yes) oss=yes ;;
@@ -233,7 +247,7 @@ fi
 ### PulseAudio (optional) ####
 
 AC_ARG_ENABLE([pulse],
-    AC_HELP_STRING([--disable-pulse], [Disable optional PulseAudio support]),
+    AS_HELP_STRING([--disable-pulse], [Disable optional PulseAudio support]),
         [
             case "${enableval}" in
                 yes) pulse=yes ;;
@@ -274,7 +288,7 @@ AC_SUBST(PULSE_LIBS)
 #### GStreamer support (optional) ####
 
 AC_ARG_ENABLE([gstreamer],
-    AC_HELP_STRING([--disable-gstreamer], [Disable optional GStreamer support]),
+    AS_HELP_STRING([--disable-gstreamer], [Disable optional GStreamer support]),
         [
             case "${enableval}" in
                 yes) gstreamer=yes ;;
@@ -306,7 +320,7 @@ AC_SUBST(GSTREAMER_LIBS)
 ### Null output (optional) ####
 
 AC_ARG_ENABLE([null],
-    AC_HELP_STRING([--disable-null], [Disable optional null output]),
+    AS_HELP_STRING([--disable-null], [Disable optional null output]),
         [
             case "${enableval}" in
                 yes) null=yes ;;
@@ -326,7 +340,7 @@ fi
 ### GTK (optional) ####
 
 AC_ARG_ENABLE([gtk],
-    AC_HELP_STRING([--disable-gtk], [Disable optional GTK+ support]),
+    AS_HELP_STRING([--disable-gtk], [Disable optional GTK+ support]),
         [
             case "${enableval}" in
                 yes) gtk=yes ;;
@@ -368,7 +382,7 @@ AM_CONDITIONAL([HAVE_GTK], [test "x$HAVE_GTK" = x1])
 #### TDB cache support (optional) ####
 
 AC_ARG_ENABLE([tdb],
-    AC_HELP_STRING([--disable-tdb], [Disable optional tdb support]),
+    AS_HELP_STRING([--disable-tdb], [Disable optional tdb support]),
         [
             case "${enableval}" in
                 yes) tdb=yes ;;
@@ -415,7 +429,7 @@ fi
 ### LYNX documentation generation ###
 
 AC_ARG_ENABLE([lynx],
-        AC_HELP_STRING([--disable-lynx], [Turn off lynx usage for documentation generation]),
+        AS_HELP_STRING([--disable-lynx], [Turn off lynx usage for documentation generation]),
                 [
                         case "${enableval}" in
                                 yes) lynx=yes ;;
@@ -561,7 +575,6 @@ GTK_DOC_CHECK(1.9)
 
 AC_CONFIG_FILES([
 Makefile
-libltdl/Makefile
 src/Makefile
 libcanberra.pc
 libcanberra-gtk.pc
diff --git a/doc/README.html.in b/doc/README.html.in
index d4a3edf..9b9cf04 100644
--- a/doc/README.html.in
+++ b/doc/README.html.in
@@ -10,7 +10,7 @@
 <body>
 <h1><a name="top">libcanberra @PACKAGE_VERSION@</a></h1>
 
-<p><i>Copyright 2008 Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;</i></p>
+<p><i>Copyright 2008-2009 Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;</i></p>
 
 <ul class="toc">
     <li><a href="#license">License</a></li>
diff --git a/src/Makefile.am b/src/Makefile.am
index d1b4d89..1fb5168 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -85,8 +85,6 @@ if BUILTIN_DSO
 libcanberra_la_SOURCES += \
 	dso.c \
 	driver-order.c driver-order.h
-libcanberra_la_CFLAGS += \
-	$(LTDLINCL)
 libcanberra_la_LIBADD += \
 	$(LIBLTDL)
 
diff --git a/src/map-file b/src/map-file
index 2265ed0..902252a 100644
--- a/src/map-file
+++ b/src/map-file
@@ -7,4 +7,7 @@ driver_change_props;
 driver_destroy;
 driver_open;
 driver_play;
+lt_*;
+dlopen_*;
+preopen_*;
 };
diff --git a/src/pulse.c b/src/pulse.c
index 11d6e52..ed371de 100644
--- a/src/pulse.c
+++ b/src/pulse.c
@@ -166,12 +166,27 @@ static int translate_error(int error) {
         [PA_ERR_BADSTATE]             = CA_ERROR_STATE,
         [PA_ERR_NODATA]               = CA_ERROR_IO,
         [PA_ERR_VERSION]              = CA_ERROR_NOTSUPPORTED,
-        [PA_ERR_TOOLARGE]             = CA_ERROR_TOOBIG
+        [PA_ERR_TOOLARGE]             = CA_ERROR_TOOBIG,
+#ifdef PA_ERR_NOTSUPPORTED
+        [PA_ERR_NOTSUPPORTED]         = CA_ERROR_NOTSUPPORTED,
+#endif
+#ifdef PA_ERR_UNKNOWN
+        [PA_ERR_UNKNOWN]              = CA_ERROR_IO,
+#endif
+#ifdef PA_ERR_NOEXTENSION
+        [PA_ERR_NOEXTENSION]          = CA_ERROR_NOTSUPPORTED,
+#endif
+#ifdef PA_ERR_OBSOLETE
+        [PA_ERR_OBSOLETE]             = CA_ERROR_NOTSUPPORTED,
+#endif
+#ifdef PA_ERR_NOTIMPLEMENTED
+        [PA_ERR_NOTIMPLEMENTED]       = CA_ERROR_NOTSUPPORTED
+#endif
     };
 
     ca_assert(error >= 0);
 
-    if (error >= PA_ERR_MAX)
+    if (error >= PA_ERR_MAX || !table[error])
         return CA_ERROR_IO;
 
     return table[error];
@@ -572,7 +587,7 @@ static void stream_write_cb(pa_stream *s, size_t bytes, void *userdata) {
             goto finish;
         }
 
-	data = NULL;
+        data = NULL;
 
         bytes -= rbytes;
     }
@@ -641,7 +656,11 @@ int driver_play(ca_context *c, uint32_t id, ca_proplist *proplist, ca_finish_cal
     pa_proplist *l = NULL;
     const char *n, *vol, *ct;
     char *name = NULL;
+#if defined(PA_MAJOR) && ((PA_MAJOR > 0) || (PA_MAJOR == 0 && PA_MINOR > 9) || (PA_MAJOR == 0 && PA_MINOR == 9 && PA_MICRO >= 15))
+    pa_volume_t v = (pa_volume_t) -1;
+#else
     pa_volume_t v = PA_VOLUME_NORM;
+#endif
     pa_sample_spec ss;
     ca_cache_control_t cache_control = CA_CACHE_CONTROL_NEVER;
     struct outstanding *out = NULL;
@@ -781,7 +800,13 @@ int driver_play(ca_context *c, uint32_t id, ca_proplist *proplist, ca_finish_cal
     pa_stream_set_state_callback(out->stream, stream_state_cb, out);
     pa_stream_set_write_callback(out->stream, stream_write_cb, out);
 
-    if (pa_stream_connect_playback(out->stream, NULL, NULL, 0, NULL, NULL) < 0) {
+    if (pa_stream_connect_playback(out->stream, NULL, NULL,
+#ifdef PA_STREAM_FAIL_ON_SUSPEND
+                                   PA_STREAM_FAIL_ON_SUSPEND
+#else
+                                   0
+#endif
+                                   , NULL, NULL) < 0) {
         ret = translate_error(pa_context_errno(p->context));
         pa_threaded_mainloop_unlock(p->mainloop);
         goto finish;