bin/isabelle
changeset 62829 4141c2a8458b
parent 48858 86816c61b5ca
child 62840 d9744f41a4ec
     1.1 --- a/bin/isabelle	Sun Apr 03 19:47:29 2016 +0200
     1.2 +++ b/bin/isabelle	Sun Apr 03 21:32:57 2016 +0200
     1.3 @@ -18,46 +18,40 @@
     1.4  source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
     1.5  
     1.6  
     1.7 -## diagnostics
     1.8 +## external tool (shell script)
     1.9 +
    1.10 +if [ "$#" -ge 1 -a "$1" != "-?" ]
    1.11 +then
    1.12 +  TOOL_NAME="$1"
    1.13  
    1.14 -function usage()
    1.15 -{
    1.16 -  echo
    1.17 -  echo "Usage: $PRG NAME [ARGS ...]"
    1.18 -  echo
    1.19 -  echo "  Start Isabelle tool NAME with ARGS; pass \"-?\" for tool specific help."
    1.20 -  echo
    1.21 -  echo "Available tools:"
    1.22 -  perl -w "$ISABELLE_HOME/lib/scripts/tools.pl"
    1.23 -  exit 1
    1.24 -}
    1.25 -
    1.26 -function fail()
    1.27 -{
    1.28 -  echo "$1" >&2
    1.29 -  exit 2
    1.30 -}
    1.31 +  splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}")
    1.32 +  for DIR in "${TOOLS[@]}"
    1.33 +  do
    1.34 +    TOOL="$DIR/$TOOL_NAME"
    1.35 +    case "$TOOL" in
    1.36 +      *~ | *.orig) ;;
    1.37 +      *)
    1.38 +        if [ -f "$TOOL" -a -x "$TOOL" ]; then
    1.39 +          shift
    1.40 +          exec "$TOOL" "$@"
    1.41 +        fi
    1.42 +        ;;
    1.43 +    esac
    1.44 +  done
    1.45 +fi
    1.46  
    1.47  
    1.48 -## args
    1.49 -
    1.50 -[ "$#" -lt 1 -o "$1" = "-?" ] && usage
    1.51 +## internal tool or usage (Scala)
    1.52  
    1.53 -TOOLNAME="$1"
    1.54 -shift
    1.55 -
    1.56 -
    1.57 -## main
    1.58 +isabelle_admin_build jars || exit $?
    1.59  
    1.60 -splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}")
    1.61 +case "$ISABELLE_JAVA_PLATFORM" in
    1.62 +  x86-*)
    1.63 +    eval "declare -a JAVA_ARGS=($ISABELLE_BUILD_JAVA_OPTIONS32)"
    1.64 +    ;;
    1.65 +  x86_64-*)
    1.66 +    eval "declare -a JAVA_ARGS=($ISABELLE_BUILD_JAVA_OPTIONS64)"
    1.67 +    ;;
    1.68 +esac
    1.69  
    1.70 -for DIR in "${TOOLS[@]}"
    1.71 -do
    1.72 -  TOOL="$DIR/$TOOLNAME"
    1.73 -  case "$TOOL" in
    1.74 -    *~ | *.orig) ;;
    1.75 -    *) [ -f "$TOOL" -a -x "$TOOL" ] && exec "$TOOL" "$@" ;;
    1.76 -  esac
    1.77 -done
    1.78 -
    1.79 -fail "Unknown Isabelle tool: $TOOLNAME"
    1.80 +exec isabelle java "${JAVA_ARGS[@]}" isabelle.Isabelle_Tool "$@"