creating a library from haskell files and a c wrapper in Linux

Martin Norbäck d95mback@dtek.chalmers.se
10 Sep 2002 15:40:30 +0200


--=-ZpWVBRaG/auoiJdUEwhB
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I'm trying to create a (dynamic) library from a bunch of Haskell modules
and some C code that calls functions exported from Haskell via the FFI.

The problem is that I don't know how to link everything into a library.

The first problem I had was that DLL_IMPORT which was found in some
header files is undefined in Linux, so I just passed -DDLL_IMPORT=3D to
gcc.

The next problem is that I can't get ghc to make a library file for me,
the --mk-dll flag just makes ghc output nothing, and I can find no other
flag to make ghc create a library instead of a binary.

I'll try to find out the right libraries to pass to ld, but it would be
much easier if ghc could do it by itself, as it can do under Windows.

Regards,

	Martin

--=20
Martin Norb=E4ck          d95mback@dtek.chalmers.se             =20
Kapplandsgatan 40       +46 (0)708 26 33 60                   =20
S-414 78  G=D6TEBORG      http://www.dtek.chalmers.se/~d95mback/
SWEDEN                  OpenPGP ID: 3FA8580B

--=-ZpWVBRaG/auoiJdUEwhB
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: För information se http://www.gnupg.org/

iD8DBQA9ffZNkXyAGj+oWAsRAkstAKCBUt7F1I9IwDJtHlXE2ujGNPvC2gCgjo6l
g11DFDZn+Sug68UdaNaSn5g=
=4ZVt
-----END PGP SIGNATURE-----

--=-ZpWVBRaG/auoiJdUEwhB--