author | wenzelm |
Fri, 22 Jul 2022 15:15:26 +0200 | |
changeset 75686 | 42f19e398ee4 |
parent 74038 | b4f57bfe82e7 |
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 |
|
73705
ac07f6be27ea
avoid unexpected output+behaviour when CDPATH is set
kleing
parents:
66906
diff
changeset
|
7 |
unset CDPATH |
ac07f6be27ea
avoid unexpected output+behaviour when CDPATH is set
kleing
parents:
66906
diff
changeset
|
8 |
|
15843 | 9 |
if [ -L "$0" ]; then |
10 |
TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')" |
|
15967 | 11 |
exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@" |
15843 | 12 |
fi |
13 |
||
28504
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 |
## settings |
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 |
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
|
18 |
|
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
19 |
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
|
20 |
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
|
21 |
|
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
22 |
|
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
23 |
## external tool (shell script) |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
24 |
|
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
25 |
if [ "$#" -ge 1 -a "$1" != "-?" ] |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
26 |
then |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
27 |
TOOL_NAME="$1" |
2292 | 28 |
|
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
29 |
splitarray ":" "$ISABELLE_TOOLS"; TOOLS=("${SPLITARRAY[@]}") |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
30 |
for DIR in "${TOOLS[@]}" |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
31 |
do |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
32 |
TOOL="$DIR/$TOOL_NAME" |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
33 |
case "$TOOL" in |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
34 |
*~ | *.orig) ;; |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
35 |
*) |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
36 |
if [ -f "$TOOL" -a -x "$TOOL" ]; then |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
37 |
shift |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
38 |
exec "$TOOL" "$@" |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
39 |
fi |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
40 |
;; |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
41 |
esac |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
42 |
done |
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
43 |
fi |
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
44 |
|
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 |
## 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
|
47 |
|
74038
b4f57bfe82e7
more robust "isabelle build_scala" as separate tool;
wenzelm
parents:
74017
diff
changeset
|
48 |
"$ISABELLE_HOME/lib/Tools/scala_build" || exit $? |
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
15967
diff
changeset
|
49 |
|
66906 | 50 |
eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS)" |
62829
4141c2a8458b
clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents:
48858
diff
changeset
|
51 |
exec isabelle java "${JAVA_ARGS[@]}" isabelle.Isabelle_Tool "$@" |