Re: Cabal -extra-lib-dirs and -rpath, also framework-dirs

On Sun, 2007-06-03 at 15:48 -0700, Ashley Yakeley wrote:
1. It seems entries on the extra-lib-dirs line in cabal (GHC 6.6) are not passed to the linker with -rpath. Instead, you have to do that in ld-options with "-Wl,-rpath -Wl,mylibdir". The trouble is this is not portable, as the Darwin (Mac OS X) linker doesn't accept the -rpath option and (I think) simply uses all -L directories for the runtime path or some clever thing.
I recommend that either extra-lib-dirs be passed as -rpath (as appropriate for the platform), or a new field such as "extra-rpath-dirs" be added.
Ugg. This is somewhat a can of worms. For one thing it doesn't work on windows, but also it's not necessarily what one always wants. For example building on one machine and deploying on another, if there are specific paths baked into the libraries/executables that might be intended to be on the standard dynamic linker path on the target machine. I think this issue needs a fair bit of thought before we go and implement something. We should see what other systems do etc.
2. Cabal doesn't recognise "framework-dirs" as a field name, even though it shows up in "ghc-pkg describe".
Yes, cabal does not currently support that field. It probably should. The format used by ghc-pkg is quite similar to the cabal format, but not exactly the same, so don't be surprised by things appearing in one and not the other, or having slightly different names or meanings. Duncan

Duncan Coutts wrote:
2. Cabal doesn't recognise "framework-dirs" as a field name, even though it shows up in "ghc-pkg describe".
Yes, cabal does not currently support that field. It probably should. The format used by ghc-pkg is quite similar to the cabal format, but not exactly the same, so don't be surprised by things appearing in one and not the other, or having slightly different names or meanings.
Yes, this is an important point. The ghc-pkg format is InstalledPackageInfo, see http://darcs.haskell.org/packages/Cabal/Distribution/InstalledPackageInfo.hs whereas the .cabal file contains a PackageDescription, which is quite a different beast. They happen to look similar and contain several fields in common, though. It might be reasonable for .cabal to have framework-dirs, but I don't know anything about frameworks... anyone? Cheers, Simon
participants (2)
-
Duncan Coutts
-
Simon Marlow