#! /bin/sh

outfile=config.out
if [ "$1" != "--help" ] ; then
   echo 
   echo "Check $outfile for results, or use ./configure --help for more info"
   Tee="| tee -a $outfile"
   Redirect=" >> $outfile"
fi

recho()
{
   eval echo $@ $Tee
}

rrun()
{
   eval $@ $Redirect
}

\rm -f $outfile

rrun which_slang=`slsh admin/check_slang.sl 2>/dev/null`
if [ -z "$which_slang" ] ; then
   recho "Error: could not find the S-Lang shell 'slsh' in your \$PATH"
   exit 1
else
   recho
   recho "Found S-Lang shell 'slsh' at $which_slang, using as default --prefix"
fi

Options="--with-slang=$which_slang --prefix=$which_slang $@"

recho 
recho "Configuring S-Lang Gtk module with: "
recho 
recho "\ \ \ \ $Options"
recho 

rrun ./configure.real $Options

if [ $? -eq 0 ] ; then
   recho
   tail -30 $outfile
fi

