GNC_MODULE_PATH loaded twice

Geert Janssens janssens-geert at telenet.be
Mon Oct 11 06:11:38 EDT 2010


I've been doing some code reading in the gnc_module code.

I've found that at some point the paths in environment variable 
GNC_MODULE_PATH are appended to the environment variable LD_LIBRARY_PATH. This 
happens somewhere early in the gnc_module initialization [1].

However at the time the gnc_module code is run GNC_MODULE_PATH has already 
been added to LD_LIBRARY_PATH. On linux and compatibles this happens as a 
result of parsing the environment configuration file [2]. Mac OS X/Quartz uses 
gnucash-launcher (if built from source) or the startup script inside the 
bundle. The Windows build currently doesn't even use GNC_MODULE_PATH anymore.

I guess the code in gnc_module is from the early days, when GnuCash only ran 
on linux. But I don't think it has any effect anymore. At least OS X and 
Windows don't use LD_LIBRARY_PATH to find shared libraries and in all cases 
the proper variables have been set up already.

So unless I am overlooking something, I'd like to remove the LD_LIBRARY_PATH 
modifying code from gnc_module altogether. To keep things simple.

Any objections ?

Geert



[1] See source file
http://svn.gnucash.org/trac/browser/gnucash/trunk/src/gnc-module/gnc-module.c
gnc_module_system_init calls gnc_module_system_setup_load_path at line 169 
(http://svn.gnucash.org/trac/browser/gnucash/trunk/src/gnc-module/gnc-
module.c#L169)
gnc_module_system_setup_load_path gets the paths found in GNC_MODULE_PATH
    via function gnc_module_system_search_dirs at line 127 
(http://svn.gnucash.org/trac/browser/gnucash/trunk/src/gnc-module/gnc-
module.c#L127) and appends these paths to the LD_LIBRARY_PATH

[2] see source file 
http://svn.gnucash.org/trac/browser/gnucash/trunk/src/bin/environment.in
This file is being parsed in 
http://svn.gnucash.org/trac/browser/gnucash/trunk/src/bin/gnucash-bin.c#L820


More information about the gnucash-devel mailing list