#!/bin/sh # # LKB wrapper to load the ERG and go into generation server mode # if [ -z "${LOGONROOT}" ]; then # # determine the LOGON root directory, assuming this script resides in the # top-level directory of the tree. # path=$(dirname $0) if [ "${path#./}" != "${path}" ]; then path="$(pwd)/${path#./}" fi if [ "${path#/}" = "${path}" ]; then if [ "${path}" = "." ]; then path="$(pwd)"; else path="$(pwd)/${path}" fi fi LOGONROOT="${path}"; export LOGONROOT fi # # include a shared set of shell functions and global parameters, including the # architecture identifier .LOGONOS. # . ${LOGONROOT}/etc/library.bash; source="--source"; grammar=erg; while [ $# -gt 0 -a "${1#-}" != "$1" ]; do case ${1} in --erg) grammar=erg; shift 1; ;; --erg) grammar=terg; shift 1; ;; --jacy) grammar=jacy; shift 1; ;; --gg) grammar=gg; shift 1; ;; --binary) source=""; shift 1; ;; --source) source="--source"; shift 1; ;; --rpc) port="${2}"; shift 2; ;; --gc) gc=yes; shift 1; ;; --tty) unset DISPLAY shift 1; ;; *) echo "usage: server [ --grammar ] [ --rpc port ]"; exit 1; esac done ( if [ -z "${DISPLAY}" ]; then echo "(setf (system:getenv \"DISPLAY\") nil)"; fi loadup; if [ -n "${gc}" ]; then gc; fi case ${grammar} in erg|terg) echo "(lkb::read-script-file-aux \"$LOGONROOT/lingo/${grammar}/lkb/script\")"; ;; jacy) echo "(lkb::read-script-file-aux \"$LOGONROOT/dfki/jacy/lkb/script\")"; ;; gg) echo "(lkb::read-script-file-aux \"$LOGONROOT/dfki/gg/lkb/script\")"; ;; esac; echo "(lkb::index-for-generator)"; echo "(setf *maximum-number-of-edges* 10000)"; echo "(progn (excl:gc) (excl:gc t) (excl:gc))"; echo "(lkb::start-generator-server)"; if [ -n "${port}" ]; then echo "(lkb::rpc-initialize :port ${port})"; echo "(setf lkb::*rpc-debug-p* t)"; fi echo "(format t \"~%#~%# generation server: all systems ready.~%#~%\")"; cat - ) | ${LOGONROOT}/bin/logon ${source} \ -I base -locale no_NO.UTF-8 "$@" -qq