[GRASS-dev] Configuring --with-readline doesn't use -lncurses or -ltermcap

Brad Douglas rez at touchofmadness.com
Fri Dec 22 04:38:11 EST 2006


On Fri, 2006-12-22 at 03:02 +0000, Glynn Clements wrote:
> Gregor Mosheh wrote:
> 
> > Hi, all. I encountered a problem configuring --with-readline A workaround
> > exists in the mailing list archives, but since the problem still exists
> > almost 2 years after the workaround was posted, sholl asked me to post it
> > to the devel list to bring it to your attention.
> > 
> > Problem:
> > When --with-readline is supplied, configure reports that readline was not
> > found.
> > 
> > Analysis:
> > Examining the config.log, the compile of conftest.c includes the
> > -lreadline flag, but does not include either -lncurses or -ltermcap which
> > is required for GNU readline. The result is linking errors to the effect
> > of "undefined reference to `tgetnum'" et al.
> > 
> > Workaround:
> > Set LDFLAGS in the environment to force -lncurses
> 
> Yuk. That will add a ncurses dependency to every single library and
> executable.
> 
> > http://grass.itc.it/pipermail/grassuser/2005-February/027824.html
> > 
> > Ideal:
> > Have configure detect whether to use -lncurses or else -ltermcap, and have
> > it use that flag, so configure will properly link with readline and thus
> > detect it.
> 
> How is it meant to know *which* library to use? Both provide the
> necessary functions (as does -ltinfo if you have that library), but
> they don't necessarily behave the same (particularly on platforms
> other than Linux, where e.g. -ltermcap may actually use the termcap
> database while -lncurses may use the terminfo database).
> 
> Ideal:
> The OS vendor adds the correct library as a dependency of libreadline.
> 
> On my system (Gentoo):
> 
> $ ldd /lib/libreadline.so
> 	linux-gate.so.1 =>  (0xffffe000)
> 	libncurses.so.5 => /lib/libncurses.so.5 (0xb7f65000)
> 	libc.so.6 => /lib/libc.so.6 (0xb7e4c000)
> 	/lib/ld-linux.so.2 (0x80000000)
> 
> --with-readline works fine here.
> 
> I consider this a WONTFIX until someone comes up with a coherent
> answer to the question of how to choose amongst multiple competing
> "providers" of tgetent etc.

FYI, this is what RedHat has to say (from bug tracker):

"There are people who need to link against termcap, and people who need
to link against ncurses.  The choice has to be made at compile time for
*their* app, not readline."

> On a related note: how many people actually feed complex expressions
> to r.mapcalc via stdin?

I have on rare occasion, but I certainly did not require readline to do
so.  I don't think the prompt has any real significance anymore.  I find
it more useful (and more to GRASS style) to use 'map=expression' and
script it if I need repetition.

I vote to remove readline.


-- 
Brad Douglas <rez touchofmadness com>                    KB8UYR/6
Address: 37.493,-121.924 / WGS84    National Map Corps #TNMC-3785




More information about the grass-dev mailing list