dnl Available from the GNU Autoconf Macro Archive at: dnl http://www.gnu.org/software/ac-archive/htmldoc/vl_lib_readline.html dnl AC_DEFUN([VL_LIB_READLINE], [ AC_CACHE_CHECK([for a readline compatible library], vl_cv_lib_readline, [ ORIG_LIBS="$LIBS" for readline_lib in readline; do for termcap_lib in "" termcap ncurses curses; do if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else TRY_LIB="-l$readline_lib -l$termcap_lib" fi LIBS="$ORIG_LIBS $TRY_LIB" AC_TRY_LINK_FUNC(readline, vl_cv_lib_readline="$TRY_LIB") if test -n "$vl_cv_lib_readline"; then break fi done if test -n "$vl_cv_lib_readline"; then break fi done if test -z "$vl_cv_lib_readline"; then vl_cv_lib_readline="no" LIBS="$ORIG_LIBS" fi ]) have_readline=no if test "$vl_cv_lib_readline" != "no"; then have_readline=yes AC_DEFINE(HAVE_LIBREADLINE, 1, [Define if you have a readline compatible library]) AC_CHECK_HEADERS(readline.h readline/readline.h) AC_CACHE_CHECK([whether readline supports history], vl_cv_lib_readline_history, [ vl_cv_lib_readline_history="no" AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes") ]) have_history=no if test "$vl_cv_lib_readline_history" = "yes"; then have_history=yes AC_DEFINE(HAVE_READLINE_HISTORY, 1, [Define if your readline library has \`add_history']) AC_CHECK_HEADERS(history.h readline/history.h) fi fi dnl Here we need to quit if there is no readline available if test $have_readline = no; then AC_MSG_ERROR([ ***************************************************** cgdb requires the GNU readline library to link! *****************************************************]) fi dnl Here we need to quit if there is no history available if test $have_history = no; then AC_MSG_ERROR([ ***************************************************** cgdb requires the GNU readline history library to link! *****************************************************]) fi ])dnl