[Haskell-cafe] Building foreign shared libraries with Cabal

Nikolay Amiantov nikoamia at gmail.com
Mon Apr 21 08:25:32 UTC 2014


Hello,

I want to use cabal to build and install shared library, which will be
called from C. I've already found necessary combination of flags and
options to successfully build it, but now I have two main issues:

1) The library is installed into "bin".
2) The generated "stub" C headers are not installed at all.

How can I resolve this? My current options is as follows:

executable libtest.so
  hs-source-dirs:      src
  main-is:             Test.hs
  default-language:    Haskell2010
  default-extensions:  ForeignFunctionInterface
  build-depends:       base >= 4.7
  c-sources:           cbits/library_init.c
  ghc-options:         -no-hs-main -shared -dynamic
  cc-options:          -DMODULE=Test -fPIC

Thanks for any help and have a nice day,
Nikolay.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140421/1cd64008/attachment.html>


More information about the Haskell-Cafe mailing list