Separate load paths for shared libraries and gnucash loadable modules.

The former should be found on (DY)LD_LIBRARY_PATH, the latter on
GNC_MODULE_PATH. These paths shouldn't overlap as that needlessly
confuses things.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19648 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2010-10-11 20:46:36 +00:00
parent b762dfa3ae
commit f58788f91c
3 changed files with 2 additions and 43 deletions

View File

@ -52,7 +52,7 @@ GUILE_WARN_DEPRECATED=no
GUILE_LOAD_PATH={GNC_DATA}/guile-modules;{GNC_DATA}/scm;{GUILE_LIBS};{GUILE_LOAD_PATH}
# Tell Guile where to find GnuCash specific shared libraries
GNC_LIBRARY_PATH={SYS_LIB};{GNC_MODULE_PATH}
GNC_LIBRARY_PATH={SYS_LIB}
LD_LIBRARY_PATH={GNC_LIBRARY_PATH};{LD_LIBRARY_PATH}
# The same, but for GnuCash on OS X
DYLD_LIBRARY_PATH={GNC_LIBRARY_PATH};{DYLD_LIBRARY_PATH}

View File

@ -18,10 +18,8 @@ EXTRA_PATH="${EXTRA_PATH}:@-GNC_GUILE_MODULE_DIR-@"
EXTRA_PATH="${EXTRA_PATH}:@-GNC_SCM_INSTALL_DIR-@"
GUILE_LOAD_PATH="${EXTRA_PATH}:${GUILE_LOAD_PATH}"
EXTRA_LIBS="${GNC_MODULE_PATH}"
EXTRA_LIBS="${EXTRA_LIBS}:/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/"
EXTRA_LIBS="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/"
EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_LIB_INSTALLDIR-@"
EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_PKGLIB_INSTALLDIR-@"
LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
DYLD_LIBRARY_PATH="${EXTRA_LIBS}:${DYLD_LIBRARY_PATH}"

View File

@ -116,43 +116,6 @@ gnc_module_system_search_dirs(void)
return list;
}
/*************************************************************
* gnc_module_system_setup_load_path
* initialize the Guile load path
*************************************************************/
static void
gnc_module_system_setup_load_path(void)
{
GList * dirs = gnc_module_system_search_dirs();
GList * lp;
if (dirs)
{
char *envt = g_strdup(g_getenv("LD_LIBRARY_PATH"));
if (!envt)
{
envt = g_strdup("");
}
for (lp = dirs; lp; lp = lp->next)
{
char *tmp = g_strdup_printf("%s:%s", envt, (char *) lp->data);
g_free(envt);
envt = tmp;
g_free(lp->data);
}
g_list_free(dirs);
if (!g_setenv("LD_LIBRARY_PATH", envt, TRUE))
{
g_warning ("gnc-module failed to set LD_LIBRARY_PATH");
}
g_free(envt);
}
}
/*************************************************************
* gnc_module_system_init
* initialize the module system
@ -166,8 +129,6 @@ gnc_module_system_init(void)
loaded_modules = g_hash_table_new(g_direct_hash, g_direct_equal);
gnc_module_system_setup_load_path();
/* now crawl the GNC_MODULE_PATH to find likely libraries */
gnc_module_system_refresh();
}