diff --git a/libguile/Makefile.am b/libguile/Makefile.am index b0893c383..da6e0b0e8 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -26,7 +26,7 @@ DEFS = @DEFS@ ## Check for headers in $(srcdir)/.., so that #include ## will find MUMBLE.h in this dir when we're ## building. -INCLUDES = -I.. -I$(srcdir)/.. ${INCLTDL} +INCLUDES = -I.. -I$(srcdir)/.. -I$(top_srcdir)/libguile-ltdl ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \ --regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/' @@ -112,7 +112,7 @@ noinst_HEADERS = coop-threads.c coop-threads.h coop.c \ num2integral.i.c num2float.i.c libguile_la_DEPENDENCIES = @LIBLOBJS@ -libguile_la_LIBADD = @LIBLOBJS@ $(LIBLTDL) $(THREAD_LIBS_LOCAL) +libguile_la_LIBADD = @LIBLOBJS@ ../libguile-ltdl/libguile-ltdl.la $(THREAD_LIBS_LOCAL) libguile_la_LDFLAGS = -version-info @LIBGUILE_INTERFACE_CURRENT@:@LIBGUILE_INTERFACE_REVISION@:@LIBGUILE_INTERFACE_AGE@ -export-dynamic -no-undefined # These are headers visible as diff --git a/libguile/dynl.c b/libguile/dynl.c index 3a9bfe21c..600707b15 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -237,13 +237,13 @@ SCM_DEFINE (scm_clear_registered_modules, "c-clear-registered-modules", 0, 0, 0, #ifdef DYNAMIC_LINKING -#include "libltdl/ltdl.h" +#include "guile-ltdl.h" static void * sysdep_dynl_link (const char *fname, const char *subr) { - lt_dlhandle handle; - handle = lt_dlopenext (fname); + scm_lt_dlhandle handle; + handle = scm_lt_dlopenext (fname); if (NULL == handle) { SCM fn; @@ -251,7 +251,7 @@ sysdep_dynl_link (const char *fname, const char *subr) SCM_ALLOW_INTS; fn = scm_makfrom0str (fname); - msg = scm_makfrom0str (lt_dlerror ()); + msg = scm_makfrom0str (scm_lt_dlerror ()); scm_misc_error (subr, "file: ~S, message: ~S", scm_list_2 (fn, msg)); } return (void *) handle; @@ -260,10 +260,10 @@ sysdep_dynl_link (const char *fname, const char *subr) static void sysdep_dynl_unlink (void *handle, const char *subr) { - if (lt_dlclose ((lt_dlhandle) handle)) + if (scm_lt_dlclose ((scm_lt_dlhandle) handle)) { SCM_ALLOW_INTS; - scm_misc_error (subr, (char *) lt_dlerror (), SCM_EOL); + scm_misc_error (subr, (char *) scm_lt_dlerror (), SCM_EOL); } } @@ -272,11 +272,11 @@ sysdep_dynl_func (const char *symb, void *handle, const char *subr) { void *fptr; - fptr = lt_dlsym ((lt_dlhandle) handle, symb); + fptr = scm_lt_dlsym ((scm_lt_dlhandle) handle, symb); if (!fptr) { SCM_ALLOW_INTS; - scm_misc_error (subr, (char *) lt_dlerror (), SCM_EOL); + scm_misc_error (subr, (char *) scm_lt_dlerror (), SCM_EOL); } return fptr; } @@ -284,7 +284,7 @@ sysdep_dynl_func (const char *symb, void *handle, const char *subr) static void sysdep_dynl_init () { - lt_dlinit (); + scm_lt_dlinit (); } #else diff --git a/libguile/guile.c b/libguile/guile.c index d25a70d07..18ab6cd2a 100644 --- a/libguile/guile.c +++ b/libguile/guile.c @@ -51,8 +51,9 @@ #ifdef HAVE_CONFIG_H #include #endif + #ifdef DYNAMIC_LINKING -#include +#include "guile-ltdl.h" #endif #ifdef HAVE_WINSOCK2_H @@ -86,7 +87,9 @@ int main (int argc, char **argv) { #ifdef DYNAMIC_LINKING - LTDL_SET_PRELOADED_SYMBOLS (); + /* libtool automagically inserts this variable into your executable... */ + extern const scm_lt_dlsymlist lt_preloaded_symbols[]; + scm_lt_dlpreload_default (lt_preloaded_symbols); #endif scm_boot_guile (argc, argv, inner_main, 0); return 0; /* never reached */