Add socketwrapper and cputime limit.
authorLove Hörnquist Åstrand <lha@kth.se>
Tue, 10 Oct 2006 10:44:52 +0000 (10:44 +0000)
committerLove Hörnquist Åstrand <lha@kth.se>
Tue, 10 Oct 2006 10:44:52 +0000 (10:44 +0000)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18399 ec53bebd-3082-4978-b11e-865c3cabbd6b

tools/heimdal-build.sh

index 31d358beea8314e547f1153e53b652595fff2703..df91a56e14e669a0e405c2aceb1b0e3a3a3b94d5 100644 (file)
@@ -11,6 +11,7 @@ keeptree=no
 passhrase=
 builddir=
 noemail=
+cputimelimit=3600
 
 # Add some bonus paths, to find sendmail and other tools
 # on interesting platforms.
@@ -19,7 +20,7 @@ PATH="${PATH}:/usr/local/bin:/usr/local/sbin"
 
 # no more use configurabled part below (hopefully)
 
-usage="[--current] [--release version] [--cvs SourceRepository] [--cvs-flags] [--result-directory dir] [--fetch-method wget|ftp|curl|cvs] --keep-tree] [--autotools] [--passhrase string] [--no-email] [--build-dir dir]"
+usage="[--current] [--release version] [--cvs SourceRepository] [--cvs-flags] [--result-directory dir] [--fetch-method wget|ftp|curl|cvs] --keep-tree] [--autotools] [--passhrase string] [--no-email] [--build-dir dir] [--cputime]"
 
 date=`date +%Y%m%d`
 if [ "$?" != 0 ]; then
@@ -61,6 +62,10 @@ do
                hversion="heimdal-${date}"
                shift
                ;;
+       --cputime)
+               cputimelimit="$2"
+               shift 2
+               ;;
        --release)
                hversion="heimdal-$2"
                shift 2
@@ -127,6 +132,9 @@ url="${baseurl}/${dir}${hfile}"
 afsfile="${afsdir}/${dir}${hfile}"
 unpack=yes
 
+# Limit cpu seconds this all can take
+ulimit -t "$cputimelimit" > /dev/null 2>&1
+
 if [ "X${builddir}" = X ]; then
        echo "Changing build dir to ${builddir}"
        cd "${builddir}"
@@ -185,8 +193,23 @@ fi
 
 cd ${hversion} || exit 1
 
+mkdir socket_wrapper_dir
+SOCKET_WRAPPER_DIR=./socket_wrapper_dir
+export SOCKET_WRAPPER_DIR
+
 echo "Configuring and building ($hversion)"
-(./configure ${confflags} && make all check) > ab.txt 2>&1
+./configure --enable-socket-wrapper ${confflags} > ab.txt 2>&1
+if [ $? != 0 ] ; then
+    echo Configure failed
+fi
+make all >> ab.txt 2>&1
+if [ $? != 0 ] ; then
+    echo Make all failed
+fi
+make check >> ab.txt 2>&1
+if [ $? != 0 ] ; then
+    echo Make all failed
+fi
 
 if [ "X${resultdir}" != X ] ; then
        cp ab.txt "${resultdir}/ab-${hversion}-${hostname}-${date}.txt"