[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: readline, termcap, ncurses
- From: uwe@... (Valeriy E. Ushakov)
- Date: Wed, 10 Nov 2010 22:27:50 +0000 (UTC)
Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> For Linux, the Makefile in 5.1 used
> -lreadline -lhistory -lncurses
>
> In 5.2 it is now
> -lreadline -lncurses
> but many current Linux (e.g. Ubuntu) do not need any additional library
> to use readline. This is the case with Mac OS X as well. Some Linux
> (e.g. CentOS 5.5) need -ltermcap and don't have -lncurses. (Perhaps it's
> just the one CentOS I have access to.)
>
> I've tried to find out what is the official way to use readline but failed:
> readline seems to work with either -lncurses or -ltermcap.
When realine is configured it picks up correct library to link against
and for dynamic linking it will get recorded (in its NEEDED entry on
ELF systems, dunno about MacOS and MACHO), so dynamic linking should
just work with -lreadline alone.
If someone *really* wants to link static lua I guess they can figure
out what are realine dependencies on their system.
readline uses termcap API, so if you really want to provide complete
set of libraries you need to link against the library that provides
termcap API.
I have supressed most memories about the gory details (I guess it's
been 15+ years since last time I really had to care), so might be
wrong in some details.
There are two ways to describe terminal capabilities: termcap and
terminfo. curses is a higher level API (windows and stuff) that
internally uses termcap or terminfo, depending on what your system
uses.
On "native termcap" systems termcap API is provided by libtermcap.
On "native terminfo" systems, and here my memory is hazy, all the code
is usually in libcurses that doesn't need any additional libraries.
Since there's still quite a bit of code written against termcap API,
terminfo-based systems usually provide termcap API that is actually
implemented using terminfo database. On such systems there's often
libtermcap that is often just a symlink to libcurses or is a separate
library that is really built from the same code base but with the
curses parts stripped.
And I can't remember for life what libtermlib used to be. :)
-uwe