commit e31674ab5e74c382894c02450481f303cb3fe39a
parent 87c0174c7a427402c02f55e034a048a07f34820b
Author: tjg <tjg>
Date: Thu, 6 May 1999 12:51:02 +0000
1993-05-06
Portability: tgetent() might be in -lncurses instead of -ltermcap.
Diffstat:
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
@@ -204,3 +204,14 @@ main() {
yes) AC_DEFINE(HAVE_FIFO) ;;
esac
])
+
+dnl Where is tgetent()?
+AC_DEFUN(RC_LIB_TGETENT, [
+ AC_CHECK_LIB(termcap, tgetent,
+ rc_lib_tgetent=-ltermcap,
+ AC_CHECK_LIB(ncurses, tgetent,
+ rc_lib_tgetent=-lncurses,
+ AC_MSG_ERROR(tgetent not found)
+ )
+ )
+])
diff --git a/configure.ac b/configure.ac
@@ -174,19 +174,24 @@ AC_ARG_WITH(editline, [ --with-editline Simmule Turner's line editing],
AC_DEFINE(EDITLINE) LIBS="$LIBS -ledit",
AC_MSG_ERROR(editline library not found)))
+if test "${with_vrl+set}" = set -o "${with_readline+set}" = set; then
+ RC_LIB_TGETENT
+ echo "found tgetent in $rc_lib_tgetent"
+fi
+
AC_ARG_WITH(vrl, [ --with-vrl Gert-Jan Vons's line editing],
AC_CHECK_LIB(vrl, readline,
- AC_DEFINE(EDITLINE) LIBS="$LIBS -lvrl -ltermcap",
- AC_MSG_ERROR(vrl library not found), -ltermcap))
+ AC_DEFINE(EDITLINE) LIBS="$LIBS -lvrl $rc_lib_tgetent",
+ AC_MSG_ERROR(vrl library not found), $rc_lib_tgetent))
dnl There are (at least) two incompatible versions of readline, and we
dnl need to know which one we are using. We don't support readline 2.0.
AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], [
AC_CHECK_LIB(readline, readline, [
AC_DEFINE(READLINE)
- LIBS="$LIBS -lreadline -ltermcap"
- AC_CHECK_LIB(readline, _rl_clean_up_for_exit, , AC_DEFINE(READLINE_OLD), -ltermcap)
- ], AC_MSG_ERROR(readline library not found), -ltermcap)
+ LIBS="$LIBS -lreadline $rc_lib_tgetent"
+ AC_CHECK_LIB(readline, _rl_clean_up_for_exit, , AC_DEFINE(READLINE_OLD), $rc_lib_tgetent)
+ ], AC_MSG_ERROR(readline library not found), $rc_lib_tgetent)
])
AM_CONDITIONAL(AMC_READLINE, test "${with_readline+set}" = set)