Re: How to get Cabal to spit out a .a library suitable for linking into C/Objective-C

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: How to get Cabal to spit out a .a library suitable for linking into C/Objective-C

Donn Cave-4
Sorry about the belated response, but this shouldn't be a problem since
it isn't going to be very helpful anyway!

I've managed to follow the process described on this page:
http://www.haskell.org/haskellwiki/Using_Haskell_in_an_Xcode_Cocoa_project
to link Haskell code to a non-Haskell main program, via Xcode.

You've probably already seen this, it's mostly about a few iterations
of trial and error linking, to get the list of GHC library dependencies,
which is what you need whether you're using Xcode or not.  If you really
need a single library with your code and all those dependencies, that
may be technically feasible, though awfully tedious.

The only clear problem I encountered while experimenting with it is that
GHC run time options need ghc -rtsopts, so they're unavailable if your
program isn't built by ghc.  I believe I worked around that with a special
rtsmain.o, could probably recover the details if that's of interest.

        Donn

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: How to get Cabal to spit out a .a library suitable for linking into C/Objective-C

David Pollak


On Mon, Dec 26, 2011 at 4:40 PM, Donn Cave <[hidden email]> wrote:
Sorry about the belated response, but this shouldn't be a problem since
it isn't going to be very helpful anyway!

I've managed to follow the process described on this page:
http://www.haskell.org/haskellwiki/Using_Haskell_in_an_Xcode_Cocoa_project
to link Haskell code to a non-Haskell main program, via Xcode.

You've probably already seen this, it's mostly about a few iterations
of trial and error linking, to get the list of GHC library dependencies,
which is what you need whether you're using Xcode or not.  If you really
need a single library with your code and all those dependencies, that
may be technically feasible, though awfully tedious.

Thanks for the pointer.  I had already read this.  I am looking for a non-trial-and-error mechanism for creating a statically linked .a file.  It's Step 8 in the article.

Thanks for your help.

David
 

The only clear problem I encountered while experimenting with it is that
GHC run time options need ghc -rtsopts, so they're unavailable if your
program isn't built by ghc.  I believe I worked around that with a special
rtsmain.o, could probably recover the details if that's of interest.

       Donn

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



--
Visi.Pro, Cloud Computing for the Rest of Us http://visi.pro
Lift, the simply functional web framework http://liftweb.net



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe