[Haskell] Licensing problem, caused by static linking on windows
Ben Lippmeier
Ben.Lippmeier at anu.edu.au
Sun Jul 4 20:52:58 EDT 2004
Kevin,
>The problem is that on Windows, GHC statically links the program with
>the libgmp library, which has an LGPL license. The LGPL license says
>that we can distribute the executable under our own terms, [...]
>
You could write a C wrapper around a run-time loaded library. Cygwin
supports dlopen() and friends so it might even be portable. You would
statically link the wrapper code so GHC has the symbols it needs, but
the actual functionality would remain in the original .dll / .so.
Though, if you've used lots of functions from libgmp it might be a
hassle to write the wrappers.
Ben.
[untested example code]
---- Wrapper.hs
foreign import ccall someFunction_Wrapper :: Int -> Int
---- Wrapper.c
int (*someFunction_WrapperSym)(int);
int someFunction_Wrapper (int x)
{
return someFunction_WrapperSym (x);
}
void initWrapper ()
{
void* handle = dlopen("where/is/libgmp.so", RTLD_NOW);
someFunction_WrapperSym = dlsym (handle, "someFunction");
}
More information about the Haskell
mailing list