-dnl ** check for readline, for Hugs and hslibs' Readline
-dnl ncurses supersedes termcap and curses, but for compatibility,
-dnl we have to check for all...
-AC_CHECK_LIB(ncurses, tputs, HaveLibTermcap=YES; LibTermcap=ncurses,
- AC_CHECK_LIB(termcap, tputs, HaveLibTermcap=YES; LibTermcap=termcap,
- AC_CHECK_LIB(curses, tputs, HaveLibTermcap=YES; LibTermcap=curses,
- HaveLibTermcap=NO; LibTermcap=not-installed)))
-
-if test $HaveLibTermcap = YES ; then
- LIBS="-l$LibTermcap $LIBS"
- AC_CHECK_LIB(readline, readline, HaveLibReadline=YES, HaveLibReadline=NO)
-fi
-
-if test $HaveLibTermcap = YES && test x"$HaveLibReadline" = xYES ; then
- AC_DEFINE([HAVE_READLINE_LIBS], [1], [Define to 1 if readline plus any additional libs needed for it exist.])
- LibsReadline="readline $LibTermcap"
-else
- AC_DEFINE([HAVE_READLINE_LIBS], [0], [Define to 1 if readline plus any additional libs needed for it exist.])
- LibsReadline=
-fi
-AC_SUBST(LibsReadline)
-
-if test "$HaveLibReadline"; then
- AC_CHECK_LIB(readline, rl_erase_empty_line,
- [AC_DEFINE([HAVE_READLINE_4], [1], [Define to 1 if readline has version >= 4.0.])],
- [AC_DEFINE([HAVE_READLINE_4], [0], [Define to 1 if readline has version >= 4.0.])])
- AC_CHECK_LIB(readline, rl_free_undo_list,
- [AC_DEFINE([HAVE_READLINE_4_2], [1], [Define to 1 if readline has version >= 4.2.])],
- [AC_DEFINE([HAVE_READLINE_4_2], [0], [Define to 1 if readline has version >= 4.2.])])
-else
- AC_DEFINE([HAVE_READLINE_4], [0], [Define to 1 if readline has version >= 4.0.])
- AC_DEFINE([HAVE_READLINE_4_2], [0], [Define to 1 if readline has version >= 4.2.])
-fi
-