Bug #60370 [Opn->Fbk]: phar extension does not understand --with-pcre-dir
| From: | bishop@php.net | Date: | Mon, 08 Jan 2018 01:55:44 +0000 |
| Subject: | Bug #60370 [Opn->Fbk]: phar extension does not understand --with-pcre-dir | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213412@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60370&edit=1
ID: 60370
Updated by: bishop@php.net
Reported by: a11 at bsdpower dot com
Summary: phar extension does not understand --with-pcre-dir
-Status: Open
+Status: Feedback
Type: Bug
Package: PHAR related
Operating System: FreeBSD 8.2
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
Thanks for working to incorporate phar into FreeBSD. It looks like this may no longer be an issue,
as of the archiver/php71-phar port. If this does still occur in current PHP ports (7.1+), can you
please supply a complete configure command line, the result of running configure, and the result of
running make?
Previous Comments:
------------------------------------------------------------------------
[2011-11-24 04:33:46] a11 at bsdpower dot com
Description:
------------
I am creating a FreeBSD port for the phar extension. FreeBSD has one port for the core php and one
port for each extension.
It seems that phar requires pcre, from the following build output:
===> Building for php5-phar-5.3.8
/bin/sh /home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/libtool
--mode=compile cc -I. -I/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar
-DPHP_ATOM_INC -I/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/include
-I/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/main
-I/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar -I/usr/local/include/php
-I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend
-I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe
-march=native -fno-strict-aliasing -c
/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/util.c -o util.lo
mkdir .libs
cc -I. -I/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar -DPHP_ATOM_INC
-I/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/include
-I/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/main
-I/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar -I/usr/local/include/php
-I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend
-I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe
-march=native -fno-strict-aliasing -c
/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/util.c -fPIC -DPIC -o
.libs/util.o
In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27,
from /usr/local/include/php/ext/spl/spl_array.h:26,
from
/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/phar_internal.h:59,
from
/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/util.c:23:
/usr/local/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27,
from /usr/local/include/php/ext/spl/spl_array.h:26,
from
/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/phar_internal.h:59,
from
/home/build/ports/nfs/ports/archivers/php5-phar/work/php-5.3.8/ext/phar/util.c:23:
/usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',',
';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',',
';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before
'pcre'
*** Error code 1
1 error
*** Error code 1
Other extensions, for example zip, handle the required CFLAGS/LDFLAGS for pcre as follows:
.if ${PHP_MODNAME} == "zip"
CONFIGURE_ARGS+=--enable-zip \
--with-zlib-dir=/usr \
--with-pcre-dir=${LOCALBASE}
.endif
For phar, I tried adding the same --with-pcre-dir and it produced the failing build output above. I
had to set CFLAGS and LDFLAGS in environment as follows:
.if ${PHP_MODNAME} == "phar"
CONFIGURE_ARGS+=--enable-phar
# does not work
# --with-pcre-dir=${LOCALBASE}
CFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
.endif
Grepping php source tree for
with-pcre reveals that zip extension mentions it in
config.m4 whereas phar extension does not.
I checked current snapshot of 5.3 and it has the same results for grepping for
with-pcre.
I tried compiling e.g. the zip extension from php source (not going through FreeBSD ports system)
but even with --with-pcre-dir it would not find pcre.h. But build of zip does work from FreeBSD
ports.
Test script:
---------------
cd ext/phar
phpize
./configure --with-pcre-dir=/usr/local
...
configure: WARNING: unrecognized options: --with-pcre-dir
Expected result:
----------------
--with-pcre-dir sets CFLAGS and LDLFAGS appropriately for phar extension to build.
Actual result:
--------------
phar build fails when it cannot find pcre.h.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60370&edit=1