
Hi, Captain !
I got haskell shared libraries with following cabal command:
cabal install --global --reinstall --disable-library-profiling
--enable-shared --ghc-option=-dynamic mtl
and so on.
It allowed me to get haskell libraries and I could compile my own
shared libraries. And ldd helps me to know which libraries need me to
use them on users computers with my library. I believe this cabal
options can set in ~/.cabal/config or somethisg like this. In my case
I merely create shell script and call it cabal-shared.sh. :)
There is my options to compile my library:
ghc -O2 --make -no-hs-main -dynamic -shared -fPIC -optl '-shared'
-optc '-DMODULE=MyLibModule' -o MyLibModule.so MyLibModule.hs
module_init.c -optl-Wl -lHSrts-ghc7.0.2
where module_init.c has contents:
#define CAT(a,b) XCAT(a,b)
#define XCAT(a,b) a ## b
#define STR(a) XSTR(a)
#define XSTR(a) #a
#include