[GRASS5] [bug #2526] (grass) compiling with readline

Glynn Clements glynn.clements at virgin.net
Fri Jul 9 01:02:44 EDT 2004


Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=2526

> Subject: compiling with readline

> I had a little problem when compiling GRASS with readline on fedora
> 2: Linking readline fails when ncurses is not linked as well. I
> adapted the configure script accordingly such as the configure and
> make process are ending correctly.

This is a known issue. However, we don't know of a reliable solution. 
Certainly, linking with -lncurses will fail on some platforms (i.e. if
they have libcurses rather than libncurses). Even if it works, it may
be overkill (readline only actually requires the termcap query
functions).

Essentially, the problem is that libreadline requires the following
termcap functions:

	tgetent
	tgetflag
	tgetnum
	tgetstr
	tgoto

There are several different libraries which might provide these
functions, including libtermcap, libtinfo and libcurses/libncurses. 
Many platforms have at least two of these libraries. Linking with any
of them will typically "work", in the sense that the configure checks
succeed and r.mapcalc links.

However, the behaviour may vary depending upon which one is used. In
particular one library may obtain terminal descriptions from the
termcap database (a single text file, typically /etc/termcap), while
another may use the terminfo database (a directory tree populated with
binary files, typically /usr/lib/terminfo or /usr/share/terminfo).

One some systems, one of the two databases might be either incomplete
or inaccurate (this is quite common), and there is no way to determine
this using a configure test. I.e. we might be able to get r.mapcalc to
compile, and link, and even run (in the sense that it doesn't crash or
terminate with an error code), but it may not actually be usable (i.e. 
pressing one of the arrow keys just appends an escape sequence to the
entered text).

Ultimately, the only real solution is for distribution vendors to
build libreadline with dependency information. They seem to manage it
for most of the other libraries, and some of them manage it for
libreadline (e.g. the RedHat 6.2 libreadline has a dependency against
libtermcap).

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list