From: Florian Forster Date: Tue, 8 Dec 2009 09:12:58 +0000 (+0100) Subject: src/plugin.c: Add libtool 1 compatibility code. X-Git-Tag: collectd-4.9.0~35^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=47f2b4a92d3390e27ce2fa6f6bd1340c9cb0491b;p=collectd.git src/plugin.c: Add libtool 1 compatibility code. --- diff --git a/configure.in b/configure.in index 3a5901e2..6a520a64 100644 --- a/configure.in +++ b/configure.in @@ -9,6 +9,7 @@ m4_ifdef([LT_PACKAGE_VERSION], LT_CONFIG_LTDL_DIR([libltdl]) LT_INIT([dlopen]) LTDL_INIT([convenience]) + AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.]) ] , # libtool <= 1.5 @@ -18,6 +19,7 @@ m4_ifdef([LT_PACKAGE_VERSION], AC_SUBST(LIBLTDL) AC_LIBTOOL_DLOPEN AC_CONFIG_SUBDIRS(libltdl) + AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.]) ] ) diff --git a/src/plugin.c b/src/plugin.c index 7b30e211..25798564 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -280,6 +280,7 @@ static int plugin_load_file (char *file, uint32_t flags) lt_dlinit (); lt_dlerror (); /* clear errors */ +#if LIBTOOL_VERSION == 2 if (flags & PLUGIN_FLAGS_GLOBAL) { lt_dladvise advise; lt_dladvise_init(&advise); @@ -289,6 +290,13 @@ static int plugin_load_file (char *file, uint32_t flags) } else { dlh = lt_dlopen (file); } +#else /* if LIBTOOL_VERSION == 1 */ + if (flags & PLUGIN_FLAGS_GLOBAL) + ERROR ("plugin_load_file: The global flag is not supported, " + "libtool 2 is required for this."); + dlh = lt_dlopen (file); +#endif + if (dlh == NULL) { const char *error = lt_dlerror ();