diff options
author | Andy Wingo <wingo@pobox.com> | 2009-09-16 18:10:19 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-09-16 18:10:19 +0200 |
commit | eb350124a85dd4daf39bacbdc50452ef87a33a43 (patch) | |
tree | 96674005d8eb32842ca07305b5cfe0ae2480e602 /libguile/dynl.c | |
parent | db723980a4b1e4d4d4d665283d1bc0b792c751bf (diff) | |
download | guile-eb350124a85dd4daf39bacbdc50452ef87a33a43.tar.gz |
add the libdir to the ltdl lib search path
* libguile/Makefile.am (libpath.h): Fix pkgdatadir, pkglibdir, and
pkgincludedir entries. Add a new define, SCM_LIB_DIR.
* libguile/dynl.c (sysdep_dynl_init): Add the libdir to the libltdl
search path. Should fix
http://thread.gmane.org/gmane.lisp.guile.bugs/4289/focus=4296 -- that
is, it should allow guile to be invoked from whereever it is
installed, without munging LTDL_LIBRARY_PATH or the like variables.
There is a trick though -- during the build, we don't want to be
looking in the $libdir for loadable modules. So as with
GUILE_SYSTEM_PATH, we have GUILE_SYSTEM_LTDL_PATH.
* meta/uninstalled-env.in: Set GUILE_SYSTEM_LTDL_PATH to "" when
building.
Diffstat (limited to 'libguile/dynl.c')
-rw-r--r-- | libguile/dynl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libguile/dynl.c b/libguile/dynl.c index dc98e7d17..6b13e65a9 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -48,6 +48,7 @@ maybe_drag_in_eprintf () #include <string.h> #include "libguile/_scm.h" +#include "libguile/libpath.h" #include "libguile/dynl.h" #include "libguile/smob.h" #include "libguile/keywords.h" @@ -113,7 +114,21 @@ sysdep_dynl_func (const char *symb, void *handle, const char *subr) static void sysdep_dynl_init () { + char *env; + lt_dlinit (); + + env = getenv ("GUILE_SYSTEM_LTDL_PATH"); + if (env && strcmp (env, "") == 0) + /* special-case interpret system-ltdl-path=="" as meaning no system path, + which is the case during the build */ + ; + else if (env) + lt_dladdsearchdir (env); +#ifdef SCM_LIB_DIR + else + lt_dladdsearchdir (SCM_LIB_DIR); +#endif } scm_t_bits scm_tc16_dynamic_obj; |