Linking to Haskell code from an external program

Colin Paul Adams colin at colina.demon.co.uk
Sun Nov 23 06:14:59 EST 2008


>>>>> "Simon" == Simon Marlow <marlowsd at gmail.com> writes:

    Colin> I then attempted to move it into Eiffel. I can compile the
    Colin> C code OK, but I'm running into problems with linking.
    >> 
    Colin> I solved most of the problems by adding the -v flag to the
    Colin> call to ghc which I used to link the original (haskell + c
    Colin> only) program, and cut-and-paste the linker options from
    Colin> their into the Eiffel configuration file. This isn't really
    Colin> satisfactory - I would like some automatic way to determine
    Colin> what the flags should be.

    Simon> The only other way I can think of is to construct the
    Simon> arguments yourself by querying the package database,
    Simon> e.g. "ghc-pkg field ld-options rts", but you'll have to
    Simon> combine the information from several different fields of
    Simon> the packages you use, and basically reproduce what GHC does
    Simon> to construct the ld command line.

Can you point me at where it does this?

Thanks.
-- 
Colin Adams
Preston Lancashire


More information about the Glasgow-haskell-users mailing list