1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl This macro will check for the presence of the readline library.
14 dnl To get it into the aclocal.m4 dnl file, do this:
15 dnl aclocal -I . --verbose
17 dnl The --verbose will show all of the files that are searched
20 AC_DEFUN([wi_LIB_READLINE], [
21 dnl check for the readline.h header file
23 AC_CHECK_HEADER(readline/readline.h)
25 if test "$ac_cv_header_readline_readline_h" = yes; then
26 dnl check the readline version
28 cat > conftest.$ac_ext <<EOF
30 #include <readline/readline.h>
31 wi_LIB_READLINE_VERSION RL_VERSION_MAJOR RL_VERSION_MINOR
34 wi_READLINE_VERSION=$($CPP $CPPFLAGS conftest.$ac_ext | sed -n -e "s/^wi_LIB_READLINE_VERSION *\([[0-9\]][[0-9\]]*\) *\([[0-9\]][[0-9\]]*\)$/\1.\2/p")
37 if test -n "$wi_READLINE_VERSION"; then
38 wi_MAJOR=$(expr $wi_READLINE_VERSION : '\([[0-9]][[0-9]]*\)\.')
39 wi_MINOR=$(expr $wi_READLINE_VERSION : '[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*$\)')
40 if test $wi_MINOR -lt 10; then
41 wi_MINOR=$(expr $wi_MINOR \* 10)
43 wi_READLINE_VERSION=$(expr $wi_MAJOR \* 100 + $wi_MINOR)
45 wi_READLINE_VERSION=-1
48 dnl check for the readline library
51 # Note: $LIBCURSES is permitted to be empty.
53 for LIBREADLINE in "-lreadline.dll" "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
55 AC_MSG_CHECKING([for GNU Readline library $LIBREADLINE])
57 LIBS="$ac_save_LIBS $LIBREADLINE"
62 #include <readline/readline.h>
65 int dummy = rl_completion_append_character; /* rl_completion_append_character appeared in version 2.1 */
68 wi_cv_lib_readline=yes
75 if test "$wi_cv_lib_readline" = yes; then
77 AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE, $wi_READLINE_VERSION, [Readline])