| author | haftmann | 
| Thu, 24 May 2007 08:37:39 +0200 | |
| changeset 23087 | ad7244663431 | 
| parent 21490 | 2f83b11c301b | 
| child 25434 | 746677c843a7 | 
| permissions | -rw-r--r-- | 
| 11553 | 1 | # -*- shell-script -*- | 
| 2307 | 2 | # $Id$ | 
| 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: 
6413diff
changeset | 7 | if [ -z "$ISABELLE_SETTINGS_PRESENT" ] | 
| 
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
 wenzelm parents: 
6413diff
changeset | 8 | then | 
| 
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
 wenzelm parents: 
6413diff
changeset | 9 | |
| 3185 | 10 | set -o allexport | 
| 11 | ||
| 7770 
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
 wenzelm parents: 
6413diff
changeset | 12 | ISABELLE_SETTINGS_PRESENT=true | 
| 
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
 wenzelm parents: 
6413diff
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 | 
| 22 | ISABELLE="$ISABELLE_HOME/bin/isabelle-process" | |
| 9789 | 23 | ISATOOL="$ISABELLE_HOME/bin/isatool" | 
| 2299 
ed9720047d53
getsettings: bash source script to augment current env.
 wenzelm parents: diff
changeset | 24 | |
| 21490 | 25 | #Isabelle version | 
| 26 | ISABELLE_VERSION=$("$ISABELLE_HOME/lib/Tools/version")
 | |
| 27 | if [ "$ISABELLE_VERSION" = "Isabelle repository version" ]; then | |
| 28 | ISABELLE_IDENTIFIER="" | |
| 29 | else | |
| 30 | ISABELLE_IDENTIFIER="$ISABELLE_VERSION" | |
| 31 | fi | |
| 32 | ||
| 2643 | 33 | #users tend to put strange things in here ... | 
| 2621 | 34 | unset ENV | 
| 35 | unset BASH_ENV | |
| 36 | ||
| 9680 | 37 | #support easy settings | 
| 38 | function choosefrom () | |
| 39 | {
 | |
| 40 | local RESULT="" | |
| 41 | local FILE="" | |
| 42 | ||
| 43 | for FILE in "$@" | |
| 44 | do | |
| 45 | [ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE" | |
| 46 | done | |
| 47 | ||
| 48 | [ -z "$RESULT" ] && RESULT="$FILE" | |
| 49 | echo "$RESULT" | |
| 50 | } | |
| 51 | ||
| 2643 | 52 | #get actual settings | 
| 15972 | 53 | source "$ISABELLE_HOME/etc/settings" || exit 2 | 
| 9227 | 54 | ISABELLE_SITE_SETTINGS_PRESENT=true | 
| 9789 | 55 | |
| 56 | [ "$ISABELLE_HOME" -ef "$ISABELLE_HOME_USER" ] && \ | |
| 57 |   { echo >&2 "### ISABELLE_HOME and ISABELLE_HOME_USER should not be the same directory!"; }
 | |
| 16253 | 58 | [ -z "$ISABELLE_IGNORE_USER_SETTINGS" -a -f "$ISABELLE_HOME_USER/etc/settings" ] && \ | 
| 16293 | 59 |   { source "$ISABELLE_HOME_USER/etc/settings" || exit 2; }
 | 
| 2299 
ed9720047d53
getsettings: bash source script to augment current env.
 wenzelm parents: diff
changeset | 60 | |
| 21490 | 61 | #ML system identifier | 
| 6413 | 62 | if [ -z "$ML_PLATFORM" ]; then | 
| 63 | ML_IDENTIFIER="$ML_SYSTEM" | |
| 64 | else | |
| 65 |   ML_IDENTIFIER="${ML_SYSTEM}_${ML_PLATFORM}"
 | |
| 66 | fi | |
| 21468 
c7892915ed10
add ISABELLE_VERSION to ML_IDENTIFIER, unless this is repository or build;
 wenzelm parents: 
16293diff
changeset | 67 | |
| 6413 | 68 | ISABELLE_OUTPUT="$ISABELLE_OUTPUT/$ML_IDENTIFIER" | 
| 3118 | 69 | |
| 2299 
ed9720047d53
getsettings: bash source script to augment current env.
 wenzelm parents: diff
changeset | 70 | set +o allexport | 
| 7770 
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
 wenzelm parents: 
6413diff
changeset | 71 | |
| 
0497323c1f0b
ISABELLE_SETTINGS_PRESENT: avoid multiple invocation;
 wenzelm parents: 
6413diff
changeset | 72 | fi |