summaryrefslogtreecommitdiff
path: root/ext/readline/config.m4
blob: 0cb936a7bf7cca250a1909d9a651a8be969b4921 (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
dnl $Id$
dnl config.m4 for extension readline
dnl don't forget to call PHP_EXTENSION(readline)


AC_MSG_CHECKING(for readline support)
AC_ARG_WITH(readline,
[  --with-readline[=DIR]  Include readline support.  DIR is the readline
                          install directory.],
[
  if test "$withval" != "no"; then
    for i in $withval /usr/local /usr; do
      if test -f $i/include/readline/readline.h; then
        READLINE_DIR=$i
      fi
    done
    if test "$READLINE_DIR" = ""; then
      AC_MSG_ERROR(Please reinstall readline - I cannot find readline.h)
    fi
    AC_ADD_INCLUDE($READLINE_DIR/include)
    AC_ADD_LIBRARY(termcap)
    AC_ADD_LIBRARY_WITH_PATH(history, $READLINE_DIR/lib)
    AC_ADD_LIBRARY_WITH_PATH(readline, $READLINE_DIR/lib)

    AC_MSG_RESULT(yes)

	AC_DEFINE(HAVE_LIBREADLINE, 1)
	PHP_EXTENSION(readline)
  else
    AC_MSG_RESULT(no)
  fi
],[
  AC_MSG_RESULT(no)
])