#!/bin/sh # $Id: ghc.in 7336 2013-02-03 21:02:36Z cher $ # Copyright (c) 2011-2013 Alexander Chernov # using EJUDGE_FLAGS we may pass additional flags LANG_CONFIG_DIR="/home/judges/compile/conf/lang.d" [ "${EJUDGE_LANG_CONFIG}" = "" ] && EJUDGE_LANG_CONFIG="${LANG_CONFIG_DIR}/ghc.cfg" if [ -f "${EJUDGE_LANG_CONFIG}" ] then . "${EJUDGE_LANG_CONFIG}" else version="unknown" GHCRUN="ghc" GHCDIR= fi if [ x"${version}" = x ] then echo "This language is not supported." >&2 exit 1 fi if [ x"${GHCDIR}" != x ] then PATH="${GHCDIR}:${PATH}" fi [ x"${EJUDGE_FLAGS}" = x ] && EJUDGE_FLAGS="-O -H14m" unset LANG unset LC_ALL unset LC_MESSAGES unset LANGUAGE "${GHCRUN}" ${EJUDGE_FLAGS} "$1" -o "$2" || exit 1 if [ ! -x "$2" ] then echo "Executable file is not created" >&2 exit 1 fi exit 0