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");
}




_______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Reply via email to