diff --git a/ChangeLog b/ChangeLog index b7c6d3c8a..1ede0de4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-07-12 Gary Houston + + * configure.in: check dynamic linking before modules. Add dynl.c + if dynamic linking is available, i.e., unless --with-modules=no + was given to configure. + 2002-07-09 Marius Vollmer * autogen.sh: Patch libltdl/ltdl.c to avoid a nasty bug in diff --git a/configure.in b/configure.in index 77ef36564..3c554ee5c 100644 --- a/configure.in +++ b/configure.in @@ -171,8 +171,33 @@ AM_PROG_LIBTOOL AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no) AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes) +dnl Check for dynamic linking + +use_modules=yes +AC_ARG_WITH(modules, +[ --with-modules[=FILES] Add support for dynamic modules], +use_modules="$withval") +test -z "$use_modules" && use_modules=yes +DLPREOPEN= +if test "$use_modules" != no; then + AC_DEFINE(DYNAMIC_LINKING, 1, + [Define if you want support for dynamic linking.]) + if test "$use_modules" = yes; then + DLPREOPEN="-dlpreopen force" + else + DLPREOPEN="-export-dynamic" + for module in $use_modules; do + DLPREOPEN="$DLPREOPEN -dlopen $module" + done + fi +fi + dnl files which are destined for separate modules. +if test "$use_modules" != no; then + AC_LIBOBJ([dynl]) +fi + if test "$enable_arrays" = yes; then AC_LIBOBJ([ramap]) AC_LIBOBJ([unif]) @@ -280,27 +305,6 @@ if test "$MINGW32" = "yes" ; then fi AC_SUBST(EXTRA_DEFS) -dnl Check for dynamic linking - -use_modules=yes -AC_ARG_WITH(modules, -[ --with-modules[=FILES] Add support for dynamic modules], -use_modules="$withval") -test -z "$use_modules" && use_modules=yes -DLPREOPEN= -if test "$use_modules" != no; then - AC_DEFINE(DYNAMIC_LINKING, 1, - [Define if you want support for dynamic linking.]) - if test "$use_modules" = yes; then - DLPREOPEN="-dlpreopen force" - else - DLPREOPEN="-export-dynamic" - for module in $use_modules; do - DLPREOPEN="$DLPREOPEN -dlopen $module" - done - fi -fi - AC_SUBST(INCLTDL) AC_SUBST(LIBLTDL) AC_SUBST(DLPREOPEN) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 13a49bfb3..a8566b530 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,19 @@ +2002-07-12 Gary Houston + + * dynl.c: Don't define stub procedures if DYNAMIC_LINKING is not + defined. They don't do anything useful, especially since the + only case where DYNAMIC_LINKING is undefined seems to be + when --with-modules=no is given to configure, which is basically + requesting that the "dynamic linking module" be omitted. + + * Makefile.am (libguile_la_SOURCES): move dynl.c from + libguile_la_SOURCES to EXTRA_libguile_la_SOURCES. + + * extensions.c (load_extension): check DYNAMIC_LINKING for + scm_dynamic_call. + * init.c (scm_init_guile_1): check DYNAMIC_LINKING for + scm_init_dynamic_linking. + 2002-07-10 Marius Vollmer * guile.c, iselect.h, net_db.c, posix.c, socket.c: No need to diff --git a/libguile/Makefile.am b/libguile/Makefile.am index ec819d4a4..c8b16a572 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -61,7 +61,7 @@ guile_LDADD = libguile.la guile_LDFLAGS = @DLPREOPEN@ libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \ - chars.c continuations.c convert.c debug.c deprecation.c dynl.c \ + chars.c continuations.c convert.c debug.c deprecation.c \ dynwind.c environments.c eq.c error.c eval.c evalext.c extensions.c \ feature.c fluids.c fports.c \ gc.c gc_os_dep.c gdbint.c gh_data.c gh_eval.c gh_funcs.c gh_init.c \ @@ -113,7 +113,7 @@ BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h scmconfig.h \ EXTRA_libguile_la_SOURCES = _scm.h \ alloca.c inet_aton.c memmove.c putenv.c strerror.c \ - threads.c regex-posix.c \ + dynl.c threads.c regex-posix.c \ filesys.c posix.c net_db.c socket.c \ ramap.c unif.c debug-malloc.c mkstemp.c \ win32-uname.c win32-dirent.c win32-socket.c diff --git a/libguile/dynl.c b/libguile/dynl.c index 494b88dfe..4cc46d1e3 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -75,8 +75,6 @@ maybe_drag_in_eprintf () #include "libguile/lang.h" #include "libguile/validate.h" -#ifdef DYNAMIC_LINKING - #include "libltdl/ltdl.h" /* From the libtool manual: "Note that libltdl is not threadsafe, @@ -133,46 +131,6 @@ sysdep_dynl_init () lt_dlinit (); } -#else - -/* no dynamic linking available, throw errors. */ - -static void -sysdep_dynl_init (void) -{ -} - -static void -no_dynl_error (const char *subr) -{ - scm_misc_error (subr, "dynamic linking not available", SCM_EOL); -} - -static void * -sysdep_dynl_link (const char *filename, const char *subr) -{ - no_dynl_error (subr); - return NULL; -} - -static void -sysdep_dynl_unlink (void *handle, - const char *subr) -{ - no_dynl_error (subr); -} - -static void * -sysdep_dynl_func (const char *symbol, - void *handle, - const char *subr) -{ - no_dynl_error (subr); - return NULL; -} - -#endif - scm_t_bits scm_tc16_dynamic_obj; #define DYNL_FILENAME(x) (SCM_CELL_OBJECT_1 (x)) diff --git a/libguile/extensions.c b/libguile/extensions.c index 7fd311cce..c01194179 100644 --- a/libguile/extensions.c +++ b/libguile/extensions.c @@ -103,9 +103,11 @@ load_extension (SCM lib, SCM init) } } +#if defined (DYNAMIC_LINKING) /* Dynamically link the library. */ scm_dynamic_call (init, scm_dynamic_link (lib)); +#endif } void diff --git a/libguile/init.c b/libguile/init.c index e4567600c..0e8b6ff73 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -556,7 +556,9 @@ scm_init_guile_1 (SCM_STACKITEM *base) scm_init_simpos (); scm_init_load_path (); scm_init_standard_ports (); /* Requires fports */ +#ifdef DYNAMIC_LINKING scm_init_dynamic_linking (); +#endif #ifdef SCM_ENABLE_ELISP scm_init_lang (); #endif /* SCM_ENABLE_ELISP */