[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA-dev: Cygwin installation packages



Cesar Strauss wrote:
> Yes, I can confirm this. Full of undefined references. I admit I did not even
> noticed the shared library wasn't being built by default, before you wrote.
>
> For the GNU/Linux audience: Windows DLLs must have all dependencies resolved
> already at build time, unlike shared libraries on GNU/Linux. It appears libgeda
> relies on this to implement a kind of callback mechanism, by linking back to the
> main executable. It's the classic "chicken-and-egg" problem. Jason, could you
> correct me, if I am wrong?
>
> For the record, I still think it would be worth it if you could submit your fix
> for the developers to review. In that way, future gEDA releases could become
> even more portable. Only a sugestion, tough.
>   

Cesar,

I'd need to go back and checkout a cvs version if I was going
to work on the DLL import/export patch to any further extent, but
you are correct. The DLL has restrictions on importing variables and
functions from executables.  A library definition file (I called it
libgeda.def) has to be created to link all of the programs that will
use this library and it has to be done before you build the library.

This file looks something like this:

IMPORT
    gschem.exe.do_logging
    gschem.exe.colors
    gschem.exe.arc_draw_func
    ...

While this will work, it will only work for the gschem program to link 
against and
gattrib.exe will complain that gschem.exe is missing. Or you could add 
all of
the gaf programs to the import list, but this kinda defeats the purpose of
dynamic linking.

The way I tackled this was to reverse the direction on these imports and 
make them
exports. This should work fine (and it appeared to in my testing), and 
if I remember
correctly the Linux .so would work ok since it should allocate the
global variables with the requesting application's scope as well.

If I get around to it, I'll put a patch up.

----------------------------

Now I'm just waiting to here if there is any place I can upload these 
packages for
others to test/utilize.

Thanks,
Jason




_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev