#  Recompile of gcc is necessary as it "fixes" its own copy of the
# ncurses.h and slang.h include files.  This will allow gcc to correctly
# recompile a ncurses/slang app.

rm  -f  $BOOST_LOCK
# lunar get version of gcc installed
gccver=`installed_version gcc`
# lunar get version of slang installed
slangver=`installed_version slang`
# This finds the host architecture string from gccbug
hostarchstr=`grep "\--host=" /usr/bin/gccbug`
# strip from front of string upto --host=
hostarch=${hostarchstr#*--host=}
# find first_blank in hostarch
hostend=`expr index "$hostarch" ' '`
# extract from beginning to first_blank-1
hostpath=${hostarch:0:$hostend-1}
# build filename for location of slang.h
filename="/usr/lib/gcc-lib/$hostpath/$gccver/include/slang.h"
# gets slang version info from gcc's private slang.h
gcc_slang=`grep "define SLANG_VERSION_STRING " $filename`
gcc_slang_front=${gcc_slang#*\"}
gcc_slang_ver=${gcc_slang_front%\"}
if [ "$slangver" != "$gcc_slang_ver" ]
then
  lin -c gcc
fi  
