[GRASS-dev] Configuring --with-readline doesn't use -lncurses or
-ltermcap
Glynn Clements
glynn at gclements.plus.com
Thu Dec 21 22:02:01 EST 2006
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.
On a related note: how many people actually feed complex expressions
to r.mapcalc via stdin?
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list