#
#	Php configuration
#

PHP_VER=5.2.8

if [ "$BLD_PHP_DIR" = "" ] ; then
    #
    #	Replace this line to set BLD_PHP_DIR with the location of the package on your system
    #
    BLD_PHP_DIR=$BLD_TOP/`probePackage "..:../..:../../.." packages/php/php-$PHP_VER`
    if [ $BLD_PHP_DIR = $BLD_TOP/ ] ; then
        echo "Can't find the PHP package version $PHP_VER"
        exit 255
    fi
fi

BLD_PHP_DIR=`canonPath "$BLD_PHP_DIR"`
if [ $BLD_HOST_OS = WIN ] ; then
    if [ -x "$BLD_PHP_DIR/Release_TS" ] ; then
        BLD_PHP_IMP_LIBPATH="$BLD_PHP_DIR/Release_TS"
        BLD_PHP_IMP_LIBS="php5ts.dll"
        BLD_PHP_DEP_LIBS="php5ts"
    else
        BLD_PHP_IMP_LIBPATH="$BLD_PHP_DIR/Release"
        BLD_PHP_IMP_LIBS="php5.dll"
        BLD_PHP_DEP_LIBS="php5"
        if [ ! -x "$BLD_PHP_DIR/Release" ] ; then
            echo "Can't find PHP libraries in either Release or Release_TS in $BLD_PHP_DIR"
            exit 255
        fi
        if [ $BLD_FEATURE_MULTITHREAD = 1 ] ; then
            echo "Can't use a non-ZTS PHP package in a multithreaded $BLD_NAME"
            exit 255
        fi
    fi
    if [ $BLD_FEATURE_STATIC = 1 ] ; then
        BLD_PHP_LIBS=$BLD_PHP_DEP_LIBS
    fi

elif [ $BLD_HOST_OS = MACOSX ] ; then
    BLD_PHP_IMP_LIBPATH="$BLD_PHP_DIR/libs"
    BLD_PHP_IMP_LIBS="libphp5.dylib"
    BLD_PHP_DEP_LIBS="php5 resolv db z xml2 iconv"
	BLD_PHP_LIBS="php5"

else 
    BLD_PHP_IMP_LIBPATH="$BLD_PHP_DIR/libs"
    BLD_PHP_IMP_LIBS="libphp5.so"
    BLD_PHP_DEP_LIBS="php5 crypt resolv db z"
	BLD_PHP_LIBS="php5"
fi

dir=`relativePath "$BLD_PHP_DIR"`
BLD_PHP_IFLAGS="-I$dir -I$dir/main -I$dir/Zend -I$dir/TSRM"
