mc-use-termcap.m4 925 B

123456789101112131415161718192021222324252627282930313233343536
  1. dnl
  2. dnl Try using termcap database and link with libtermcap if possible.
  3. dnl
  4. AC_DEFUN([MC_USE_TERMCAP], [
  5. screen_msg="$screen_msg with termcap database"
  6. AC_MSG_NOTICE([using S-Lang screen library with termcap])
  7. AC_DEFINE(USE_TERMCAP, 1, [Define to use termcap database])
  8. AC_CHECK_LIB(termcap, tgoto, [MCLIBS="$MCLIBS -ltermcap"], , [$LIBS])
  9. ])
  10. dnl
  11. dnl Check if the installed S-Lang library uses termcap
  12. dnl
  13. AC_DEFUN([MC_SLANG_TERMCAP], [
  14. unset ac_cv_lib_termcap_tgoto
  15. AC_CACHE_CHECK([if S-Lang uses termcap], [mc_cv_slang_termcap], [
  16. ac_save_LIBS="$LIBS"
  17. LIBS="$LIBS -lslang"
  18. AC_TRY_LINK([
  19. #ifdef HAVE_SLANG_SLANG_H
  20. #include <slang/slang.h>
  21. #else
  22. #include <slang.h>
  23. #endif
  24. ],
  25. [SLtt_get_terminfo(); SLtt_tgetflag((char*)"");],
  26. [mc_cv_slang_termcap=no],
  27. [mc_cv_slang_termcap=yes])
  28. LIBS="$ac_save_LIBS"
  29. ])
  30. if test x"$mc_cv_slang_termcap" = xyes; then
  31. MC_USE_TERMCAP
  32. fi
  33. ])