darcs patch: [PROOF OF CONCEPT] build readline package with libedit

Judah Jacobson judah.jacobson at gmail.com
Tue Jan 8 11:38:56 EST 2008

On Jan 8, 2008 5:39 AM, Simon Marlow <simonmarhaskell at gmail.com> wrote:
> Ian Lynagh wrote:
> > Perhaps the best answer is for someone to make editline bindings for
> > Haskell?
> I don't *think* libedit provides the completion functionality that we use
> in GHC, but I could be wrong.

The only way to know for sure is to try it out!  Attached is a
proof-of-concept patch which adds the --with-libedit flag to the
readline package's autoconf scripts.

  * PROOF OF CONCEPT: add --with-libedit flag to allow building a
minimal version of the library against libedit.

    M ./HsReadline_cbits.c +2
    M ./System/Console/Readline.hsc -1 +50
    M ./aclocal.m4 +6
    M ./configure.ac -4 +10

With this patch (and a small, unrelated hack to statically link gmp) I
was able to build a version of ghc which only depends on the dynamic
libraries installed on OS X 10.4 by default:

$ otool -L ghc-6.9.20071221
        /usr/lib/libedit.2.dylib (compatibility version 2.0.0, current
version 2.0.0)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0,
current version 5.4.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 88.3.9)

I played around with completion of filenames, modules, identifiers and
flags in ghci, and it all seems to be working fine.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libedit.patch
Type: application/octet-stream
Size: 8684 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20080108/9b514bb6/libedit-0001.obj

More information about the Glasgow-haskell-users mailing list