2009-05-07 16:38:06 +04:00
|
|
|
dnl
|
|
|
|
dnl Try using termcap database and link with libtermcap if possible.
|
|
|
|
dnl
|
2016-01-04 21:43:19 +03:00
|
|
|
AC_DEFUN([mc_USE_TERMCAP], [
|
2009-05-07 16:38:06 +04:00
|
|
|
screen_msg="$screen_msg with termcap database"
|
|
|
|
AC_MSG_NOTICE([using S-Lang screen library with termcap])
|
|
|
|
AC_DEFINE(USE_TERMCAP, 1, [Define to use termcap database])
|
2024-06-03 18:51:02 +03:00
|
|
|
|
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
AC_SEARCH_LIBS([tgoto], [termcap xcurses curses],
|
|
|
|
[MCLIBS="$MCLIBS $ac_cv_search_tgoto"],
|
|
|
|
[AC_MSG_ERROR([Could not find a library providing tgoto])]
|
|
|
|
)
|
|
|
|
LIBS="$ac_save_LIBS"
|
2009-05-07 16:38:06 +04:00
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Check if the installed S-Lang library uses termcap
|
|
|
|
dnl
|
2016-01-04 21:43:19 +03:00
|
|
|
AC_DEFUN([mc_SLANG_TERMCAP], [
|
2009-07-28 16:05:43 +04:00
|
|
|
unset ac_cv_lib_termcap_tgoto
|
|
|
|
|
2009-05-07 16:38:06 +04:00
|
|
|
AC_CACHE_CHECK([if S-Lang uses termcap], [mc_cv_slang_termcap], [
|
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS -lslang"
|
2019-01-08 11:06:54 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
2009-07-28 16:05:43 +04:00
|
|
|
#include <slang.h>
|
2021-03-21 15:48:09 +03:00
|
|
|
]],
|
|
|
|
[[SLtt_get_terminfo(); SLtt_tgetflag((char*)"");]])],
|
|
|
|
[mc_cv_slang_termcap=no], [mc_cv_slang_termcap=yes])
|
|
|
|
|
2009-05-07 16:38:06 +04:00
|
|
|
LIBS="$ac_save_LIBS"
|
|
|
|
])
|
|
|
|
|
2009-07-26 17:11:53 +04:00
|
|
|
if test x"$mc_cv_slang_termcap" = xyes; then
|
2016-01-04 21:43:19 +03:00
|
|
|
mc_USE_TERMCAP
|
2009-05-07 16:38:06 +04:00
|
|
|
fi
|
|
|
|
])
|