#  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 ncurses installed
ncursever=`installed_version ncurses`
# 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 ncurses.h
filename="/usr/lib/gcc-lib/$hostpath/$gccver/include/ncurses.h"
# gets ncurses version info from gcc's private ncurses.h
gcc_ncurse=`grep "define NCURSES_VERSION " $filename`
gcc_ncurse_front=${gcc_ncurse#*\"}
gcc_ncurse_ver=${gcc_ncurse_front%\"}
if [ "$ncursever" != "$gcc_ncurse_ver" ]
then
  lin -c gcc
fi  
