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