1 dnl Check to find the readline headers/libraries
3 AC_DEFUN([tinc_READLINE],
5 AC_ARG_ENABLE([readline],
6 AS_HELP_STRING([--disable-readline], [disable readline support]))
7 AS_IF([test "x$enable_readline" != "xno"], [
8 AC_DEFINE(HAVE_READLINE, 1, [have readline support])
11 AS_HELP_STRING([--with-readline=DIR], [readline base directory, or:]),
13 CPPFLAGS="$CPPFLAGS -I$withval/include"
14 LDFLAGS="$LDFLAGS -L$withval/lib"]
17 AC_ARG_WITH(readline-include,
18 AS_HELP_STRING([--with-readline-include=DIR], [readline headers directory]),
19 [readline_include="$withval"
20 CPPFLAGS="$CPPFLAGS -I$withval"]
23 AC_ARG_WITH(readline-lib,
24 AS_HELP_STRING([--with-readline-lib=DIR], [readline library directory]),
25 [readline_lib="$withval"
26 LDFLAGS="$LDFLAGS -L$withval"]
29 AC_CHECK_HEADERS([readline/readline.h readline/history.h],
31 [AC_MSG_ERROR("readline header files not found."); break]
34 AC_CHECK_LIB(readline, readline,
35 [READLINE_LIBS="-lreadline"],
36 [AC_MSG_ERROR("readline library not found.")],
41 AC_SUBST(READLINE_LIBS)