freeswitch/build/buildlib.sh
Michael Jerris 1481d37fef move module make to it's own makefile
remove need for modmake.sh (its use is now fully adressed within src/mod/Makefile.am)
remove need for generic_mod.mk (it uses the generated build/modmake.rules now instead)
add support for building out of tree modules as part of the freeswitch build simply by adding the full path to the module dir to your modules.conf
remove the need for special tragets to build.
make will now do a make through the core AND all the modules.
make install will now install the core and all the modules.
most or all of the old targets are still there, plus the new target "core" that will do more or less what make used to do.
make should now be able to be done without write permissions to the prefix directory (make install of course will still need them) whith the exception of modules that use buildlib.sh to download and install thier dependencies.  This will be fixed in a future revision.
checkversion.sh no longer will clean the modules on a change.  The need for this should be gone with the correct include paths to have the src directory included first.
Some steps in this commit to move us closer to being able to build with non gnu make (gmake).  Still some more work to do in this regard as well.
buildlib.sh no longer exports CFLAGS, just passes them to the confiure.
Move a little closer to supporting install directories in the "automake way" where all the dirs will be acutally determined in configure, and follow the standard install targets in Makefile.am
no longer build the modules twice on make install

Additional fixes still on the way for proper dependency tracking for the module builds, so they don't build every time.

any input on how to reach some of the goals stated above of supporting non gnu make, and more properly handling the install directories is appretiated.  Drop me an e-mail if you are intersted in helping.

Mike




git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4577 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-13 02:26:00 +00:00

105 lines
1.7 KiB
Bash
Executable file

#!/bin/sh
root=$1
shift
if [ -f $root/.nodepends ] ; then
echo "***depends disabled*** use $MAKE yesdepends to re-enable"
exit 0
fi
if [ -z "$MAKE" ] ; then
make=`which gmake 2>/dev/null`
if [ -z "$MAKE" ] ; then
make=make
fi
fi
GZCAT=`which gzcat 2>/dev/null`
if [ -z "$GZCAT" ] ; then
GZCAT=zcat
fi
install=
base=http://svn.freeswitch.org/downloads/libs
if [ ! -z "$1" ] && [ "$1" = install ] ; then
install=1
shift
fi
tar=$1
shift
cd $root/libs/.
CFLAGS=
LDFLAGS=
MAKEFLAGS=
if [ -d $tar ] ; then
uncompressed=$tar
tar=
else
uncompressed=`echo $tar | sed "s/\.tar\.gz//g"`
uncompressed=`echo $uncompressed | sed "s/\.tgz//g"`
if [ ! -f $tar ] ; then
rm -fr $uncompressed
wget $base/$tar || ftp $base/$tar
if [ ! -f $tar ] ; then
echo cannot find $tar
exit
fi
fi
if [ ! -d $uncompressed ] ; then
$GZCAT $tar | tar xf -
fi
fi
if [ -f $uncompressed/.complete ] ; then
if [ $uncompressed/.complete -ot $uncompressed ]; then
if [ ! -f $root/.nothanks ] ; then
echo remove stale .complete
rm $uncompressed/.complete
sh -c "cd $uncompressed && $MAKE clean distclean"
fi
fi
fi
if [ -f $uncompressed/.complete ] ; then
echo $uncompressed already installed
exit 0
fi
cd $uncompressed
if [ -f ../$uncompressed.build.sh ] ; then
MAKE=$MAKE ../$uncompressed.build.sh $@
else
$MAKE clean 2>&1
CFLAGS="$MOD_CFLAGS" sh ./configure $@
if [ $? = 0 ] ; then
$MAKE
else
echo ERROR
exit 1
fi
if [ ! -z $install ] ; then
$MAKE install
fi
fi
if [ $? = 0 ] ; then
touch .complete
sleep 1
touch .complete
else
echo ERROR
exit 1
fi
exit 0