]> granicus.if.org Git - php/commitdiff
MF51: sync all changes
authorfoobar <sniper@php.net>
Fri, 18 Nov 2005 15:10:33 +0000 (15:10 +0000)
committerfoobar <sniper@php.net>
Fri, 18 Nov 2005 15:10:33 +0000 (15:10 +0000)
ext/readline/config.m4

index 7df38b247a9aca6a620d4076db0edddc967b7366..686c1983f5c9375c06987e8b4b2e1c54f05851ee 100644 (file)
@@ -3,10 +3,12 @@ dnl $Id$
 dnl
 
 PHP_ARG_WITH(libedit,for libedit readline replacement, 
-[  --with-libedit[=DIR]    Include libedit readline replacement (CLI/CGI only).])
+[  --with-libedit[=DIR]    Include libedit readline replacement (CLI/CGI only)])
 
-PHP_ARG_WITH(readline,for readline support,
-[  --with-readline[=DIR]   Include readline support (CLI/CGI only).])
+if test "$PHP_LIBEDIT" = "no"; then
+  PHP_ARG_WITH(readline,for readline support,
+  [  --with-readline[=DIR]   Include readline support (CLI/CGI only)])
+fi
 
 if test "$PHP_READLINE" != "no"; then
   for i in $PHP_READLINE /usr/local /usr; do
@@ -19,13 +21,16 @@ if test "$PHP_READLINE" != "no"; then
 
   PHP_ADD_INCLUDE($READLINE_DIR/include)
 
+  PHP_READLINE_LIBS=""
   AC_CHECK_LIB(ncurses, tgetent,
   [
     PHP_ADD_LIBRARY(ncurses,,READLINE_SHARED_LIBADD)
+    PHP_READLINE_LIBS="$PHP_READLINE_LIBS -lncurses"
   ],[
     AC_CHECK_LIB(termcap, tgetent,
     [
       PHP_ADD_LIBRARY(termcap,,READLINE_SHARED_LIBADD)
+      PHP_READLINE_LIBS="$PHP_READLINE_LIBS -ltermcap"
     ])
   ])
 
@@ -35,7 +40,14 @@ if test "$PHP_READLINE" != "no"; then
   ], [
     AC_MSG_ERROR(readline library not found)
   ], [
-    -L$READLINE_DIR/lib 
+    -L$READLINE_DIR/lib $PHP_READLINE_LIBS
+  ])
+
+  PHP_CHECK_LIBRARY(readline, rl_callback_read_char,
+  [
+    AC_DEFINE(HAVE_RL_CALLBACK_READ_CHAR, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/lib $PHP_READLINE_LIBS
   ])
 
   PHP_CHECK_LIBRARY(history, add_history,
@@ -44,7 +56,7 @@ if test "$PHP_READLINE" != "no"; then
   ], [
     AC_MSG_ERROR(history library required by readline not found)
   ], [
-    -L$READLINE_DIR/lib 
+    -L$READLINE_DIR/lib $PHP_READLINE_LIBS
   ])
 
   PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)