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

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Jun 4 06:59:06 EDT 2007


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



More information about the Libraries mailing list