Linking and Including nonstandard paths

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Apr 5 18:44:06 EDT 2007


On Thu, 2007-04-05 at 17:20 -0500, Chris McCraw wrote:

> 1) I'd like to embed an additional library search directory in ghc so
> that it does the equivalent of -L/path/to/extra/dir every time it's
> used to link something.  Unfortunately, our libgmp resides in a nonstandard
> directory and so *every time* someone wants to compile they must
> 	ghc -L/lusr/gnu/lib ...
> to find -lgmp.

Modify the library-dirs used by the rts packages to include your extra
linker search path. eg:

- library-dirs: /usr/local/lib/ghc-6.6
+ library-dirs: /usr/local/lib/ghc-6.6, /lusr/gnu/lib

First, backup ghc's package.conf file just in case...

Then:
$ ghc-pkg describe rts > rts.package.conf
$ $EDITOR rts.package.conf
$ ghc-pkg update rts.package.conf

Duncan



More information about the Glasgow-haskell-users mailing list