Compiling PHP 7.0.0RC2

#See https://adrhc.go.ro/wordpress/common-commands-when-building/ for building environment, x.sh script and other things not defined here.
#Before starting do declare the environment variables specified to the link above.

NEW_BUILD_NAME=php
NEW_BUILD_VER1=7.0.0RC2
NEW_BUILD_VER=$NEW_BUILD_VER1-zts
MYSQL_BUILD_NAME_AND_VER=mysql-5.6.25
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$MYSQL_BUILD_NAME_AND_VER-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0

sed -i s/"HAVE_GD_XPM\s1"/"HAVE_GD_XPM 0"/g configure
sed -i s/"lxmlrpc\s"/"lxmlrpc-epi "/g configure

./configure --prefix=/ffp --enable-re2c-cgoto=shared,/ffp --with-apxs2=/ffp/opt/apache-2.2.29-worker/bin/apxs --enable-fpm --with-config-file-path=/ffp/etc/php.ini --with-config-file-scan-dir=/ffp/etc --with-libxml-dir=/ffp --with-openssl=shared,/ffp --with-pcre-regex=/ffp --with-zlib=shared,/ffp --enable-bcmath --with-bz2=shared,/ffp --enable-calendar --with-curl=shared,/ffp --with-enchant=shared,/ffp --enable-exif --enable-ftp --with-gd=shared,/ffp --with-jpeg-dir=/ffp --with-png-dir=/ffp --with-freetype-dir=/ffp --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext=shared,/ffp --with-gmp=shared,/ffp --with-mhash=shared,/ffp --enable-intl --with-icu-dir=/ffp --enable-mbstring --with-mcrypt=shared,/ffp --with-mysql-sock=/ffp/var/run/mysql/mysql.sock --with-mysqli=shared,/ffp/bin/mysql_config --enable-opcache --enable-pcntl --with-pdo-mysql=shared,/ffp --with-readline=shared,/ffp --enable-shmop --enable-soap --enable-sockets --enable-wddx --with-libexpat-dir=/ffp --with-xmlrpc=shared,/ffp --with-iconv=shared,/ffp --with-xsl=/ffp --enable-zip --with-pear --with-pcre-dir=/ffp --with-openssl-dir=/ffp --with-zlib-dir=/ffp --with-iconv-dir=/ffp --with-webp-dir=/ffp --enable-opcache-file

sed -i s/"lxmlrpc\s"/"lxmlrpc-epi "/g Makefile
sed -i s/"define\sHAVE_GD_XPM\s0"/"undef HAVE_GD_XPM"/g main/php_config.h

./Makefile
BUILD_PHPDBG = $(LIBTOOL) --mode=link $(CC) -export-dynamic $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS_PROGRAM) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_PHPDBG_OBJS) $(EXTRA_LIBS) $(PHPDBG_EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -lreadline -o $(BUILD_BINARY)
BUILD_CGI = $(LIBTOOL) --mode=link $(CC) -export-dynamic $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS_PROGRAM) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_FASTCGI_OBJS) $(PHP_CGI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -lreadline -o $(SAPI_CGI_PATH)

#INSTALL
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
mkdir -p $HOME/temp/$NEW_BUILD_NAME_AND_VER/ffp/opt/apache-2.2.29-worker/conf/
cp -v /ffp/opt/apache-2.2.29-worker/conf/httpd.conf $HOME/temp/$NEW_BUILD_NAME_AND_VER/ffp/opt/apache-2.2.29-worker/conf/
INSTALL_ROOT=$HOME/temp/$NEW_BUILD_NAME_AND_VER make install
#if after make you are asked for running 'libtool --finish ...' then do it:
libtool --finish libs
#You'll get something like this:
#Libraries have been installed in:
#   /ffp/home/root/compile/$NEW_BUILD_NAME_AND_VER/libs -> here you'll find libphp5.so and libphp5.la
rm -vr $HOME/temp/$NEW_BUILD_NAME_AND_VER/ffp/opt/apache-2.2.29-worker/conf/
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
ls -l /tmp/php-*
ls -l ~/ffp_0.7_armv5/packages/php-*
#for the files found below remove the -n or/and -q php's call options:
grep -nr "\s\(-q\|-n\)\s" ffp/bin/
sed -i s/"\s-q"/""/ ffp/bin/peardev
sed -i s/"\s-q"/""/ ffp/bin/pear
sed -i s/"\s-q"/""/ ffp/bin/pecl
sed -i s/"\s-n"/""/ ffp/bin/pecl
sed -i s/"\!\/bin"/"\!\/ffp\/bin"/ ffp/bin/pecl
sed -i s/"\!\/bin"/"\!\/ffp\/bin"/ ffp/bin/pear
sed -i s/"\!\/bin"/"\!\/ffp\/bin"/ ffp/bin/peardev
makepkg $NEW_BUILD_NAME-$MYSQL_BUILD_NAME_AND_VER $NEW_BUILD_VER 0
cp -v /tmp/php-*.txz $HOME/ffp_0.7_armv5/packages/
funpkg -i $HOME/ffp_0.7_armv5/packages/$NEW_BUILD_NAME_AND_VER-arm-0.txz

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.