]> diplodocus.org Git - nmh/blob - m4/readline.m4
getpass.c: Move interface to own file.
[nmh] / m4 / readline.m4
1 dnl Our readline heuristic. If we haven't been asked about readline, then
2 dnl try to compile with it. If we've been asked for it, then we fail
3 dnl if we cannot use it. If we were explicitly NOT asked for it, then
4 dnl don't even try to use it.
5 dnl
6
7 AC_DEFUN([NMH_READLINE],
8 [AC_ARG_WITH([readline],
9 AS_HELP_STRING([--with-readline],
10 [enable readline editing for whatnow (default=maybe)]),
11 [], [with_readline=maybe])
12 AS_IF([test x"$with_readline" = xyes -o x"$with_readline" = xmaybe],
13 [save_LIBS="$LIBS"
14 LIBS=
15 AC_SEARCH_LIBS([readline], [readline editline],
16 [READLINELIB="$LIBS"
17 AC_DEFINE([READLINE_SUPPORT], [1],
18 [Support for using readline() in whatnow])],
19 [AS_IF([test x"$with_readline" = xyes],
20 [AC_MSG_ERROR([Unable to find a readline library])])],
21 [$TERMLIB])
22 LIBS="$save_LIBS"])
23 ])
24
25 AC_SUBST([READLINELIB])