#!/bin/sh
#
basedir=/tools/local
#
set -e
mkdir CBNSIM_BUILD
cd CBNSIM_BUILD
#
echo "build and install sff-1.9.4"
wget http://www.inf.usi.ch/carzaniga/cbn/forwarding/sff-1.9.4.tar.gz -O - | tar xzf -
mkdir sff-build
cd sff-build
../sff-1.9.4/configure --prefix=$basedir
make
make install
cd ..
#
echo "build and install ssbg-1.3.5"
wget http://www.inf.usi.ch/carzaniga/cbn/forwarding/ssbg-1.3.5.tar.gz -O - | tar xzf -
mkdir ssbg-build
cd ssbg-build
../ssbg-1.3.5/configure --prefix=$basedir
make
make install
cd ..
#
echo "build and install ssim-1.7.5"
wget http://www.inf.usi.ch/carzaniga/ssim/ssim-1.7.5.tar.gz -O - | tar xzf -
mkdir ssim-build
cd ssim-build
../ssim-1.7.5/configure --prefix=$basedir
make
make install
cd ..
#
echo "build and install ssimp-1.1.5"
wget http://www.inf.usi.ch/carzaniga/cbn/forwarding/ssimp-1.1.5.tar.gz -O - | tar xzf -
mkdir ssimp-build
cd ssimp-build
../ssimp-1.1.5/configure --prefix=$basedir CPPFLAGS=-I$basedir/include LDFLAGS=-L$basedir/lib
make
make install
cd ..
#
echo "build and install cbnsim-1.2.1"
wget http://www.inf.usi.ch/carzaniga/cbn/routing/cbnsim-1.2.1.tar.gz -O - | tar xzf -
mkdir cbnsim-build
cd cbnsim-build
../cbnsim-1.2.1/configure --prefix=$basedir CPPFLAGS=-I$basedir/include LDFLAGS=-L$basedir/lib
make
make install
cd ..
#
cd ..
echo "Build completed" 
echo "You might want to remove the CBNSIM_BUILD directory" 
