summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--m4/module.c15
2 files changed, 16 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index a219665f..f43a412f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,8 @@ AC_MSG_RESULT([$use_modules])
AC_SUBST([DLPREOPEN])
AC_SUBST([PREOPEN_DEPENDENCIES])
+LT_FUNC_DLSYM_USCORE
+
## ---------------- ##
## Gettext support. ##
diff --git a/m4/module.c b/m4/module.c
index 07e33519..8efb1a99 100644
--- a/m4/module.c
+++ b/m4/module.c
@@ -67,7 +67,20 @@
#define MODULE_SELF_NAME "!myself!"
-static const char* module_dlerror (void);
+#if NEED_USCORE
+static void *
+uscore_sym (void *handle, const char *symbol)
+{
+ char *symname = xasprintf ("_%s", symbol);
+ void *address = dlsym (handle, symname);
+ free (symname);
+ return address;
+}
+
+#define dlsym uscore_sym
+#endif
+
+static const char * module_dlerror (void);
static void install_builtin_table (m4*, m4_module *);
static void install_macro_table (m4*, m4_module *);