Commit 187aedb4 authored by Yann Diorcet's avatar Yann Diorcet
Browse files

Fix readline dependency

parent cd9c2c4e
...@@ -29,13 +29,12 @@ ...@@ -29,13 +29,12 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef HAVE_READLINE
#ifdef HAVE_READLINE_H #ifdef HAVE_READLINE_H
#include <readline.h> #include <readline.h>
#define HAVE_READLINE
#else #else
#ifdef HAVE_READLINE_READLINE_H #ifdef HAVE_READLINE_READLINE_H
#include <readline/readline.h> #include <readline/readline.h>
#define HAVE_READLINE
#endif #endif
#endif #endif
#ifdef HAVE_HISTORY_H #ifdef HAVE_HISTORY_H
...@@ -45,6 +44,7 @@ ...@@ -45,6 +44,7 @@
#include <readline/history.h> #include <readline/history.h>
#endif #endif
#endif #endif
#endif
#undef PARAMS #undef PARAMS
/************************************************************************** /**************************************************************************
......
...@@ -22,15 +22,22 @@ if test "$readline_prefix" != "none"; then ...@@ -22,15 +22,22 @@ if test "$readline_prefix" != "none"; then
AC_CHECK_HEADERS(readline.h readline/readline.h, readline_h_found=yes) AC_CHECK_HEADERS(readline.h readline/readline.h, readline_h_found=yes)
AC_CHECK_HEADERS(history.h readline/history.h) AC_CHECK_HEADERS(history.h readline/history.h)
AC_CHECK_LIB(readline, readline, [readline_libs_found=yes],[],[]) for termcap_lib in "" -ltermcap -lcurses -lncurses; do
unset ac_cv_lib_readline_readline
AC_CHECK_LIB(readline, readline, [readline_libs_found=yes],[],[$termcap_lib])
if test "x$readline_libs_found" = "xyes" ; then
READLINE_LIBS="$READLINE_LIBS -lreadline $termcap_lib"
break
fi
done
LIBS=$LIBS_save LIBS=$LIBS_save
CPPFLAGS=$CPPFLAGS_save CPPFLAGS=$CPPFLAGS_save
if test "$readline_libs_found$readline_h_found" != "yesyes" ; then if test "$readline_libs_found$readline_h_found" != "yesyes" ; then
AC_MSG_WARN([Could not find libreadline headers or library, linphonec will have limited prompt features]) AC_MSG_WARN([Could not find libreadline headers or library, linphonec will have limited prompt features])
else else
READLINE_LIBS="$READLINE_LIBS -lreadline " AC_DEFINE([HAVE_READLINE],1,[defined when compiling with readline support])
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment