summaryrefslogtreecommitdiff
path: root/guile-readline/configure.in
blob: ad817ad91ee7bdf49e4739d836b4977def3a11df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
AC_INIT(readline.c)
. $srcdir/../GUILE-VERSION
PACKAGE=guile-readline
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)

AC_PROG_CC
AM_PROG_CC_STDC
AM_PROG_LIBTOOL

dnl Should we check for curses, terminfo, and termlib, too?
for termlib in ncurses termcap ; do
   AC_CHECK_LIB(${termlib}, tgoto, 
                [LIBS="-l${termlib} $LIBS"; break])
done

AC_CHECK_LIB(readline, main)
if test $ac_cv_lib_readline_main = no; then
  AC_MSG_WARN([libreadline was not found on your system.])
fi

AC_CHECK_FUNCS(rl_clear_signals rl_cleanup_after_signal)

AC_CACHE_CHECK([for rl_getc_function pointer in readline],
		 ac_cv_var_rl_getc_function,
		 [AC_TRY_LINK([
#include <stdio.h>
#include <readline/readline.h>],
			      [printf ("%ld", (long) rl_getc_function)],
			      [ac_cv_var_rl_getc_function=yes],
			      [ac_cv_var_rl_getc_function=no])])
if test "${ac_cv_var_rl_getc_function}" = "yes"; then
  AC_DEFINE(HAVE_RL_GETC_FUNCTION)
fi

if test $ac_cv_lib_readline_main = yes \
        -a $ac_cv_var_rl_getc_function = no; then
  AC_MSG_WARN([Warning: libreadline is too old on your system.  You need])
  AC_MSG_WARN([readline version 2.1 or later.])
fi

AC_CHECK_FUNCS(strdup)

AC_OUTPUT(Makefile)