---- less-394/configure.ac~ 2006-02-23 01:51:08.000000000 +0200
-+++ less-394/configure.ac 2006-02-23 01:51:54.000000000 +0200
-@@ -23,10 +23,10 @@
+--- less-394/configure.ac.orig 2005-10-21 18:21:55.000000000 +0200
++++ less-394/configure.ac 2006-02-25 19:02:39.151141750 +0100
+@@ -23,10 +23,12 @@
AC_SYS_LARGEFILE
# Checks for general libraries.
-AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
-AC_CHECK_LIB(curses, initscr, [have_curses=yes], [have_curses=no])
+AC_CHECK_LIB(xcurses, tgetent, [have_xcurses=yes], [have_xcurses=no])
++AC_CHECK_LIB(tinfow, tgetent, [have_tinfow=yes], [have_tinfow=no])
+AC_CHECK_LIB(ncursesw, tgetent, [have_ncursesw=yes], [have_ncursesw=no])
++AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes], [have_tinfo=no])
+AC_CHECK_LIB(ncurses, tgetent, [have_ncurses=yes], [have_ncurses=no])
+AC_CHECK_LIB(curses, tgetent, [have_curses=yes], [have_curses=no])
AC_CHECK_LIB(termcap, tgetent, [have_termcap=yes], [have_termcap=no])
AC_CHECK_LIB(termlib, tgetent, [have_termlib=yes], [have_termlib=no])
# Regular expressions (regcmp) are in -lgen on Solaris 2,
+@@ -51,10 +53,10 @@
+ fi
+
+ if test $curses_broken = 0; then
+-# -- Try xcurses.
++dnl -- Try tinfow.
+ if test "x$TERMLIBS" = x; then
+- if test $have_xcurses = yes; then
+- TERMLIBS="-lxcurses"
++ if test $have_tinfow = yes; then
++ TERMLIBS="-ltinfow"
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $TERMLIBS"
+ AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
+@@ -77,6 +79,19 @@
+ fi
+ fi
+
++dnl -- Try tinfo.
++if test "x$TERMLIBS" = x; then
++ if test $have_tinfo = yes; then
++ TERMLIBS="-ltinfo"
++ SAVE_LIBS=$LIBS
++ LIBS="$LIBS $TERMLIBS"
++ AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++ [termok=yes], [termok=no])
++ LIBS=$SAVE_LIBS
++ if test $termok = no; then TERMLIBS=""; fi
++ fi
++fi
++
+ # -- Try ncurses.
+ if test "x$TERMLIBS" = x; then
+ if test $have_ncurses = yes; then
+@@ -90,6 +105,19 @@
+ fi
+ fi
+
++# -- Try xcurses.
++if test "x$TERMLIBS" = x; then
++ if test $have_xcurses = yes; then
++ TERMLIBS="-lxcurses"
++ SAVE_LIBS=$LIBS
++ LIBS="$LIBS $TERMLIBS"
++ AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
++ [termok=yes], [termok=no])
++ LIBS=$SAVE_LIBS
++ if test $termok = no; then TERMLIBS=""; fi
++ fi
++fi
++
+ # -- Try curses.
+ if test "x$TERMLIBS" = x; then
+ if test $have_curses = yes; then