set -x
set -e
version=3.2.1
if [ -z "$ATHENA_SYS" ]
then echo no ATHENA_SYS
false
fi
add -f gcc-3.2

if [ -z $1 ]
then false
fi
if [ ! -r $1.tar.bz2 ]
then false
fi

if [ -z $2 ]
then false
fi
if [ ! -r $2.tar.bz2 ]
then false
fi
# remove from binutils
rm /afs/sipb/project/gcc-3.2/arch/$ATHENA_SYS/bin/c++filt

echo Kenta installing shared $2
pushd $2
        make install
        shortname=gcc-shared-libs
        ffname=gcc-$version-shared-libs
        pushd /afs/sipb/project/gcc-3.2/arch/$ATHENA_SYS
            pushd sym
                if [ -L $shortname -o -e $shortname ]
                then false
                fi
                ln -s ../real/$ffname $shortname
            popd
            bash /mit/gcc-3.2/src/scripts/do-links.sh $ffname $shortname -$version
        popd
popd

pwd

echo Kenta installing static $1
pushd $1
        make install
        shortname=gcc-static-libs
        ffname=gcc-$version
        pushd /afs/sipb/project/gcc-3.2/arch/$ATHENA_SYS
            pushd sym
                if [ -L $shortname -o -e $shortname ]
                then false
                fi
                ln -s ../real/$ffname $shortname
            popd
            bash /mit/gcc-3.2/src/scripts/do-links.sh $ffname $shortname -$version
        popd
popd
