readline on macs

Christian Maeder Christian.Maeder at dfki.de
Mon Jan 7 09:55:52 EST 2008


Judah Jacobson wrote:
> On Jan 5, 2008 10:29 AM, Thorkil Naur <naur at post11.tele.dk> wrote:
>> On Friday 04 January 2008 12:03, Christian Maeder wrote:
>>
>> I understand that there are problems in this area, but I am not convinced that
>> they could not be solved without the renamed and/or modified readline
>> library. I am sorry if you have done that already elsewhere, but I don't
>> recall having seen any details about your difficulties. Would you be kind
>> enough to supply some details? Thanks a lot.

I'm against a further (renamed or modified) readline library (and I've
done nothing in that direction).

>>> The alternative is to use static linking of gmp (as suggested by chak)
>>> _and_ readline (version 5), so that user programs are also statically
>>> linked with these libs.

I just have succeeded in linking ghc-6.8.2 statically with libreadline.a
and libncurses.a in the compiler directory by setting:

SRC_HC_OPTS += -optl-Xlinker -optl-search_paths_first

in mk/build.mk.

This option prevents linking against the wrong dynamic library
/usr/lib/libreadline.dylib.

>> Again, I am not convinced that this is the only alternative.

I don't see an advantage of a renamed or modified readline library
(it'll be even more version confusion).

> There is another alternative (which I think we talked about before):

yes in http://hackage.haskell.org/trac/ghc/ticket/1798

> Have ghc manually search for frameworks in the standard folders
> (rather than letting gcc do it automatically).  Then if we found e.g.
> /Library/Frameworks/GNUreadline.framework, we would pass the following
> flag:
> -I/Library/Frameworks/GNUreadline.framework/Versions/A/Headers

It's not even necessary to specify a version. Enough is:

 -I/Library/Frameworks/GNUreadline.framework/Headers

or in $HOME:

 -I$HOME/Library/Frameworks/GNUreadline.framework/Headers

> In that case, we would not need modified readline headers.

This way I wanted to go before (saving some -F trouble for some -I
trouble), but proper mac frameworks should also have proper mac
framework headers.

> However, I really don't like the above, since we're reimplenting
> something gcc gives us for free.  And if we *do* rely on gcc's
> standard searching (as is the case now), then I agree with Christian
> that modified headers are necessary for GNUreadline to work as a
> framework.

yes.

[...]

With static linking the whole framework issue may become obsolete.

Cheers Christian


More information about the Glasgow-haskell-users mailing list