author | paulson <lp15@cam.ac.uk> |
Tue, 25 Apr 2017 16:39:54 +0100 | |
changeset 65578 | e4997c181cce |
parent 64035 | 90017a182892 |
child 66906 | 03a96b8c7c06 |
permissions | -rwxr-xr-x |
63995 | 1 |
#!/usr/bin/env bash |
2 |
# |
|
3 |
# Author: Makarius |
|
4 |
# |
|
5 |
# Isabelle/Java cold start -- without settings environment |
|
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 |
export ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)" |
|
13 |
||
14 |
( |
|
15 |
source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2 |
|
16 |
||
64035
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
17 |
case "$ISABELLE_JAVA_PLATFORM" in |
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
18 |
x86-*) |
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
19 |
ISABELLE_TOOL_JAVA_OPTIONS="$ISABELLE_TOOL_JAVA_OPTIONS32" |
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
20 |
;; |
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
21 |
x86_64-*) |
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
22 |
ISABELLE_TOOL_JAVA_OPTIONS="$ISABELLE_TOOL_JAVA_OPTIONS64" |
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
23 |
;; |
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
24 |
esac |
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
25 |
|
90017a182892
proper ISABELLE_TOOL_JAVA_OPTIONS (as in "isabelle" wrapper);
wenzelm
parents:
64022
diff
changeset
|
26 |
declare -a JAVA_ARGS; eval "JAVA_ARGS=($ISABELLE_JAVA_SYSTEM_OPTIONS $ISABELLE_TOOL_JAVA_OPTIONS)" |
63995 | 27 |
|
28 |
if [ -f "$ISABELLE_HOME/src/Tools/jEdit/dist/jedit.jar" ]; then |
|
29 |
classpath "$ISABELLE_HOME/src/Tools/jEdit/dist/jedit.jar" |
|
30 |
fi |
|
31 |
||
32 |
[ -n "$CLASSPATH" ] && classpath "$CLASSPATH" |
|
33 |
||
34 |
echo "$ISABELLE_ROOT" |
|
35 |
echo "$CYGWIN_ROOT" |
|
36 |
echo "$JAVA_HOME" |
|
37 |
echo "$(platform_path "$ISABELLE_CLASSPATH")" |
|
38 |
for ARG in "${JAVA_ARGS[@]}"; do echo "$ARG"; done |
|
39 |
) | { |
|
40 |
LINE_COUNT=0 |
|
41 |
export ISABELLE_ROOT="" |
|
42 |
export CYGWIN_ROOT="" |
|
43 |
unset JAVA_HOME |
|
44 |
unset ISABELLE_CLASSPATH |
|
45 |
unset JAVA_ARGS; declare -a JAVA_ARGS |
|
46 |
||
47 |
while { unset REPLY; read -r; test "$?" = 0 -o -n "$REPLY"; } |
|
48 |
do |
|
49 |
case "$LINE_COUNT" in |
|
50 |
0) |
|
51 |
LINE_COUNT=1 |
|
52 |
ISABELLE_ROOT="$REPLY" |
|
53 |
;; |
|
54 |
1) |
|
55 |
LINE_COUNT=2 |
|
56 |
CYGWIN_ROOT="$REPLY" |
|
57 |
;; |
|
58 |
2) |
|
59 |
LINE_COUNT=3 |
|
60 |
JAVA_HOME="$REPLY" |
|
61 |
;; |
|
62 |
3) |
|
63 |
LINE_COUNT=4 |
|
64 |
ISABELLE_CLASSPATH="$REPLY" |
|
65 |
;; |
|
66 |
*) |
|
67 |
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$REPLY" |
|
68 |
;; |
|
69 |
esac |
|
70 |
done |
|
71 |
||
72 |
if [ -z "$JAVA_HOME" ]; then |
|
73 |
echo "Unknown JAVA_HOME -- Java unavailable" >&2 |
|
74 |
exit 127 |
|
75 |
else |
|
64022 | 76 |
unset ISABELLE_HOME |
63995 | 77 |
unset CLASSPATH |
78 |
exec "$JAVA_HOME/bin/java" "${JAVA_ARGS[@]}" -classpath "$ISABELLE_CLASSPATH" "$@" |
|
79 |
fi |
|
80 |
} |