author | paulson |
Fri, 11 Aug 2017 23:38:33 +0200 | |
changeset 66402 | 5198edd9facc |
parent 62840 | d9744f41a4ec |
child 66906 | 03a96b8c7c06 |
permissions | -rwxr-xr-x |
10555 | 1 |
#!/usr/bin/env bash |
2292 | 2 |
# |
9786 | 3 |
# Author: Markus Wenzel, TU Muenchen |
2308 | 4 |
# |
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
5 |
# Isabelle tool wrapper. |
2292 | 6 |
|
15843 | 7 |
if [ -L "$0" ]; then |
8 |
TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')" |
|
15967 | 9 |
exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@" |
15843 | 10 |
fi |
11 |
||
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
12 |
|
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
13 |
## settings |
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
14 |
|
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
15 |
PRG="$(basename "$0")" |
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
16 |
|
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
17 |
ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)" |
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
18 |
source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2 |
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
19 |
|
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
20 |
|
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
21 |
## external tool (shell script) |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
22 |
|
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
23 |
if [ "$#" -ge 1 -a "$1" != "-?" ] |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
24 |
then |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
25 |
TOOL_NAME="$1" |
2292 | 26 |
|
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
27 |
splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}") |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
28 |
for DIR in "${TOOLS[@]}" |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
29 |
do |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
30 |
TOOL="$DIR/$TOOL_NAME" |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
31 |
case "$TOOL" in |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
32 |
*~ | *.orig) ;; |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
33 |
*) |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
34 |
if [ -f "$TOOL" -a -x "$TOOL" ]; then |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
35 |
shift |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
36 |
exec "$TOOL" "$@" |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
37 |
fi |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
38 |
;; |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
39 |
esac |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
40 |
done |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
41 |
fi |
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
42 |
|
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
43 |
|
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
44 |
## internal tool or usage (Scala) |
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
45 |
|
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
46 |
isabelle_admin_build jars || exit $? |
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
47 |
|
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
48 |
case "$ISABELLE_JAVA_PLATFORM" in |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
49 |
x86-*) |
62840
d9744f41a4ec
renamed ISABELLE_BUILD_JAVA_OPTIONS to ISABELLE_TOOL_JAVA_OPTIONS;
wenzelm
parents:
62829
diff
changeset
|
50 |
eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS32)" |
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
51 |
;; |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
52 |
x86_64-*) |
62840
d9744f41a4ec
renamed ISABELLE_BUILD_JAVA_OPTIONS to ISABELLE_TOOL_JAVA_OPTIONS;
wenzelm
parents:
62829
diff
changeset
|
53 |
eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS64)" |
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
54 |
;; |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
55 |
esac |
42077
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
33915
diff
changeset
|
56 |
|
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
57 |
exec isabelle java "${JAVA_ARGS[@]}" isabelle.Isabelle_Tool "$@" |