code in cvs is broken

Derek Atkins warlord@MIT.EDU
14 Nov 2001 10:25:18 -0500


Bill Gribble <grib@linuxdevel.com> writes:

> IMO, it's just an accident that your modules load.  They are badly
> formed if they don't link against all the things that they depend on. 

They link against it at runtime, not link time.

> Each gnc-module should be self-contained.  That is, this script should
> load your business module and anything else it needs: 
> 
>   (use-modules (gnucash gnc-module)
>   (gnc:module-system-init)
>   (gnc:module-load "gnucash/business-module" 0)
> 
> and the trivial C program 
> 
>   #include <stdlib.h>
>   int main(int argc, char ** argv) { exit 0; }

The way I link at runtime is that my module (in the scheme code) loads
the dependency modules.

> should be able to link against just your module's .la file without
> having any undefined symbols.  These tests are generally called
> 'test-link-module' and 'test-load-module' in the existing source tree. 
> 
> If you don't link against all the things you need, that script will fail
> or the program will not link. 

As I've said the Dave in private mail, I still don't really understand
how modules work in GC, but considering what I've got is working I'm
just going to stick with it and wait until later to "do it right".
I'd rather work on getting the features written and tested than making
sure I follow the proper module usage.

I've pretty much tried to copy what the engine and "gnc" modules
(Aside: I think 'gnc' is a really bad name for the Gnome interface
module!) do.  Note that the gnc module does NOT link against
libgncmod-engine.la either...  It does what I do: (use-module (... engine))

> Now if you are saying that your modules don't have any linkage
> dependencies on anything else, that's great.  I encourage that!  but
> please remember that modules are supposed to be reusable and
> self-contained, and if you do have linkage dependencies on another
> library, you should express that.  

Don't I wish -- but no, I need to call into the engine and some of
the gnome-utils functions.  In fact, I can't see how this would ever
work.

> b.g.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available