1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

* 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.

	* 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.
This commit is contained in:
Gary Houston 2002-07-12 17:46:15 +00:00
parent 7e7eb95b41
commit 4f6f9ae3d3
7 changed files with 53 additions and 65 deletions

View file

@ -1,3 +1,9 @@
2002-07-12 Gary Houston <ghouston@arglist.com>
* 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 <marius.vollmer@uni-dortmund.de>
* autogen.sh: Patch libltdl/ltdl.c to avoid a nasty bug in

View file

@ -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)

View file

@ -1,3 +1,19 @@
2002-07-12 Gary Houston <ghouston@arglist.com>
* 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 <mvo@zagadka.ping.de>
* guile.c, iselect.h, net_db.c, posix.c, socket.c: No need to

View file

@ -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

View file

@ -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))

View file

@ -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

View file

@ -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 */