[pulseaudio-commits] r2167 - in /branches/prepare-0.9.10: configure.ac src/daemon/ltdl-bind-now.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Thu Mar 27 16:35:06 PDT 2008
Author: lennart
Date: Fri Mar 28 00:35:06 2008
New Revision: 2167
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2167&root=pulseaudio&view=rev
Log:
merge r2113,r2214,r2115 from trunk
Modified:
branches/prepare-0.9.10/configure.ac
branches/prepare-0.9.10/src/daemon/ltdl-bind-now.c
Modified: branches/prepare-0.9.10/configure.ac
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/configure.ac?rev=2167&root=pulseaudio&r1=2166&r2=2167&view=diff
==============================================================================
--- branches/prepare-0.9.10/configure.ac (original)
+++ branches/prepare-0.9.10/configure.ac Fri Mar 28 00:35:06 2008
@@ -171,6 +171,12 @@
AC_SUBST(LTDLINCL)
AC_SUBST(LIBLTDL)
AC_CONFIG_SUBDIRS(libltdl)
+
+old_LIBS=$LIBS
+LIBS="$LIBS $LIBLTDL"
+AC_CHECK_FUNCS([lt_dlmutex_register])
+LIBS=$old_LIBS
+AC_CHECK_TYPES([struct lt_user_dlloader, lt_dladvise], , , [#include <ltdl.h>])
if test "x$enable_ltdl_install" = "xno" && test "x$ac_cv_lib_ltdl_lt_dlinit" = "xno" ; then
AC_MSG_ERROR([[
Modified: branches/prepare-0.9.10/src/daemon/ltdl-bind-now.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/daemon/ltdl-bind-now.c?rev=2167&root=pulseaudio&r1=2166&r2=2167&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/daemon/ltdl-bind-now.c (original)
+++ branches/prepare-0.9.10/src/daemon/ltdl-bind-now.c Fri Mar 28 00:35:06 2008
@@ -32,6 +32,11 @@
#if HAVE_SYS_DL_H
#include <sys/dl.h>
+#endif
+
+#ifndef HAVE_STRUCT_LT_USER_DLLOADER
+/* Only used with ltdl 2.2 */
+#include <string.h>
#endif
#include <ltdl.h>
@@ -85,7 +90,11 @@
to set $LT_BIND_NOW before starting the pulsaudio binary.
*/
+#ifndef HAVE_LT_DLADVISE
static lt_module bind_now_open(lt_user_data d, const char *fname) {
+#else
+ static lt_module bind_now_open(lt_user_data d, const char *fname, lt_dladvise advise) {
+#endif
lt_module m;
pa_assert(fname);
@@ -129,19 +138,27 @@
void pa_ltdl_init(void) {
#ifdef PA_BIND_NOW
+# ifdef HAVE_STRUCT_LT_USER_DLLOADER
lt_dlloader *place;
static const struct lt_user_dlloader loader = {
.module_open = bind_now_open,
.module_close = bind_now_close,
.find_sym = bind_now_find_sym
};
+# else
+ static const lt_dlvtable *dlopen_loader;
+ static lt_dlvtable bindnow_loader;
+# endif
#endif
pa_assert_se(lt_dlinit() == 0);
pa_assert_se(libtool_mutex = pa_mutex_new(TRUE, FALSE));
+#ifdef HAVE_LT_DLMUTEX_REGISTER
pa_assert_se(lt_dlmutex_register(libtool_lock, libtool_unlock, libtool_set_error, libtool_get_error) == 0);
+#endif
#ifdef PA_BIND_NOW
+# ifdef HAVE_STRUCT_LT_USER_DLLOADER
if (!(place = lt_dlloader_find("dlopen")))
place = lt_dlloader_next(NULL);
@@ -149,6 +166,26 @@
/* Add our BIND_NOW loader as the default module loader. */
if (lt_dlloader_add(place, &loader, "bind-now-loader") != 0)
pa_log_warn("Failed to add bind-now-loader.");
+# else
+ /* Already initialised */
+ if ( dlopen_loader != NULL ) return;
+
+ if (!(dlopen_loader = lt_dlloader_find("dlopen"))) {
+ pa_log_warn("Failed to find original dlopen loader.");
+ return;
+ }
+
+ memcpy(&bindnow_loader, dlopen_loader, sizeof(bindnow_loader));
+ bindnow_loader.name = "bind-now-loader";
+ bindnow_loader.module_open = bind_now_open;
+ bindnow_loader.module_close = bind_now_close;
+ bindnow_loader.find_sym = bind_now_find_sym;
+ bindnow_loader.priority = LT_DLLOADER_PREPEND;
+
+ /* Add our BIND_NOW loader as the default module loader. */
+ if (lt_dlloader_add(&bindnow_loader) != 0)
+ pa_log_warn("Failed to add bind-now-loader.");
+# endif
#endif
}
More information about the pulseaudio-commits
mailing list