#!/bin/sh

EXT=27
VERS=2.7.1

if [ -e /etc/default/gcl$EXT ] ; then
    . /etc/default/gcl$EXT ;
    if ! set | grep -q -w GCL_ANSI ; then
	if [ "$DEFAULT_GCL_ANSI" != "" ] ; then
	    GCL_ANSI="t" ;
	else
	    GCL_ANSI="no" ;
	fi
    fi
    if ! set | grep -q -w GCL_PROF ; then GCL_PROF=$DEFAULT_GCL_PROF ; fi
fi

DIR=/usr/lib/gcl-$VERS;

if [ "$GCL_ANSI" = "no" ] ; then
    if [ "$GCL_PROF" = "" ] ; then
	EXE=saved_gcl;
    else
	EXE=saved_gcl_gprof;
    fi
else
    if [ "$GCL_PROF" = "" ] ; then
	EXE=saved_ansi_gcl;
    else
	EXE=saved_ansi_gcl_gprof;
    fi
fi
SYS=$DIR/unixport

exec $SYS/$EXE -dir $SYS/ -libdir $DIR/ \
   -eval '(setq si::*allow-gzipped-file* t)' \
   -eval '(setq si::*tk-library* "/usr/lib/tk8.6")' \
   -eval "(setq si::*default-info-files* (list \"gcl$EXT-si.info\" \"gcl$EXT-tk.info\" \"gcl$EXT-dwdoc.info\" \"gcl$EXT.info\"))" \
   "$@"
