r19648 - gnucash/trunk/src - Separate load paths for shared libraries and gnucash loadable modules.

Geert Janssens gjanssens at code.gnucash.org
Mon Oct 11 16:46:37 EDT 2010


Author: gjanssens
Date: 2010-10-11 16:46:36 -0400 (Mon, 11 Oct 2010)
New Revision: 19648
Trac: http://svn.gnucash.org/trac/changeset/19648

Modified:
   gnucash/trunk/src/bin/environment.in
   gnucash/trunk/src/bin/gnucash-setup-env-osx.in
   gnucash/trunk/src/gnc-module/gnc-module.c
Log:
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.

Modified: gnucash/trunk/src/bin/environment.in
===================================================================
--- gnucash/trunk/src/bin/environment.in	2010-10-10 22:21:43 UTC (rev 19647)
+++ gnucash/trunk/src/bin/environment.in	2010-10-11 20:46:36 UTC (rev 19648)
@@ -52,7 +52,7 @@
 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}

Modified: gnucash/trunk/src/bin/gnucash-setup-env-osx.in
===================================================================
--- gnucash/trunk/src/bin/gnucash-setup-env-osx.in	2010-10-10 22:21:43 UTC (rev 19647)
+++ gnucash/trunk/src/bin/gnucash-setup-env-osx.in	2010-10-11 20:46:36 UTC (rev 19648)
@@ -18,10 +18,8 @@
 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}"

Modified: gnucash/trunk/src/gnc-module/gnc-module.c
===================================================================
--- gnucash/trunk/src/gnc-module/gnc-module.c	2010-10-10 22:21:43 UTC (rev 19647)
+++ gnucash/trunk/src/gnc-module/gnc-module.c	2010-10-11 20:46:36 UTC (rev 19648)
@@ -117,43 +117,6 @@
 }
 
 /*************************************************************
- * 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 @@
 
     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();
 }



More information about the gnucash-changes mailing list