Hi,

I will be doing some work in PHP soon, so I wanted a decent REPL to
experiment in. I found this, which needs readline support in PHP:
https://github.com/d11wtq/boris

The following diff enables readline for all our versions of PHP. It
"just worked (tm)" for PHP-5.4 and PHP-5.5. I was able to run boris
(once enabling the pcntl extension). 

Sadly, PHP-5.3 seems to have a bug in the build system which results in:
main/.libs/internal_functions_cli.o(.data.rel+0xc8): undefined reference to 
`readline_module_entry'

Looking at a build log, this makes sense since ext/readline/readline.c is
*never* compiled, hence the readline_module_entry can't be linked.

I spent some time tracing the autogunk through, I found at least that we do
get as far as calling PHP_NEW_EXTENSION (in ext/readline.config.m4). This is
where readline.c should be added to the list of stuff to build. Also, I see
that configure emits a target in Makefile.objects for readline.lo, including
readline.c, so that looks good too. I think the overall problem is that
PHP_GLOBAL_OBJS in the top-level generated Makefile does not include
readline.lo. Does anyone see how to get it in there? I'm at a loss.


Index: Makefile.inc
===================================================================
RCS file: /home/edd/cvsync/cvs/ports/lang/php/Makefile.inc,v
retrieving revision 1.52
diff -u -p -r1.52 Makefile.inc
--- Makefile.inc        27 Mar 2014 14:04:34 -0000      1.52
+++ Makefile.inc        20 Apr 2014 17:48:30 -0000
@@ -73,7 +73,8 @@ CONFIGURE_ARGS+=      --enable-shared \
                        --with-pdo-sqlite \
                        --enable-sqlite-utf8 \
                        --with-sqlite3 \
-                       --program-suffix=-${PV}
+                       --program-suffix=-${PV} \
+                       --with-readline
 
 .if ${FLAVOR:Map2}
 CONFIGURE_ARGS+=       --with-apxs2=${LOCALBASE}/sbin/apxs2
Index: 5.3/Makefile
===================================================================
RCS file: /home/edd/cvsync/cvs/ports/lang/php/5.3/Makefile,v
retrieving revision 1.74
diff -u -p -r1.74 Makefile
--- 5.3/Makefile        27 Mar 2014 14:04:35 -0000      1.74
+++ 5.3/Makefile        21 Apr 2014 09:38:03 -0000
@@ -11,7 +11,8 @@ V=            ${PV}.28
 SUHOSIN_PHPV=  5.3.24
 SUHOSIN_P_V=   0.9.10unofficial
 REVISION=      4
-REVISION-main= 6
+# XXX more bumps when we can run 'make port-lib-depends-check'
+REVISION-main= 7
 REVISION-odbc= 5
 
 INI_TEMPLATES= development production
Index: 5.4/Makefile
===================================================================
RCS file: /home/edd/cvsync/cvs/ports/lang/php/5.4/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- 5.4/Makefile        6 Apr 2014 12:52:25 -0000       1.22
+++ 5.4/Makefile        21 Apr 2014 08:36:19 -0000
@@ -9,11 +9,15 @@ USE_LIBTOOL=  No
 PV=            5.4
 V=             ${PV}.27
 
+REVISION-main =                0
+REVISION-fpm =         0
+REVISION-fastcgi =     0
+
 INI_TEMPLATES= development production
 
 CONFIGURE_ARGS+=       --enable-mysqlnd
 
-WANTLIB-main+=         stdc++
+WANTLIB-main+=         stdc++ ncurses readline
 
 # fpm
 PKGNAME-fpm?=          php-fpm-${V}
Index: 5.5/Makefile
===================================================================
RCS file: /home/edd/cvsync/cvs/ports/lang/php/5.5/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- 5.5/Makefile        6 Apr 2014 12:53:41 -0000       1.13
+++ 5.5/Makefile        21 Apr 2014 08:42:31 -0000
@@ -8,12 +8,15 @@ USE_LIBTOOL=  No
 
 PV=            5.5
 V=             ${PV}.11
+REVISION-main =                0
+REVISION-fpm =         0
+REVISION-fastcgi =     0
 
 INI_TEMPLATES= development production
 
 CONFIGURE_ARGS+=       --enable-mysqlnd
 
-WANTLIB-main+=         stdc++
+WANTLIB-main+=         stdc++ ncurses readline
 
 # fpm
 PKGNAME-fpm?=          php-fpm-${V}

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk

Reply via email to