linphone-iphone/linphone/m4/readline.m4
aymeric 2b8200409c Initial import
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@1 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
2008-09-04 15:47:34 +00:00

37 lines
1.1 KiB
Text

##################################################
# Check for readline support.
##################################################
AC_DEFUN([LP_CHECK_READLINE],[
AC_ARG_WITH( readline,
[ --with-readline Set prefix where gnu readline headers and libs can be found (ex:/usr, /usr/local) [default=/usr] ],
[ readline_prefix=${withval}],[ readline_prefix="/usr" ])
if test "$readline_prefix" != "/usr"; then
READLINE_CFLAGS="-I$readline_prefix/include"
READLINE_LIBS="-L$readline_prefix/lib"
fi
CPPFLAGS_save=$CPPFLAGS
LIBS_save=$LIBS
CPPFLAGS="$CPPFLAGS $READLINE_CFLAGS"
LIBS="$LIBS $READLINE_LIBS"
AC_CHECK_HEADERS(readline.h readline/readline.h, readline_h_found=yes)
AC_CHECK_HEADERS(history.h readline/history.h)
AC_CHECK_LIB(readline, readline, [readline_libs_found=yes],[],[-lncurses])
LIBS=$LIBS_save
CPPFLAGS=$CPPFLAGS_save
if test "$readline_libs_found$readline_h_found" != "yesyes" ; then
AC_MSG_ERROR("Could not find libreadline headers or library")
fi
READLINE_LIBS="$READLINE_LIBS -lreadline -lncurses"
AC_SUBST(READLINE_CFLAGS)
AC_SUBST(READLINE_LIBS)
])