#!/bin/ksh93

# Copyright 2015 Jens Elkner <jel+ubuntu-pkg@cs.uni-magdeburg.de>
# All rights reserved.
# License: CDDL 1.0

SDIR=${.sh.file%/*}
typeset -r FPROG=${.sh.file}
typeset -r PROG=${FPROG##*/}

[[ -z $1 ]] && print -u2 "Usage: ${PROG} problem_file" && exit 1

[[ -f ${SDIR}/run.tme ]] && \
	EKRHDIR="${SDIR}" || EKRHDIR="${SDIR%/*}/lib/e-krhyper/casc"
[[ -x ${EKRHDIR}/ekrh ]] && EKRH="${EKRHDIR}/ekrh" || EKRH=${ whence ekrh ; }
[[ -z ${EKRH} && -x ${SDIR}/ekrh ]] && EKRH="${SDIR}/ekrh"
[[ -z ${EKRH} ]] && print -u2 'ekrh not found - exiting' && exit 2
[[ -z ${EKRHCONF} ]] && EKRHCONF="${EKRHDIR}/config.tme"

${EKRH} "${EKRHCONF}" "$@" "${EKRHDIR}/run.tme"
