#!/bin/bash

# $TSUKUBA_Release: Omni OpenMP Compiler 3 $
# $TSUKUBA_Copyright:
#  PLEASE DESCRIBE LICENSE AGREEMENT HERE
#  $

defSetupConf="/usr/local/etc/setup.conf"
if test ! -z "${OMNI_HOME}"; then
    setupConf="${OMNI_HOME}/etc/setup.conf"
else
    setupConf="${defSetupConf}"
fi
if test ! -r "${setupConf}"; then
    setupConf="${defSetupConf}"
fi
if test ! -r "${setupConf}"; then
    if test ! -z "${OMNI_SOURCE_DIR}" -a \
	-r "${OMNI_SOURCE_DIR}/Driver/etc/setup.conf"; then
	setupConf="${OMNI_SOURCE_DIR}/Driver/etc/setup.conf"
    fi
fi
if test ! -r "${setupConf}"; then
    echo "can't read '${setupConf}'."
    exit 1
fi

. "${setupConf}"

jars="om-exc-tools.jar om-c-back.jar om-f-back.jar om-common.jar"
omniSetup ${jars}
if test $? -ne 0; then
    exit 1
fi

exec ${OMNI_JAVA} ${OMNI_JAVA_OPT} exc.util.omompx ${1+"$@"}
