$NetBSD: patch-ad,v 1.2 2001/08/03 13:46:03 jlam Exp $ --- configure.orig Tue Apr 17 19:00:52 2001 +++ configure @@ -3705,18 +3705,61 @@ ############################################### # test for where we get readline() from +TERMLIBS= if test "$ac_cv_header_readline_h" = "yes" || test "$ac_cv_header_readline_readline_h" = "yes"; then + for termlib in termcap ncurses curses terminfo termlib; do + echo $ac_n "checking for tgetent in -l${termlib}""... $ac_c" 1>&6 +echo "configure:3714: checking for tgetent in -l${termlib}" >&5 +ac_lib_var=`echo ${termlib}'_'tgetent | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l${termlib} $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + TERMLIBS="-l${termlib}"; break +else + echo "$ac_t""no" 1>&6 +fi + + done echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:3712: checking for readline in -lreadline" >&5 +echo "configure:3755: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lreadline $LIBS" +LIBS="-lreadline $TERMLIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3742,21 +3785,21 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <> confdefs.h <<\EOF +#define HAVE_LIBREADLINE 1 EOF - LIBS="-lreadline $LIBS" - + break else echo "$ac_t""no" 1>&6 +TERMLIBS= fi fi + # The following test taken from the cvs sources # If we can't find connect, try looking in -lsocket, -lnsl, and -linet. # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has @@ -10895,6 +10938,7 @@ s%@AUTOHEADER@%$AUTOHEADER%g s%@CPP@%$CPP%g s%@LIBOBJS@%$LIBOBJS%g +s%@TERMLIBS@%$TERMLIBS%g s%@ROFF@%$ROFF%g s%@QUOTAOBJS@%$QUOTAOBJS%g s%@privatedir@%$privatedir%g