#! /bin/sh

# see the "reduce" script for commentary...

here=`dirname "$0"`
here=`cd "$here" ; pwd`
case `uname -m -o` in
x86_64*Cygwin)
  for x in $*
  do
    if test "$x" = "--nogui" ||
       test "$x" = "-w-" ||
       test "$x" = "-w"
    then
      withgui="no"
      break
    fi
  done
  if test "$withgui" = "no" || ! test -z "$DISPLAY"
  then
    $here/cygwin64-csl.exe $*
  else
    $here/csl.com $*
  fi
  ;;
i686*Cygwin)
  withgui="yes"
  for x in $*
  do
    if test "$x" = "--nogui" ||
       test "$x" = "-w-" ||
       test "$x" = "-w"
    then
      withgui="no"
      break
    fi
  done
  if test "$withgui" = "no" || ! test -z "$DISPLAY"
  then
    $here/cygwin32-csl.exe $*
  else
    $here/csl.com $*
  fi
  ;;
*)
  $here/csl.com $*
  ;;
esac
exit

