summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m411
-rw-r--r--configure.ac15
2 files changed, 21 insertions, 5 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 3516928..814bae2 100644
--- 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
index cabb415..90b498d 100644
--- 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)