2006-01-30 21:04:19 +00:00
|
|
|
#!/bin/sh
|
2005-12-21 16:24:37 +00:00
|
|
|
|
2005-12-28 15:42:49 +00:00
|
|
|
root=$1
|
|
|
|
shift
|
|
|
|
|
2006-02-13 19:51:17 +00:00
|
|
|
|
2005-12-28 15:42:49 +00:00
|
|
|
if [ -f $root/.nodepends ] ; then
|
2006-01-30 21:04:19 +00:00
|
|
|
echo "***depends disabled*** use $MAKE yesdepends to re-enable"
|
2005-12-21 17:22:38 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2006-02-13 19:51:17 +00:00
|
|
|
if [ -f $root/build/freeswitch.env ] ; then
|
|
|
|
. $root/build/freeswitch.env
|
|
|
|
fi
|
|
|
|
|
2006-01-30 21:04:19 +00:00
|
|
|
if [ -z $MAKE ] ; then
|
2006-02-13 19:51:17 +00:00
|
|
|
make=`which gmake 2>/dev/null`
|
2006-01-30 21:04:19 +00:00
|
|
|
if [ -z $MAKE ] ; then
|
|
|
|
make=make
|
|
|
|
fi
|
|
|
|
fi
|
2005-12-21 17:22:38 +00:00
|
|
|
|
|
|
|
install=
|
2006-03-08 02:58:36 +00:00
|
|
|
base=http://svn.freeswitch.org/downloads/libs
|
2005-12-21 17:22:38 +00:00
|
|
|
|
2005-12-21 16:24:37 +00:00
|
|
|
if [ ! -z $1 ] && [ $1 = install ] ; then
|
|
|
|
install=1
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2005-12-21 17:22:38 +00:00
|
|
|
tar=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
cd $root/libs/.
|
|
|
|
CFLAGS=
|
|
|
|
LDFLAGS=
|
2006-01-30 21:04:19 +00:00
|
|
|
MAKEFLAGS=
|
2005-12-21 16:24:37 +00:00
|
|
|
|
|
|
|
if [ -d $tar ] ; then
|
|
|
|
uncompressed=$tar
|
|
|
|
tar=
|
|
|
|
else
|
|
|
|
uncompressed=`echo $tar | sed "s/\.tar\.gz//g"`
|
2005-12-28 21:00:36 +00:00
|
|
|
uncompressed=`echo $uncompressed | sed "s/\.tgz//g"`
|
|
|
|
|
2005-12-21 16:24:37 +00:00
|
|
|
if [ ! -f $tar ] ; then
|
|
|
|
rm -fr $uncompressed
|
2006-09-23 03:44:32 +00:00
|
|
|
wget $base/$tar || ftp $base/$tar
|
2005-12-21 16:24:37 +00:00
|
|
|
if [ ! -f $tar ] ; then
|
|
|
|
echo cannot find $tar
|
|
|
|
exit
|
|
|
|
fi
|
2005-12-28 21:00:36 +00:00
|
|
|
fi
|
|
|
|
if [ ! -d $uncompressed ] ; then
|
2005-12-21 16:24:37 +00:00
|
|
|
tar -zxvf $tar
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2005-12-21 17:22:38 +00:00
|
|
|
if [ -f $uncompressed/.complete ] ; then
|
2005-12-20 23:17:30 +00:00
|
|
|
echo $uncompressed already installed
|
2005-12-22 22:17:25 +00:00
|
|
|
exit 0
|
2005-12-20 23:17:30 +00:00
|
|
|
fi
|
2005-12-21 16:24:37 +00:00
|
|
|
|
2005-12-20 23:17:30 +00:00
|
|
|
cd $uncompressed
|
|
|
|
|
2006-02-09 22:37:44 +00:00
|
|
|
if [ -f ../$uncompressed.build.sh ] ; then
|
|
|
|
MAKE=$MAKE ../$uncompressed.build.sh $@
|
|
|
|
else
|
|
|
|
$MAKE clean 2>&1
|
2006-08-22 21:18:36 +00:00
|
|
|
CFLAGS="$MOD_CFLAGS" ; export CFLAGS; sh ./configure $@
|
2006-02-09 22:37:44 +00:00
|
|
|
|
|
|
|
if [ $? = 0 ] ; then
|
|
|
|
$MAKE
|
|
|
|
else
|
|
|
|
echo ERROR
|
|
|
|
exit 1
|
|
|
|
fi
|
2005-12-21 16:24:37 +00:00
|
|
|
|
2006-02-09 22:37:44 +00:00
|
|
|
if [ ! -z $install ] ; then
|
|
|
|
$MAKE install
|
|
|
|
fi
|
2005-12-21 16:24:37 +00:00
|
|
|
fi
|
|
|
|
|
2006-01-30 23:31:06 +00:00
|
|
|
if [ $? = 0 ] ; then
|
2005-12-21 16:24:37 +00:00
|
|
|
touch .complete
|
|
|
|
else
|
|
|
|
echo ERROR
|
|
|
|
exit 1
|
|
|
|
fi
|
2005-12-20 23:17:30 +00:00
|
|
|
|
2005-12-21 16:24:37 +00:00
|
|
|
exit 0
|