#!/bin/csh -f

if ( "$1" == "" ) then
 echo Usage:  $0  gid_directory
else
 echo -n Creating \"$1/gid\" script . . .
 echo \#\!/bin/csh -f > $1/gid
 echo setenv BASEDIR $1 >> $1/gid
 echo set glx_capable=\`/usr/local/bin/xdpyinfo \| grep GLX\` >> $1/gid
 echo if \( \"\$glx_capable\" == \"\"\) then >> $1/gid
 echo setenv LD_LIBRARY_PATH \$BASEDIR/lib/mesa26:\$BASEDIR/lib >> $1/gid
 echo else >> $1/gid
 echo setenv LD_LIBRARY_PATH \$BASEDIR/lib >> $1/gid
 echo endif >> $1/gid
 echo setenv GIDDEFAULT \$BASEDIR >> $1/gid
 echo setenv GIDDEFAULTTCL \$GIDDEFAULT/scripts >> $1/gid
 echo setenv GIDEXE \$BASEDIR >> $1/gid
 echo setenv TCL_LIBRARY \$GIDDEFAULTTCL >> $1/gid
 echo setenv TK_LIBRARY \$GIDDEFAULTTCL >> $1/gid
 echo \$GIDEXE/gid.exe \$\* >> $1/gid
 chmod 755 $1/gid
 echo " Done."
 echo "\nRemember to put '$1' in your 'path' variable ( inside '.cshrc') and use:\n"
 echo "   gid  - to run 'gid'"
endif

