--- less-381/configure.ac.orig 2003-01-18 07:55:15 +0300 +++ less-381/configure.ac 2003-02-17 16:22:06 +0300 @@ -22,120 +22,10 @@ # Checks for compilation model. AC_SYS_LARGEFILE -# Checks for general libraries. -AC_CHECK_LIB(xcurses, initscr, [have_xcurses=yes], [have_xcurses=no]) -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(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, -# and in -lintl on SCO Unix. -AC_CHECK_LIB(gen, regcmp) -AC_CHECK_LIB(intl, regcmp) -AC_CHECK_LIB(PW, regcmp) - -# Checks for terminal libraries -AC_MSG_CHECKING([for working terminal libraries]) -TERMLIBS= - -# Check for systems where curses is broken. -curses_broken=0 -if test x`uname -s` = "xHP-UX" >/dev/null 2>&1; then -if test x`uname -r` = "xB.11.00" >/dev/null 2>&1; then - curses_broken=1 -fi -if test x`uname -r` = "xB.11.11" >/dev/null 2>&1; then - curses_broken=1 -fi -fi - -if test $curses_broken = 0; then -# -- 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 ncurses. -if test "x$TERMLIBS" = x; then - if test $have_ncurses = yes; then - TERMLIBS="-lncurses" - 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 - TERMLIBS="-lcurses" - 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 & termcap. -if test "x$TERMLIBS" = x; then - if test $have_curses = yes; then - if test $have_termcap = yes; then - TERMLIBS="-lcurses -ltermcap" - 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 -fi -fi - -# -- Try termcap. -if test "x$TERMLIBS" = x; then - if test $have_termcap = yes; then - TERMLIBS="-ltermcap" - 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 termlib. -if test "x$TERMLIBS" = x; then - if test $have_termlib = yes; then - TERMLIBS="-lcurses -ltermlib" - 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 - -if test "x$TERMLIBS" = x; then - AC_MSG_RESULT(Cannot find terminal libraries - configure failed) - exit 1 -fi -AC_MSG_RESULT(using $TERMLIBS) +AC_CHECK_LIB(tinfo, tgetent, TERMLIBS=-ltinfo, + AC_CHECK_LIB(ncurses, tgetent, TERMLIBS=-lncurses, + AC_CHECK_LIB(termcap, tgetent, TERMLIBS=-ltermcap, + AC_MSG_ERROR(Cannot find tinfo, ncurses or termcap libraries) ) ) ) LIBS="$LIBS $TERMLIBS" # Checks for header files.