readline checks [Re: Compiling error Samba_TNG]

Michael Ju. Tokarev mjt at
Fri Feb 25 18:20:55 GMT 2000

Luke Kenneth Casson Leighton wrote:
> delete and do a cvs co again.  it would help if i had access to a system
> with readline on it, the debian install i have has it but configure fails
> to detect it.
> can someone please fix this and send me a patch? thx.
> i' refuse to wade through code i can't compile if it doesn't have decent
> indentation, this code is a mess ( { and } don't line up).

Luke, patch against _what_ you need?...  There are too many versions of samba around... :(

Readline is not detected, as I can guess, because it need to be linked with
curses/nsurses/terminfo library.  If I wrote
  cc test.c -lreadline
things will not compile, leaving some messages like
  ld: unresolved symbol tputs
But if I wrote
  cc test.c -lreadline -lcurses  (or -ltermcap or even both (!) )
all will be ok.

There is a strange thing with readline (and with any library that uses some termcap/curses
calls).  With _what_ library final program should be linked? And what libraries are
avaliable for this on target system?  All of this should be tested: first, check
if ncurses/curses is here, since it is preferable over termcap, second, check if
-ltermcap here, and, after finding _one_ of those 3 libs, test if readline is here
_with_ found lib. I looked to bash sources, where it test version of readline installed,
and found in config.log something like:
  ld ... -lreadline -ltermcap -lcurses
  ld: -ltermcap: library not found
  configure: readline version is too old, using supplied one
I noticied that my system does not have libtermcap, but have libcurses (that is enouth
for readline) and have recent readline...  So tests used by bash is incorrect.
Another package that used readline was ncftp, but them wrote theyr own (ugly) replacement
So with this -- I can't suggest any real test against readline for now...

As a side note -- what _headers_ was used by readline itself while compiling? Was them
from termcap or from curses? And (on some platforms maybe) here may be completely
confusing situation -- if I have both termcap+curses, it will be ok to link with one
but wrong with another, dependant on headers used...

And on my solaris, is symlink to
With linux, situation is harder. (Why linux even provides termcap?! Curses supercedes
it and have _large_ terminfo database what can be accessed far more quickly when
termcap file...)

Does anybody knows correct solution for this?

P.S. Crossposted to samba and bash-bugs...
P.P.S. I only subscribed to samba...

More information about the samba-technical mailing list