bin/isabelle
author wenzelm
Sat, 22 Oct 2016 21:10:02 +0200
changeset 64350 3af8566788e7
parent 62840 d9744f41a4ec
child 66906 03a96b8c7c06
permissions -rwxr-xr-x
remote_builds has PAR-SEQ semantics of old isatest-makedist; tuned signature;

#!/usr/bin/env bash
#
# Author: Markus Wenzel, TU Muenchen
#
# Isabelle tool wrapper.

if [ -L "$0" ]; then
  TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
  exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
fi


## settings

PRG="$(basename "$0")"

ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2


## external tool (shell script)

if [ "$#" -ge 1 -a "$1" != "-?" ]
then
  TOOL_NAME="$1"

  splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}")
  for DIR in "${TOOLS[@]}"
  do
    TOOL="$DIR/$TOOL_NAME"
    case "$TOOL" in
      *~ | *.orig) ;;
      *)
        if [ -f "$TOOL" -a -x "$TOOL" ]; then
          shift
          exec "$TOOL" "$@"
        fi
        ;;
    esac
  done
fi


## internal tool or usage (Scala)

isabelle_admin_build jars || exit $?

case "$ISABELLE_JAVA_PLATFORM" in
  x86-*)
    eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS32)"
    ;;
  x86_64-*)
    eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS64)"
    ;;
esac

exec isabelle java "${JAVA_ARGS[@]}" isabelle.Isabelle_Tool "$@"