author | wenzelm |
Tue, 09 Jun 2009 01:32:57 +0200 | |
changeset 31520 | 0a99c8716312 |
parent 29145 | b1c6f4563df7 |
child 32305 | c5523ded51d9 |
permissions | -rw-r--r-- |
25434
746677c843a7
ISABELLE_IDENTIFIER is filled in automatically, not taken from the *long* form of isatool version!
wenzelm
parents:
21490
diff
changeset
|
1 |
# -*- shell-script -*- :mode=shellscript: |
29145 | 2 |
# |
9789 | 3 |
# Author: Markus Wenzel, TU Muenchen |
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
4 |
# |
2348 | 5 |
# getsettings - bash source script to augment current env. |
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
6 |
|
7770
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
7 |
if [ -z "$ISABELLE_SETTINGS_PRESENT" ] |
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
8 |
then |
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
9 |
|
3185 | 10 |
set -o allexport |
11 |
||
7770
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
12 |
ISABELLE_SETTINGS_PRESENT=true |
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
13 |
|
15972 | 14 |
export ISABELLE_HOME |
12598 | 15 |
if { echo -n "$ISABELLE_HOME" | fgrep " " >/dev/null; } |
16 |
then |
|
17 |
echo 1>&2 "### White space in ISABELLE_HOME may cause strange problems later on!" |
|
18 |
echo 1>&2 "### ISABELLE_HOME=\"$ISABELLE_HOME\"" |
|
19 |
fi |
|
2736 | 20 |
|
11553 | 21 |
#key executables |
28499
eff93bc3c14f
ISABELLE_PROCESS replaces ISABELLE and ISABELLE_TOOL replaces ISATOOL -- old bindings stay for a while (legacy feature);
wenzelm
parents:
28055
diff
changeset
|
22 |
ISABELLE_PROCESS="$ISABELLE_HOME/bin/isabelle-process" |
28504
7ad7d7d6df47
simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents:
28499
diff
changeset
|
23 |
ISABELLE_TOOL="$ISABELLE_HOME/bin/isabelle" |
28499
eff93bc3c14f
ISABELLE_PROCESS replaces ISABELLE and ISABELLE_TOOL replaces ISATOOL -- old bindings stay for a while (legacy feature);
wenzelm
parents:
28055
diff
changeset
|
24 |
#legacy settings |
eff93bc3c14f
ISABELLE_PROCESS replaces ISABELLE and ISABELLE_TOOL replaces ISATOOL -- old bindings stay for a while (legacy feature);
wenzelm
parents:
28055
diff
changeset
|
25 |
ISABELLE="$ISABELLE_PROCESS" |
eff93bc3c14f
ISABELLE_PROCESS replaces ISABELLE and ISABELLE_TOOL replaces ISATOOL -- old bindings stay for a while (legacy feature);
wenzelm
parents:
28055
diff
changeset
|
26 |
ISATOOL="$ISABELLE_TOOL" |
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
27 |
|
25434
746677c843a7
ISABELLE_IDENTIFIER is filled in automatically, not taken from the *long* form of isatool version!
wenzelm
parents:
21490
diff
changeset
|
28 |
#Isabelle distribution identifier -- filled in automatically! |
746677c843a7
ISABELLE_IDENTIFIER is filled in automatically, not taken from the *long* form of isatool version!
wenzelm
parents:
21490
diff
changeset
|
29 |
ISABELLE_IDENTIFIER="" |
21490 | 30 |
|
2643 | 31 |
#users tend to put strange things in here ... |
2621 | 32 |
unset ENV |
33 |
unset BASH_ENV |
|
34 |
||
9680 | 35 |
#support easy settings |
36 |
function choosefrom () |
|
37 |
{ |
|
38 |
local RESULT="" |
|
39 |
local FILE="" |
|
40 |
||
41 |
for FILE in "$@" |
|
42 |
do |
|
43 |
[ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE" |
|
44 |
done |
|
45 |
||
46 |
[ -z "$RESULT" ] && RESULT="$FILE" |
|
47 |
echo "$RESULT" |
|
48 |
} |
|
49 |
||
27914 | 50 |
#JVM path wrapper |
25650 | 51 |
if [ "$OSTYPE" = cygwin ]; then |
27908
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
52 |
CLASSPATH="$(cygpath -u -p "$CLASSPATH")" |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
53 |
function jvmpath() { cygpath -w -p "$@"; } |
25650 | 54 |
else |
27908
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
55 |
function jvmpath() { echo "$@"; } |
25650 | 56 |
fi |
28055
eb855c3db657
provide HOME_JVM=HOME to prevent implicit cygpath mangling;
wenzelm
parents:
27940
diff
changeset
|
57 |
HOME_JVM="$HOME" |
25650 | 58 |
|
27908
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
59 |
#CLASSPATH convenience |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
60 |
function classpath () { |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
61 |
for X in "$@" |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
62 |
do |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
63 |
if [ -z "$CLASSPATH" ]; then |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
64 |
CLASSPATH="$X" |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
65 |
else |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
66 |
CLASSPATH="$CLASSPATH:$X" |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
67 |
fi |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
68 |
done |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
69 |
} |
97f8b7c0f420
refined JVM path wrappers: Isabelle environment holds Unix version of CLASSPATH, javawrapper/scalawrapper convert it back;
wenzelm
parents:
25650
diff
changeset
|
70 |
|
2643 | 71 |
#get actual settings |
15972 | 72 |
source "$ISABELLE_HOME/etc/settings" || exit 2 |
9227 | 73 |
ISABELLE_SITE_SETTINGS_PRESENT=true |
9789 | 74 |
|
75 |
[ "$ISABELLE_HOME" -ef "$ISABELLE_HOME_USER" ] && \ |
|
76 |
{ echo >&2 "### ISABELLE_HOME and ISABELLE_HOME_USER should not be the same directory!"; } |
|
16253 | 77 |
[ -z "$ISABELLE_IGNORE_USER_SETTINGS" -a -f "$ISABELLE_HOME_USER/etc/settings" ] && \ |
16293 | 78 |
{ source "$ISABELLE_HOME_USER/etc/settings" || exit 2; } |
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
79 |
|
21490 | 80 |
#ML system identifier |
6413 | 81 |
if [ -z "$ML_PLATFORM" ]; then |
82 |
ML_IDENTIFIER="$ML_SYSTEM" |
|
83 |
else |
|
84 |
ML_IDENTIFIER="${ML_SYSTEM}_${ML_PLATFORM}" |
|
85 |
fi |
|
21468
c7892915ed10
add ISABELLE_VERSION to ML_IDENTIFIER, unless this is repository or build;
wenzelm
parents:
16293
diff
changeset
|
86 |
|
6413 | 87 |
ISABELLE_OUTPUT="$ISABELLE_OUTPUT/$ML_IDENTIFIER" |
3118 | 88 |
|
2299
ed9720047d53
getsettings: bash source script to augment current env.
wenzelm
parents:
diff
changeset
|
89 |
set +o allexport |
7770
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
90 |
|
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
wenzelm
parents:
6413
diff
changeset
|
91 |
fi |