1 ##################################################
2 # Check for readline support.
3 ##################################################
5 AC_DEFUN([LP_CHECK_READLINE],[
8 [ --with-readline Set prefix where gnu readline headers and libs can be found (ex:/usr, /usr/local, none) [default=/usr] ],
9 [ readline_prefix=${withval}],[ readline_prefix="/usr" ])
11 if test "$readline_prefix" != "none"; then
13 if test "$readline_prefix" != "/usr"; then
14 READLINE_CFLAGS="-I$readline_prefix/include"
15 READLINE_LIBS="-L$readline_prefix/lib"
18 CPPFLAGS_save=$CPPFLAGS
20 CPPFLAGS="$CPPFLAGS $READLINE_CFLAGS"
21 LIBS="$LIBS $READLINE_LIBS"
22 AC_CHECK_HEADERS(readline.h readline/readline.h, readline_h_found=yes)
23 AC_CHECK_HEADERS(history.h readline/history.h)
25 for termcap_lib in "" -ltermcap -lcurses -lncurses; do
26 unset ac_cv_lib_readline_readline
27 AC_CHECK_LIB(readline, readline, [readline_libs_found=yes],[],[$termcap_lib])
28 if test "x$readline_libs_found" = "xyes" ; then
29 READLINE_LIBS="$READLINE_LIBS -lreadline $termcap_lib"
35 CPPFLAGS=$CPPFLAGS_save
37 if test "$readline_libs_found$readline_h_found" != "yesyes" ; then
38 AC_MSG_WARN([Could not find libreadline headers or library, linphonec will have limited prompt features])
40 AC_DEFINE([HAVE_READLINE],1,[defined when compiling with readline support])
44 AC_SUBST(READLINE_CFLAGS)
45 AC_SUBST(READLINE_LIBS)
48 AC_MSG_NOTICE([Readline support disabled.])