summaryrefslogtreecommitdiff
path: root/devel/php83-readline/files/patch-config.m4
blob: 1031a78360b1c821eca57e3ca643fa6dedaad363 (plain) (blame)
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
--- config.m4.orig	2023-06-06 15:54:29 UTC
+++ config.m4
@@ -3,16 +3,10 @@ PHP_ARG_WITH([libedit],
   [AS_HELP_STRING([--with-libedit],
     [Include libedit readline replacement (CLI/CGI only)])])
 
-if test "$PHP_LIBEDIT" = "no"; then
   PHP_ARG_WITH([readline],
     [for readline support],
     [AS_HELP_STRING([[--with-readline[=DIR]]],
       [Include readline support (CLI/CGI only)])])
-else
-  dnl "register" the --with-readline option to prevent invalid "unknown
-  dnl configure option" warning
-  php_with_readline=no
-fi
 
 if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
   for i in $PHP_READLINE /usr/local /usr; do
@@ -77,6 +71,13 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no
 
   AC_DEFINE(HAVE_HISTORY_LIST, 1, [ ])
   AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
+
+  PHP_CHECK_LIBRARY(readline, rl_completion_matches,
+  [
+    AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
+  ])
 
 elif test "$PHP_LIBEDIT" != "no"; then
   if test "$PHP_LIBEDIT" != "yes"; then