src/plugin.c: Add libtool 1 compatibility code.
[collectd.git] / src / plugin.c
index 7b30e21..2579856 100644 (file)
@@ -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 ();