bin/isabelle
changeset 62829 4141c2a8458b
parent 48858 86816c61b5ca
child 62840 d9744f41a4ec
equal deleted inserted replaced
62828:3fee575c9dce 62829:4141c2a8458b
    16 
    16 
    17 ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
    17 ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
    18 source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
    18 source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
    19 
    19 
    20 
    20 
    21 ## diagnostics
    21 ## external tool (shell script)
    22 
    22 
    23 function usage()
    23 if [ "$#" -ge 1 -a "$1" != "-?" ]
    24 {
    24 then
    25   echo
    25   TOOL_NAME="$1"
    26   echo "Usage: $PRG NAME [ARGS ...]"
       
    27   echo
       
    28   echo "  Start Isabelle tool NAME with ARGS; pass \"-?\" for tool specific help."
       
    29   echo
       
    30   echo "Available tools:"
       
    31   perl -w "$ISABELLE_HOME/lib/scripts/tools.pl"
       
    32   exit 1
       
    33 }
       
    34 
    26 
    35 function fail()
    27   splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}")
    36 {
    28   for DIR in "${TOOLS[@]}"
    37   echo "$1" >&2
    29   do
    38   exit 2
    30     TOOL="$DIR/$TOOL_NAME"
    39 }
    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
    40 
    42 
    41 
    43 
    42 ## args
    44 ## internal tool or usage (Scala)
    43 
    45 
    44 [ "$#" -lt 1 -o "$1" = "-?" ] && usage
    46 isabelle_admin_build jars || exit $?
    45 
    47 
    46 TOOLNAME="$1"
    48 case "$ISABELLE_JAVA_PLATFORM" in
    47 shift
    49   x86-*)
       
    50     eval "declare -a JAVA_ARGS=($ISABELLE_BUILD_JAVA_OPTIONS32)"
       
    51     ;;
       
    52   x86_64-*)
       
    53     eval "declare -a JAVA_ARGS=($ISABELLE_BUILD_JAVA_OPTIONS64)"
       
    54     ;;
       
    55 esac
    48 
    56 
    49 
    57 exec isabelle java "${JAVA_ARGS[@]}" isabelle.Isabelle_Tool "$@"
    50 ## main
       
    51 
       
    52 splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}")
       
    53 
       
    54 for DIR in "${TOOLS[@]}"
       
    55 do
       
    56   TOOL="$DIR/$TOOLNAME"
       
    57   case "$TOOL" in
       
    58     *~ | *.orig) ;;
       
    59     *) [ -f "$TOOL" -a -x "$TOOL" ] && exec "$TOOL" "$@" ;;
       
    60   esac
       
    61 done
       
    62 
       
    63 fail "Unknown Isabelle tool: $TOOLNAME"