#! /bin/sh


if [ $# -ne 1 ] ; then
  echo "$0: BSP"
  exit 1
fi

BSP=$1

fatal() {
  echo "$*"
  exit 1
}


case ${BSP} in
  leon3) CPU=sparc ;;
  sis) CPU=sparc ;;
  pcp4) CPU=i386 ;;
  *)  echo "Unsupported BSP (${BSP})" ; exit 1 ;;
esac
SAMPLES="=samples"
../rtems-smp/configure --target=${CPU}-rtems4.11 --enable-rtemsbsp=${BSP} \
  --enable-tests${SAMPLES} --enable-smp  \
  --disable-posix --disable-networking --enable-maintainer-mode \
  --prefix=/home/joel/rtems-4.11-work/bsp-install >c.log 2>&1 || \
fatal Configure step failed
  
make -j3 >b.log 2>&1      || fatal make step failed
make install >i.log 2>&1  || fatal make install step failed

echo $?


