lib/scripts/getsettings
author wenzelm
Thu Nov 15 11:49:02 2007 +0100 (2007-11-15)
changeset 25434 746677c843a7
parent 21490 2f83b11c301b
child 25650 ce061f5083d7
permissions -rw-r--r--
ISABELLE_IDENTIFIER is filled in automatically, not taken from the *long* form of isatool version!
wenzelm@25434
     1
# -*- shell-script -*- :mode=shellscript:
wenzelm@2307
     2
# $Id$
wenzelm@9789
     3
# Author: Markus Wenzel, TU Muenchen
wenzelm@2299
     4
#
wenzelm@2348
     5
# getsettings - bash source script to augment current env.
wenzelm@2299
     6
wenzelm@7770
     7
if [ -z "$ISABELLE_SETTINGS_PRESENT" ]
wenzelm@7770
     8
then
wenzelm@7770
     9
wenzelm@3185
    10
set -o allexport
wenzelm@3185
    11
wenzelm@7770
    12
ISABELLE_SETTINGS_PRESENT=true
wenzelm@7770
    13
wenzelm@15972
    14
export ISABELLE_HOME
wenzelm@12598
    15
if { echo -n "$ISABELLE_HOME" | fgrep " " >/dev/null; }
wenzelm@12598
    16
then
wenzelm@12598
    17
  echo 1>&2 "### White space in ISABELLE_HOME may cause strange problems later on!"
wenzelm@12598
    18
  echo 1>&2 "### ISABELLE_HOME=\"$ISABELLE_HOME\""
wenzelm@12598
    19
fi
wenzelm@2736
    20
wenzelm@11553
    21
#key executables
wenzelm@11553
    22
ISABELLE="$ISABELLE_HOME/bin/isabelle-process"
wenzelm@9789
    23
ISATOOL="$ISABELLE_HOME/bin/isatool"
wenzelm@2299
    24
wenzelm@25434
    25
#Isabelle distribution identifier -- filled in automatically!
wenzelm@25434
    26
ISABELLE_IDENTIFIER=""
wenzelm@21490
    27
wenzelm@2643
    28
#users tend to put strange things in here ...
wenzelm@2621
    29
unset ENV
wenzelm@2621
    30
unset BASH_ENV
wenzelm@2621
    31
wenzelm@9680
    32
#support easy settings
wenzelm@9680
    33
function choosefrom ()
wenzelm@9680
    34
{
wenzelm@9680
    35
  local RESULT=""
wenzelm@9680
    36
  local FILE=""
wenzelm@9680
    37
wenzelm@9680
    38
  for FILE in "$@"
wenzelm@9680
    39
  do
wenzelm@9680
    40
    [ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE"
wenzelm@9680
    41
  done
wenzelm@9680
    42
wenzelm@9680
    43
  [ -z "$RESULT" ] && RESULT="$FILE"
wenzelm@9680
    44
  echo "$RESULT"
wenzelm@9680
    45
}
wenzelm@9680
    46
wenzelm@2643
    47
#get actual settings
wenzelm@15972
    48
source "$ISABELLE_HOME/etc/settings" || exit 2
wenzelm@9227
    49
ISABELLE_SITE_SETTINGS_PRESENT=true
wenzelm@9789
    50
wenzelm@9789
    51
[ "$ISABELLE_HOME" -ef "$ISABELLE_HOME_USER" ] && \
wenzelm@9789
    52
  { echo >&2 "### ISABELLE_HOME and ISABELLE_HOME_USER should not be the same directory!"; }
wenzelm@16253
    53
[ -z "$ISABELLE_IGNORE_USER_SETTINGS" -a -f "$ISABELLE_HOME_USER/etc/settings" ] && \
kleing@16293
    54
  { source "$ISABELLE_HOME_USER/etc/settings" || exit 2; }
wenzelm@2299
    55
wenzelm@21490
    56
#ML system identifier
wenzelm@6413
    57
if [ -z "$ML_PLATFORM" ]; then
wenzelm@6413
    58
  ML_IDENTIFIER="$ML_SYSTEM"
wenzelm@6413
    59
else
wenzelm@6413
    60
  ML_IDENTIFIER="${ML_SYSTEM}_${ML_PLATFORM}"
wenzelm@6413
    61
fi
wenzelm@21468
    62
wenzelm@6413
    63
ISABELLE_OUTPUT="$ISABELLE_OUTPUT/$ML_IDENTIFIER"
wenzelm@3118
    64
wenzelm@2299
    65
set +o allexport
wenzelm@7770
    66
wenzelm@7770
    67
fi