#!/bin/bash
# This is the script to install the kernbench support files
#

. /etc/autobench.conf || . functions

. $AUTODIR/var/server-repository

# Install a cross compiler if we need one
ARCH=`uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ \
      -e s/sa110/arm/`
case $ARCH in
  i386)
    true # Don't need a cross compiler here
    ;;
  *)
    pushd $AUTODIR/sources > /dev/null
    getcommand build-xgcc
    build-xgcc i386
    popd > /dev/null
    ;;
esac

# Install the default config
mkdir -p $AUTODIR/sources/kernbench
pushd $AUTODIR/sources/kernbench > /dev/null
wget -q "$SERVER_REPO/sources/kernbench/config"
check_status "Getting standard config"
wget -q "$SERVER_REPO/sources/kernbench/avgtime"
check_status "Getting avgtime script"
chmod a+x avgtime
popd > /dev/null
