|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-01-08 01:55 UTC] bishop@php.net
-Status: Open
+Status: Feedback
[2018-01-08 01:55 UTC] bishop@php.net
[2018-01-08 02:03 UTC] bishop@php.net
-Assigned To:
+Assigned To: bishop
[2018-06-24 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 07:00:01 2025 UTC |
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.