bugfix for configure script (misses readline library)

Glenn Burkhardt glenn at aoi.ultranet.com
Mon Dec 18 04:31:41 GMT 2000


I've always wanted to have 'readline' working in 'smbclient'.  I sat down to
add it today, and found that it already was coded, but that the configure
script was failing to find the readline library properly.  The problem is that
on several systems, the 'termcap' library is needed as well.

Samba version 2.0.7
Platforms:  Solaris 5.8, SunOS 4.1.4, Linux version 2.2.14-15mdk

In the config.log file on the Solaris system, you get something like this:

-------------------------------------------------------
configure:3712: checking for readline in -lreadline
configure:3731: gcc -o conftest -O   conftest.c -lreadline  -ldl  1>&5
Undefined                       first referenced
symbol                             in file
tgetnum                             /usr/local/lib/libreadline.a(terminal.o)
tgetstr                             /usr/local/lib/libreadline.a(terminal.o)
tgoto                               /usr/local/lib/libreadline.a(display.o)
tputs                               /usr/local/lib/libreadline.a(display.o)
tgetent                             /usr/local/lib/libreadline.a(terminal.o)
tgetflag                            /usr/local/lib/libreadline.a(terminal.o)
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 3720 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply.  */
char readline();

int main() {
readline()
; return 0; }
---------------------------------------------------------
The test will succeed if the link line is:

gcc -o conftest -O   conftest.c -lreadline  -ltermcap -ldl 

Attached is a patch for 'configure.in'.  Run 'autoconf' to generate a new
configure script.
-------------- next part --------------
--- configure.in.orig	Sun Dec 17 23:09:15 2000
+++ configure.in	Sun Dec 17 23:01:37 2000
@@ -312,7 +312,8 @@
 # test for where we get readline() from
 if test "$ac_cv_header_readline_h" = "yes" ||
    test "$ac_cv_header_readline_readline_h" = "yes"; then
-  AC_CHECK_LIB(readline,readline)
+  AC_CHECK_LIB(readline,readline, [LIBS="$LIBS -lreadline -ltermcap";
+			AC_DEFINE(HAVE_LIBREADLINE)],, -ltermcap)
 fi
 
 


More information about the samba mailing list