#!/bin/bash

apt-get install -y ksh gcc-3.3 g++-3.3 cpp-3.3 g77-3.4

cd /usr/bin
echo "linking the compiler link"
ln -sf gcc-3.3 gcc
ln -sf g++-3.3 g++
ln -sf cpp-3.3 cpp
ln -sf g77-3.4 g77

if [ -f /bin/sort ]; then
	echo "checking sort ..ok";
else
	echo " linking /bin/sort"
	ln -sf /usr/bin/sort /bin/sort
fi

if [ -f /bin/awk ]; then
	echo "checking awk .. ok";
else
	echo "linking /bin/awk"
	ln -sf /usr/bin/awk /bin/awk
fi

if [ ! -f "/usr/src/linux-headers-2.6.20-15-generic/include/linux/config.h" ]; then
	echo "copy the config.h"
        cp /usr/lpp/mmfs/src/config/config.h /usr/src/linux-headers-2.6.20-15-generic/include/linux/

fi

#declare -x SHARKCLONEROOT="/usr/lpp/mmfs/src"
#echo $SHARKCLONEROOT;

echo "please type the three instructions in order :"
echo "\" export SHARKCLONEROOT=\"/usr/lpp/mmfs/src\" "
echo "\" make \" "
echo "\" make InstallImages \""

