- gchar *path = g_strdup_printf("%s/%s.%s", PLUGINDIR, name, G_MODULE_SUFFIX);
- GModule *module = g_module_open(path, 0);
+ g_debug("GisPlugins: load %s", name);
+ gchar *path = g_strdup_printf("%s/%s.%s", self->dir, name, G_MODULE_SUFFIX);
+ g_debug("GisPlugins: load - trying %s", path);
+ if (!g_file_test(path, G_FILE_TEST_EXISTS)) {
+ g_free(path);
+ path = g_strdup_printf("%s/%s.%s", PLUGINSDIR, name, G_MODULE_SUFFIX);
+ }
+ g_debug("GisPlugins: load - trying %s", path);
+ if (!g_file_test(path, G_FILE_TEST_EXISTS)) {
+ g_warning("Module %s not found", name);
+ g_free(path);
+ return NULL;
+ }
+ GModule *module = g_module_open(path, G_MODULE_BIND_LAZY);