summaryrefslogtreecommitdiffstats
path: root/php-5.3.7-readline.patch
blob: f4863b6303efd92ddcc37d33d21430d7c3db3d4a (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff -up php-5.3.7RC4/ext/readline/config.m4.libedit php-5.3.7RC4/ext/readline/config.m4
--- php-5.3.7RC4/ext/readline/config.m4.libedit	2009-12-13 18:06:47.000000000 +0100
+++ php-5.3.7RC4/ext/readline/config.m4	2011-07-28 21:51:47.404345421 +0200
@@ -60,6 +60,13 @@ if test "$PHP_READLINE" && test "$PHP_RE
     -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
   ])
 
+  PHP_CHECK_LIBRARY(edit, rl_on_new_line,
+  [
+    AC_DEFINE(HAVE_RL_ON_NEW_LINE, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
+  ])
+
   AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
 
 elif test "$PHP_LIBEDIT" != "no"; then
@@ -93,6 +100,20 @@ elif test "$PHP_LIBEDIT" != "no"; then
     -L$READLINE_DIR/$PHP_LIBDIR 
   ])
 
+  PHP_CHECK_LIBRARY(edit, rl_callback_read_char,
+  [
+    AC_DEFINE(HAVE_RL_CALLBACK_READ_CHAR, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR
+  ])
+
+  PHP_CHECK_LIBRARY(edit, rl_on_new_line,
+  [
+    AC_DEFINE(HAVE_RL_ON_NEW_LINE, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR
+  ])
+
   AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
 fi
 
diff -up php-5.3.7RC4/ext/readline/readline.c.libedit php-5.3.7RC4/ext/readline/readline.c
--- php-5.3.7RC4/ext/readline/readline.c.libedit	2011-07-28 12:42:45.000000000 +0200
+++ php-5.3.7RC4/ext/readline/readline.c	2011-07-28 21:54:27.301387206 +0200
@@ -141,6 +141,8 @@ static const zend_function_entry php_rea
 	PHP_FE(readline_callback_read_char,			arginfo_readline_callback_read_char)
 	PHP_FE(readline_callback_handler_remove,	arginfo_readline_callback_handler_remove)
 	PHP_FE(readline_redisplay, arginfo_readline_redisplay)
+#endif
+#if HAVE_RL_ON_NEW_LINE
 	PHP_FE(readline_on_new_line, arginfo_readline_on_new_line)
 #endif
 	PHP_FE_END
@@ -604,6 +606,9 @@ PHP_FUNCTION(readline_redisplay)
 }
 /* }}} */
 
+#endif
+
+#if HAVE_RL_ON_NEW_LINE
 /* {{{ proto void readline_on_new_line(void)
    Inform readline that the cursor has moved to a new line */
 PHP_FUNCTION(readline_on_new_line)