- dnl Autodetect ncurses.
- AC_CHECK_LIB(ncurses, tgetent, , with_ncurses=no)
- AC_CHECK_LIB(ncurses, tgetstr, , with_ncurses=no)
- AC_CHECK_LIB(ncurses, tparm, , with_ncurses=no)
- if test "$with_ncurses" != "no"; then
+AS_IF([test "$with_tty" != "no" -a "$have_tty" != "no" ],[
+ for lib in $tty_libs; do
+ SXE_CHECK_LINK_LIB($lib, , eval have_${lib}=no)
+ with_lib_eval=`eval echo \\$with_$lib`
+ have_lib_eval=`eval echo \\$have_$lib`
+ AS_IF([test "$have_lib_eval" = "yes" ], [
+ for func in $tty_funcs; do
+ AC_CHECK_LIB($lib, tgetent)
+ AC_CHECK_LIB($lib, tgetstr)
+ AC_CHECK_LIB($lib, tgetflags)
+ AC_CHECK_LIB($lib, tparm)
+ AC_CHECK_LIB($lib, tgoto)
+ AC_CHECK_LIB($lib, tputs)
+ done
+ ])
+ have_lib_eval=`eval echo \\$have_$lib`
+ AS_IF([test "$with_lib_eval" = "yes" -a \
+ "$have_lib_eval" = "no" ],
+ AC_MSG_WARN([Errors detected trying to use requested $lib. Continuing with autodetection.]))
+ done
+ AS_IF([test "$sxe_cv_c_lib_ncurses" = "no" -a \
+ "$sxe_cv_c_lib_curses" = "no" -a \
+ "$sxe_cv_c_lib_termcap" = "no" -a \
+ "$sxe_cv_c_lib_terminfo" = "no" -a \
+ "$sxe_cv_c_lib_termlib" = "no"],
+ have_tty=no)
+ AS_IF([test "$with_tty" = "yes" -a "$have_tty" = "no"],
+ AC_MSG_ERROR([Your system lacks necessary libraries for requested TTY support.]))
+])
+
+
+AS_IF([test "$with_tty" != "no" -a "$have_tty" != "no" ],[