From: <jbo...@li...> - 2006-05-16 13:46:06
|
Author: jfr...@jb... Date: 2006-05-16 09:45:56 -0400 (Tue, 16 May 2006) New Revision: 4246 Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh Log: Integrate the building of libxml2 and postgresql. For examplle they are/were missing on our dev12 (Solaris SPARC). Modified: labs/jbossweb/trunk/src/share/native/build/buildphp.sh =================================================================== --- labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-16 13:30:50 UTC (rev 4245) +++ labs/jbossweb/trunk/src/share/native/build/buildphp.sh 2006-05-16 13:45:56 UTC (rev 4246) @@ -10,16 +10,84 @@ # PHPVER=5.1.4 -URL=http://de.php.net/distributions/php-${PHPVER}.tar.gz +PHPURL=http://de.php.net/distributions/php-${PHPVER}.tar.gz +XML2VER=2.6.24 +XML2URL=ftp://xmlsoft.org/libxml2/libxml2-${XML2VER}.tar.gz +PSQLVER=8.1.3 +PSQLURL=http://wwwmaster.postgresql.org/redir?ftp%3A%2F%2Fftp2.ch.postgresql.org%2Fpub%2Fpostgresql%2Fsource%2Fv${PSQLVER}%2Fpostgresql-${PSQLVER}.tar.gz + # Platfrom directory and cache TOOLS=$HOME/`uname -s`_`uname -p`_tools CACHE=`uname -s`_`uname -p`_cache +BUILDXML2=false +BUILDPSQL=false # +# Fonctions +# Extract +# $1 : directory base name +# $2 : URL +# $3 : version (add to the basename to the directory name). +Extract() +{ +BASE=$1 +URL=$2 +VER=$3 +if [ ! -f ${BASE}-${VER}.tar.gz ] +then + wget ${URL} +fi +if [ ! -d ${BASE}-${VER} ] +then + gzip -dc ${BASE}-${VER}.tar.gz | tar xvf - +fi +} + +# +# configure and install +# $1 : Source base directory +# $2 : Install directory +# $2 : Additional parameters for that machines/product. +Build() +{ +SRCDIR=$1 +INSDIR=$2 +ADDCON=$3 +(cd ${SRCDIR} + ./configure --prefix=${INSDIR} ${ADDCON} + if [ $? -ne 0 ] + then + echo "configure in ${SRCDIR} failed" + exit 1 + fi + make clean + if [ $? -ne 0 ] + then + echo "Make clean in ${SRCDIR} failed" + exit 1 + fi + make + if [ $? -ne 0 ] + then + echo "Make in ${SRCDIR} failed" + exit 1 + fi + make install + if [ $? -ne 0 ] + then + echo "Make install in ${SRCDIR} failed" + exit 1 + fi +) +} + +# # depending on machine remove or add php extensions. case `uname -n` in dev12) + BUILDXML2=true + BUILDPSQL=true # -with-libxml-dir=/usr/local but 2.6.11 needed. # Solaris dynamic ld exports the symbols so build shared extensions. EXTTYPE=shared @@ -47,6 +115,7 @@ # the make install of php (PEAR) uses php and need libxml2. LD_LIBRARY_PATH=$TOOLS/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH + ADDFLAGS="-I $JAVA_HOME/include/solaris" ;; dev17*) EXTTYPE=static @@ -118,11 +187,28 @@ " ;; esac + # +# build libxml2 if required +if ${BUILDXML2} +then + Extract libxml2 ${XML2URL} ${XML2VER} + Build libxml2-${XML2VER} $TOOLS/LIBXML2 "" +fi + +# +# build postgres if required +if ${BUILDPSQL} +then + Extract postgresql ${PSQLURL} ${PSQLVER} + Build postgresql-${PSQLVER} $TOOLS/POSTGRESQL --without-readline +fi + +# # get and extract php if [ ! -f php-${PHPVER}.tar.gz ] then - wget $URL + wget $PHPURL fi if [ ! -d php-${PHPVER} ] then @@ -130,6 +216,10 @@ fi echo "Adding to default configuration:: ${ADDCONF}" +# remove the cache that save problems but use more time when building. +rm -f php-${PHPVER}/$CACHE + +# configure php (cd php-${PHPVER} ./configure --prefix=$TOOLS/PHP \ --cache-file=$CACHE \ |