#!/bin/sh #+-------------------------------------------------------------------------------------------- #|Description: This shell script used to download libconfig library source code and cross compile it. #| Author: GuoWenxue #| ChangeLog: #| 1, Initialize 1.0.0 on 2013.03.22 #+-------------------------------------------------------------------------------------------- . ../scripts/funcs.sh clear_crossenv . ../scripts/envs.sh if [ -z $ARCH ]; then ARCH= fi APP_NAME=php DIR_NAME="php-5.3.17" PACK_SUFIX="tar.bz2" DL_ADDR="http://cn.php.net/distributions/$DIR_NAME.$PACK_SUFIX" LINK_STATIC=YES select_arch if [ -z $CROSS -a "x86" != "$ARCH" ] ; then CROSS="/opt/buildroot-2012.08/${ARCH}/usr/bin/arm-linux-" fi set_crosstool $CROSS if [ "x86" != "$ARCH" ] ; then CONFIG_CROSS=--host=arm-linux fi PREFIX_PATH=/apps/${ARCH}/${APP_NAME} # Download and decompress source code packet download $DL_ADDR decompress_packet $DIR_NAME $PACK_SUFIX if [ "$LINK_STATIC" == "YES" ] ; then CONFIG_LD_STATUS='--enable-static' fi echo "+------------------------------------------------------------------+" echo "| Platform: $DIR_NAME for $ARCH " echo "| Compiler: ${CROSS}gcc " echo "+------------------------------------------------------------------+" mkdir -p $PREFIX_PATH cd $DIR_NAME set -x line=`sed -n '/Your system seems to lack POSIX threads/=' configure` sed -i -e ${line}s'|.*|{ echo "configure: error: Your system seems to lack POSIX threads." 1>\&2;}|' configure ./configure --prefix=$PREFIX_PATH ${CONFIG_CROSS} --disable-rpath \ --disable-cli --enable-bcmath --enable-calendar --enable-maintainer-zts \ --enable-embed=shared --enable-force-cgi-redirect --enable-ftp \ --enable-inline-optimization --enable-magic-quotes --enable-memory-limit \ --enable-safe-mode --enable-sockets --enable-track-vars --enable-trans-sid \ --enable-wddx --sysconfdir=/etc/appWeb --with-pic --with-exec-dir=/etc/appWeb/exec \ --with-db --with-regex=system --with-pear --without-zlib --without-iconv \ --disable-dom --disable-libxml --disable-simplexml --disable-xml --disable-wddx \ --disable-xmlreader --without-xmlrpc --disable-xmlwriter make && make install $STRIP $PREFIX_PATH/lib/*.so* if [ -n "$INST_PATH" -a -d "$INST_PATH" ] ; then cp $PREFIX_PATH/lib/*.so* $INST_PATH fi set +x echo "+------------------------------------------------------------------+" echo "| Install Prefix: $PREFIX_PATH" echo "| Install Path: $INST_PATH" echo "+------------------------------------------------------------------+" cd -