RE: Dynamic Libraries on MacOS X
Possible Solution: Frameworks. A "Framework" on MacOS X is a directory that contains a dynamic library plus associated resources and header files. There is an extra compiler/linker option for linking to a framework. The big advantage is that the place they are supposed to be installed in is accessible from the user interface. I've created a framework called "HaskellSupport.framework", and I've made ghc link to that.
It sounds like frameworks are similar in concept to GHC's packages. It's usually a good idea to comply with whatever is the approved way of doing things on a given platform, so I think this sounds like a reasonable solution.
Disadvantage: Problems with GHCi (yes, I've almost got it to work!) - "-framework HaskellSupport" is in the extra_ld_opts field of the RTS package, so GHCi doesn't know that it has to load the libraries.
That sounds fine... as long as HaskellSupport doesn't contain any static libraries, right?
Related Problem: Sooner or later, GHC for MacOS X should support Apple's Frameworks anyway, as almost all functionality beyond the standard C library is packaged in frameworks. I don't know yet how much work that would be for me, and I fear that the ghc gurus would dislike too much platform-specific code for Apple's non-standard features... Here's what I'd like to do:
I don't object at all to adding MacOS X specific code for frameworks, as long as there's someone around to maintain it!
*) add two command line options that get passed on to the linker (-framework for linking with a framework and -F for specifying framework search paths) *) add corresponding entries to package.conf
You mean add a new package for each framework? That's what I would suggest, if it is at all possible. If that's the case, then is the -framework option needed at all, since you can use -package instead?
*) add code for GHCi to load frameworks.
Same here: if a framework is really just a collection of libraries and a search path, then converting frameworks into packages will mean that GHCi can load them as normal. Cheers, Simon
participants (1)
-
Simon Marlow