Merge pull request #252 from michalbednarski/ltrace-1
[termux-packages] / packages / php / build.sh
CommitLineData
e054b9eb
FF
1TERMUX_PKG_HOMEPAGE=http://php.net/
2TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language"
5fc3629f
FF
3TERMUX_PKG_VERSION=5.6.21
4TERMUX_PKG_SRCURL=http://mirror.internode.on.net/pub/php/php-${TERMUX_PKG_VERSION}.tar.xz
e339be42
FF
5# Build native php for phar to build (see pear-Makefile.frag.patch):
6TERMUX_PKG_HOSTBUILD=true
e054b9eb 7TERMUX_PKG_FOLDERNAME=php-${TERMUX_PKG_VERSION}
5fc3629f 8TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre, libcrypt, libmcrypt, libcurl, libgd"
e054b9eb
FF
9# http://php.net/manual/en/libxml.installation.php
10# "If configure cannot find xml2-config in the directory specified by --with-libxml-dir,
11# then it'll continue on and check the default locations."
12TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-libxml-dir=$TERMUX_PREFIX"
e339be42
FF
13TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-openssl=$TERMUX_PREFIX"
14# http://php.net/manual/en/pcre.installation.php: pcre always enabled, use platform library:
c7bdfff6
FF
15TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-pcre-regex=$TERMUX_PREFIX"
16TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-iconv=$TERMUX_PREFIX"
727704d7
DM
17TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curl=$TERMUX_PREFIX"
18TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-mcrypt=$TERMUX_PREFIX"
19TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-gd=$TERMUX_PREFIX"
50111527 20TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-zlib"
c7bdfff6 21TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-zip"
e054b9eb
FF
22TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_res_nsearch=no"
23TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --mandir=$TERMUX_PREFIX/share/man"
f72fc782 24TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-sockets"
e054b9eb 25
daba97c6 26LDFLAGS+=" -landroid-glob"
27
e054b9eb 28termux_step_pre_configure () {
7e606cc7 29 export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
e339be42
FF
30 export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
31
e054b9eb
FF
32 # Run autoconf since we have patched config.m4 files.
33 cd $TERMUX_PKG_SRCDIR
34 autoconf
35}
36
37termux_step_post_configure () {
38 perl -p -i -e 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
727704d7 39 perl -p -i -e 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
e054b9eb 40}