From 4a51e1cb9f59fd2313d9bd1c93e6be40348a4fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 7 Aug 2008 19:09:23 +0200 Subject: [PATCH 1/4] Bump autoconf requirement to 2.62 (latest released version). --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 25a86a89f..f149864c5 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ # along with PulseAudio; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -AC_PREREQ(2.60) +AC_PREREQ(2.62) m4_define(PA_MAJOR, [0]) m4_define(PA_MINOR, [9]) From f4e9b7d778c252f514b4b457305ba310394b4060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 8 Aug 2008 12:15:26 +0200 Subject: [PATCH 2/4] Remove gettext macros from configure.ac, intltool is used. When using intltool there is no need to _also_ use gettext, so remove gettext macros so that autoreconf does not copy them over. --- configure.ac | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac index f149864c5..661890771 100644 --- a/configure.ac +++ b/configure.ac @@ -440,8 +440,6 @@ AC_CHECK_FUNCS([open64]) AM_ICONV -AM_GNU_GETTEXT([external]) - IT_PROG_INTLTOOL([0.35.0]) GETTEXT_PACKAGE=pulseaudio AC_SUBST([GETTEXT_PACKAGE]) From 2da79d5ade92c476326e3167d0a56986a9d96200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 8 Aug 2008 12:18:53 +0200 Subject: [PATCH 3/4] Create an m4 directory for common macros and use it. Split acinclude.m4 in multiple macro files. Let it be known to autoconf and aclocal to use the m4 directory. Ignore macro files copied or linked by libtool and intltool. --- Makefile.am | 2 +- bootstrap.sh | 2 +- configure.ac | 1 + m4/.gitignore | 8 +++++++ m4/acx_libwrap.m4 | 19 +++++++++++++++ m4/acx_lirc.m4 | 6 +++++ acinclude.m4 => m4/acx_pthread.m4 | 40 ------------------------------- m4/check_define.m4 | 13 ++++++++++ 8 files changed, 49 insertions(+), 42 deletions(-) create mode 100644 m4/.gitignore create mode 100644 m4/acx_libwrap.m4 create mode 100644 m4/acx_lirc.m4 rename acinclude.m4 => m4/acx_pthread.m4 (92%) create mode 100644 m4/check_define.m4 diff --git a/Makefile.am b/Makefile.am index 63c04ee15..facce0df5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. -ACLOCAL_AMFLAGS = -I common +ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = bootstrap.sh LICENSE GPL LGPL doxygen/Makefile.am doxygen/Makefile.in doxygen/doxygen.conf.in README todo SUBDIRS=src doxygen man po diff --git a/bootstrap.sh b/bootstrap.sh index 6f060c855..e5f1ac593 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -58,7 +58,7 @@ else intltoolize --copy --force --automake "$LIBTOOLIZE" -c --force --ltdl - run_versioned aclocal "$VERSION" -I common + run_versioned aclocal "$VERSION" -I m4 run_versioned autoconf 2.59 -Wall run_versioned autoheader 2.59 run_versioned automake "$VERSION" --copy --foreign --add-missing diff --git a/configure.ac b/configure.ac index 661890771..4fa171f38 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,7 @@ m4_define(PA_MICRO, [11]) AC_INIT([pulseaudio], PA_MAJOR.PA_MINOR.PA_MICRO,[mzchyfrnhqvb (at) 0pointer (dot) net]) AC_CONFIG_SRCDIR([src/daemon/main.c]) +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([foreign 1.10 -Wall]) diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 000000000..ac5d14068 --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,8 @@ +argz.m4 +intltool.m4 +libtool.m4 +ltdl.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 +lt~obsolete.m4 diff --git a/m4/acx_libwrap.m4 b/m4/acx_libwrap.m4 new file mode 100644 index 000000000..e1602144b --- /dev/null +++ b/m4/acx_libwrap.m4 @@ -0,0 +1,19 @@ +AC_DEFUN([ACX_LIBWRAP], [ +LIBWRAP_LIBS= +saved_LIBS="$LIBS" +LIBS="$LIBS -lwrap" +AC_MSG_CHECKING([for tcpwrap library and headers]) +AC_LINK_IFELSE( +AC_LANG_PROGRAM( +[#include +#include +int allow_severity = LOG_INFO; +int deny_severity = LOG_WARNING;], +[struct request_info *req; +return hosts_access (req);]), +[AC_DEFINE(HAVE_LIBWRAP, [], [Have tcpwrap?]) +LIBWRAP_LIBS="-lwrap" +AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) +LIBS="$saved_LIBS" +]) diff --git a/m4/acx_lirc.m4 b/m4/acx_lirc.m4 new file mode 100644 index 000000000..d3f8ea735 --- /dev/null +++ b/m4/acx_lirc.m4 @@ -0,0 +1,6 @@ +AC_DEFUN([ACX_LIRC], [ +LIRC_CFLAGS= +LIRC_LIBS= +AC_CHECK_HEADER(lirc/lirc_client.h,[AC_CHECK_LIB(lirc_client,lirc_init,[HAVE_LIRC=1 +LIRC_LIBS=-llirc_client],HAVE_LIRC=0)],HAVE_LIRC=0) +]) diff --git a/acinclude.m4 b/m4/acx_pthread.m4 similarity index 92% rename from acinclude.m4 rename to m4/acx_pthread.m4 index 02c051868..cbd6bfa06 100644 --- a/acinclude.m4 +++ b/m4/acx_pthread.m4 @@ -346,43 +346,3 @@ else fi AC_LANG_RESTORE ])dnl ACX_PTHREAD -AC_DEFUN([AC_CHECK_DEFINE],[ -AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1_$2])dnl -AC_CACHE_CHECK([for $1 in $2], ac_var, -AC_TRY_COMPILE([#include <$2>],[ - #ifdef $1 - int ok; - #else - choke me - #endif -],AS_VAR_SET(ac_var, yes),AS_VAR_SET(ac_var, no))) -AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl -AS_VAR_POPDEF([ac_var])dnl -]) - -AC_DEFUN([ACX_LIBWRAP], [ -LIBWRAP_LIBS= -saved_LIBS="$LIBS" -LIBS="$LIBS -lwrap" -AC_MSG_CHECKING([for tcpwrap library and headers]) -AC_LINK_IFELSE( -AC_LANG_PROGRAM( -[#include -#include -int allow_severity = LOG_INFO; -int deny_severity = LOG_WARNING;], -[struct request_info *req; -return hosts_access (req);]), -[AC_DEFINE(HAVE_LIBWRAP, [], [Have tcpwrap?]) -LIBWRAP_LIBS="-lwrap" -AC_MSG_RESULT(yes)], -[AC_MSG_RESULT(no)]) -LIBS="$saved_LIBS" -]) - -AC_DEFUN([ACX_LIRC], [ -LIRC_CFLAGS= -LIRC_LIBS= -AC_CHECK_HEADER(lirc/lirc_client.h,[AC_CHECK_LIB(lirc_client,lirc_init,[HAVE_LIRC=1 -LIRC_LIBS=-llirc_client],HAVE_LIRC=0)],HAVE_LIRC=0) -]) diff --git a/m4/check_define.m4 b/m4/check_define.m4 new file mode 100644 index 000000000..43edc78ee --- /dev/null +++ b/m4/check_define.m4 @@ -0,0 +1,13 @@ +AC_DEFUN([AC_CHECK_DEFINE],[ +AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1_$2])dnl +AC_CACHE_CHECK([for $1 in $2], ac_var, +AC_TRY_COMPILE([#include <$2>],[ + #ifdef $1 + int ok; + #else + choke me + #endif +],AS_VAR_SET(ac_var, yes),AS_VAR_SET(ac_var, no))) +AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl +AS_VAR_POPDEF([ac_var])dnl +]) From f8197cfc4c88a16933de036544f02f31ac26b78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 8 Aug 2008 12:24:57 +0200 Subject: [PATCH 4/4] Update code to use libtool 2.2. Use convenience recursive libltdl. Also remove the code for older libtool from the daemon. --- Makefile.am | 2 +- configure.ac | 27 +++--------------- src/daemon/ltdl-bind-now.c | 57 -------------------------------------- 3 files changed, 5 insertions(+), 81 deletions(-) diff --git a/Makefile.am b/Makefile.am index facce0df5..b5e638bd9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,7 +18,7 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = bootstrap.sh LICENSE GPL LGPL doxygen/Makefile.am doxygen/Makefile.in doxygen/doxygen.conf.in README todo -SUBDIRS=src doxygen man po +SUBDIRS=src doxygen man po libltdl MAINTAINERCLEANFILES = noinst_DATA = diff --git a/configure.ac b/configure.ac index 4fa171f38..8bb3f8acd 100644 --- a/configure.ac +++ b/configure.ac @@ -244,29 +244,9 @@ else fi #### libtool stuff #### - -AC_LTDL_ENABLE_INSTALL -AC_LIBLTDL_INSTALLABLE -AC_LIBTOOL_DLOPEN -AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL -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 ]) - -if test "x$enable_ltdl_install" = "xno" && test "x$ac_cv_lib_ltdl_lt_dlinit" = "xno" ; then - AC_MSG_ERROR([[ - - *** Cannot find the libltdl development files. - *** Maybe you need to install the libltdl-dev package. - ]]) -fi +LT_CONFIG_LTDL_DIR([libltdl]) +LT_INIT([dlopen win32-dll]) +LTDL_INIT([convenience recursive]) #### Determine build environment #### @@ -1129,6 +1109,7 @@ AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "x1"]) AC_CONFIG_FILES([ Makefile +libltdl/Makefile src/Makefile man/Makefile libpulse.pc diff --git a/src/daemon/ltdl-bind-now.c b/src/daemon/ltdl-bind-now.c index 400772488..6821aac42 100644 --- a/src/daemon/ltdl-bind-now.c +++ b/src/daemon/ltdl-bind-now.c @@ -53,30 +53,6 @@ #undef PA_BIND_NOW #endif -#ifdef HAVE_LT_DLMUTEX_REGISTER - -static pa_mutex *libtool_mutex = NULL; - -PA_STATIC_TLS_DECLARE_NO_FREE(libtool_tls); - -static void libtool_lock(void) { - pa_mutex_lock(libtool_mutex); -} - -static void libtool_unlock(void) { - pa_mutex_unlock(libtool_mutex); -} - -static void libtool_set_error(const char *error) { - PA_STATIC_TLS_SET(libtool_tls, (char*) error); -} - -static const char *libtool_get_error(void) { - return PA_STATIC_TLS_GET(libtool_tls); -} - -#endif - #ifdef PA_BIND_NOW /* @@ -91,11 +67,7 @@ static const char *libtool_get_error(void) { 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; @@ -140,36 +112,13 @@ static lt_ptr bind_now_find_sym(lt_user_data d, lt_module m, const char *symbol) 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); -#ifdef HAVE_LT_DLMUTEX_REGISTER - pa_assert_se(libtool_mutex = pa_mutex_new(TRUE, FALSE)); - 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); - - /* 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) return; @@ -189,15 +138,9 @@ void pa_ltdl_init(void) { /* 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 } void pa_ltdl_done(void) { pa_assert_se(lt_dlexit() == 0); - -#ifdef HAVE_LT_DLMUTEX_REGISTER - pa_mutex_free(libtool_mutex); - libtool_mutex = NULL; -#endif }