[Haskell-cafe] Haskeline, pcre-light, iconv and Cabal on OSX

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Feb 1 21:16:08 EST 2009

On Sun, 2009-02-01 at 17:10 -0800, Judah Jacobson wrote:

> > Someone said that it is just the macports version of iconv that has this
> > problem but I don't understand that at all. If we're using default
> > ghc/gcc then we should not be looking in any non-standard include
> > directories at all.
> The pcre library isn't installed by default, so an OS X users might
> get it from MacPorts (which installs it in /opt/local/lib).  And when
> building the Haskell pcre-light package, they'd do something like
> cabal install pcre-light --extra-lib-dirs=/opt/local/lib
> But then any other package that depends on pcre-light will also get
> the same linker option.

Yes. Sigh. A limitation of the C linker search path model.

> > The other thing that makes no sense is that
> > the /usr/lib/libiconv.dywhatever file apparently contains both
> > _iconv_open and _libiconv_open so why can't we link to the ordinary
> > _iconv_open one?
> The problem is that with -L/opt/local/lib (which is now passed to any
> package depending on pcre-light), the linker uses
> /opt/local/lib/libiconv.*  and ignores /usr/lib/libiconv.* altogether.
> Hope that helps explain it better,

Yes, thanks.

I wonder if it wouldn't be better to search the standard lib dirs first.
I'm sure the whole issue is a can of worms.


More information about the Haskell-Cafe mailing list