1 dnl This macro will check for the presence of the readline library.
2 dnl To get it into the aclocal.m4 dnl file, do this:
3 dnl aclocal -I . --verbose
5 dnl The --verbose will show all of the files that are searched
8 AC_DEFUN([wi_LIB_READLINE], [
9 dnl check for the readline.h header file
10 AC_CHECK_HEADER(readline/readline.h)
12 if test "$ac_cv_header_readline_readline_h" = yes; then
13 dnl check for the readline library
16 # Note: $LIBCURSES is permitted to be empty.
18 for LIBREADLINE in "-lreadline.dll" "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
20 AC_MSG_CHECKING([for GNU Readline library])
22 LIBS="$ac_save_LIBS $LIBREADLINE"
27 #include <readline/readline.h>
31 rl_function_of_keyseq(NULL, NULL, NULL);
33 wi_cv_lib_readline=yes
34 wi_cv_lib_readline_result="$LIBREADLINE"
37 wi_cv_lib_readline_result=no
40 if test "$wi_cv_lib_readline" = yes; then
41 AC_MSG_RESULT($wi_cv_lib_readline_result)
43 AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE, 1, [Readline])