I wrote: > I've read the message referenced above several times, but I've failed to > understand why we cannot use 'lt_dladdsearchdir' to augment the path, as > shown in the first code excerpt of that message: > > env = getenv ("GUILE_SYSTEM_EXTENSIONS_PATH"); > > [...] > > if (env) > lt_dladdsearchdir (env); > else > { > lt_dladdsearchdir (SCM_LIB_DIR); > lt_dladdsearchdir (SCM_EXTENSIONS_DIR); > }
Actually, I can already see a problem with this. SCM_LIB_DIR is usually (always?) already present in the library search paths before Guile is initialized. It is set to $(libdir) by libguile/Makefile. Isn't $(libdir) where libguile is installed? A common case where this causes problems (the same one Bruce ran into) is when SCM_LIB_DIR is /usr/lib, but the user has configured /usr/local/lib to precede /usr/lib in the library search path. Therefore, we must not add SCM_LIB_DIR to LD_LIBRARY_PATH, nor to LTDL_LIBRARY_PATH, nor via 'lt_dladdsearchdir', or else we will reverse the ordering of /usr/local/lib and /usr/lib that many people depend upon. The only possible option is to manually search it after all else has failed, but it seems to me that we shouldn't be adding SCM_LIB_DIR at all. It should already be there. SCM_EXTENSIONS_DIR is another matter. It is unlikely to already be present in the library search path, and in any case should not contain anything other than Guile extensions. Therefore, it is appropriate to do: lt_dladdsearchdir (SCM_EXTENSIONS_DIR) unless GUILE_SYSTEM_EXTENSIONS_PATH is set. With this in mind, I now propose the following: --8<---------------cut here---------------start------------->8--- env = getenv ("GUILE_SYSTEM_EXTENSIONS_PATH"); if (env) lt_dladdsearchdir (env); else lt_dladdsearchdir (SCM_EXTENSIONS_DIR); --8<---------------cut here---------------end--------------->8--- and then to run the uninstalled guile, we'd need to set (or augment) one of the *_LIBRARY_PATH environment variables to point within the build directory, and also set GUILE_SYSTEM_EXTENSIONS_PATH. What do you think? On a related topic, why is libguilereadline-v-18.* installed in SCM_LIB_DIR and not SCM_EXTENSIONS_DIR? Thanks, Mark