summaryrefslogtreecommitdiffstats
path: root/m4.include/mc-use-termcap.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:12 +0000
commit8ccb487c21368a7fdc8c7c72315325bf0aa06147 (patch)
treeb2056fae01d325924508a41731edfbd4c3cddd23 /m4.include/mc-use-termcap.m4
parentInitial commit. (diff)
downloadmc-8ccb487c21368a7fdc8c7c72315325bf0aa06147.tar.xz
mc-8ccb487c21368a7fdc8c7c72315325bf0aa06147.zip
Adding upstream version 3:4.8.29.upstream/3%4.8.29upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4.include/mc-use-termcap.m4')
-rw-r--r--m4.include/mc-use-termcap.m432
1 files changed, 32 insertions, 0 deletions
diff --git a/m4.include/mc-use-termcap.m4 b/m4.include/mc-use-termcap.m4
new file mode 100644
index 0000000..4ae6957
--- /dev/null
+++ b/m4.include/mc-use-termcap.m4
@@ -0,0 +1,32 @@
+dnl
+dnl Try using termcap database and link with libtermcap if possible.
+dnl
+AC_DEFUN([mc_USE_TERMCAP], [
+ 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])
+ AC_CHECK_LIB(termcap, tgoto, [MCLIBS="$MCLIBS -ltermcap"], , [$LIBS])
+])
+
+dnl
+dnl Check if the installed S-Lang library uses termcap
+dnl
+AC_DEFUN([mc_SLANG_TERMCAP], [
+ unset ac_cv_lib_termcap_tgoto
+
+ AC_CACHE_CHECK([if S-Lang uses termcap], [mc_cv_slang_termcap], [
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS -lslang"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <slang.h>
+ ]],
+ [[SLtt_get_terminfo(); SLtt_tgetflag((char*)"");]])],
+ [mc_cv_slang_termcap=no], [mc_cv_slang_termcap=yes])
+
+ LIBS="$ac_save_LIBS"
+ ])
+
+ if test x"$mc_cv_slang_termcap" = xyes; then
+ mc_USE_TERMCAP
+ fi
+])