#!/bin/sh
export Tcl="/usr/bin/tclsh"
if [ "x$1" = "x" ] ; then
  echo "bld2rc requires an input file argument"
  exit 1
fi
if [ "x$Tcl" = "x" ] ; then
	echo 'tclsh not found';
	echo 'Please rerun configure with \"--with-tclsh=/path/to/your/tclsh\" added'
	exit 1;
fi

if [ -f /usr/share/ccafe-0.8.8/bld2rc.tcl ] ; then
	Simp=/usr/share/ccafe-0.8.8/bld2rc.tcl;
fi
if [ -f /usr/share/bld2rc.tcl ] ; then
	Simp=/usr/share/bld2rc.tcl;
fi
if [ -f /usr/bin/bld2rc.tcl ] ; then
	Simp=/usr/bin/bld2rc.tcl;
fi

if [ 'x$Simp' = 'x' ] ; then
	echo 'bld2rc.tcl not found in pwd';
	exit 1;
fi

exec $Tcl $Simp -- $*
exit 0
