bin/isabelle
author wenzelm
Mon Oct 02 16:47:46 2017 +0200 (21 months ago)
changeset 66754 78c74f9e960a
parent 62840 d9744f41a4ec
child 66906 03a96b8c7c06
permissions -rwxr-xr-x
merged
     1 #!/usr/bin/env bash
     2 #
     3 # Author: Markus Wenzel, TU Muenchen
     4 #
     5 # Isabelle tool wrapper.
     6 
     7 if [ -L "$0" ]; then
     8   TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
     9   exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
    10 fi
    11 
    12 
    13 ## settings
    14 
    15 PRG="$(basename "$0")"
    16 
    17 ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
    18 source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
    19 
    20 
    21 ## external tool (shell script)
    22 
    23 if [ "$#" -ge 1 -a "$1" != "-?" ]
    24 then
    25   TOOL_NAME="$1"
    26 
    27   splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}")
    28   for DIR in "${TOOLS[@]}"
    29   do
    30     TOOL="$DIR/$TOOL_NAME"
    31     case "$TOOL" in
    32       *~ | *.orig) ;;
    33       *)
    34         if [ -f "$TOOL" -a -x "$TOOL" ]; then
    35           shift
    36           exec "$TOOL" "$@"
    37         fi
    38         ;;
    39     esac
    40   done
    41 fi
    42 
    43 
    44 ## internal tool or usage (Scala)
    45 
    46 isabelle_admin_build jars || exit $?
    47 
    48 case "$ISABELLE_JAVA_PLATFORM" in
    49   x86-*)
    50     eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS32)"
    51     ;;
    52   x86_64-*)
    53     eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS64)"
    54     ;;
    55 esac
    56 
    57 exec isabelle java "${JAVA_ARGS[@]}" isabelle.Isabelle_Tool "$@"