lib/scripts/getsettings
author wenzelm
Wed Nov 22 19:53:24 2006 +0100 (2006-11-22)
changeset 21468 c7892915ed10
parent 16293 a920fe734a49
child 21490 2f83b11c301b
permissions -rw-r--r--
add ISABELLE_VERSION to ML_IDENTIFIER, unless this is repository or build;
wenzelm@11553
     1
# -*- shell-script -*-
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@2643
    25
#users tend to put strange things in here ...
wenzelm@2621
    26
unset ENV
wenzelm@2621
    27
unset BASH_ENV
wenzelm@2621
    28
wenzelm@9680
    29
#support easy settings
wenzelm@9680
    30
function choosefrom ()
wenzelm@9680
    31
{
wenzelm@9680
    32
  local RESULT=""
wenzelm@9680
    33
  local FILE=""
wenzelm@9680
    34
wenzelm@9680
    35
  for FILE in "$@"
wenzelm@9680
    36
  do
wenzelm@9680
    37
    [ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE"
wenzelm@9680
    38
  done
wenzelm@9680
    39
wenzelm@9680
    40
  [ -z "$RESULT" ] && RESULT="$FILE"
wenzelm@9680
    41
  echo "$RESULT"
wenzelm@9680
    42
}
wenzelm@9680
    43
wenzelm@2643
    44
#get actual settings
wenzelm@15972
    45
source "$ISABELLE_HOME/etc/settings" || exit 2
wenzelm@9227
    46
ISABELLE_SITE_SETTINGS_PRESENT=true
wenzelm@9789
    47
wenzelm@9789
    48
[ "$ISABELLE_HOME" -ef "$ISABELLE_HOME_USER" ] && \
wenzelm@9789
    49
  { echo >&2 "### ISABELLE_HOME and ISABELLE_HOME_USER should not be the same directory!"; }
wenzelm@16253
    50
[ -z "$ISABELLE_IGNORE_USER_SETTINGS" -a -f "$ISABELLE_HOME_USER/etc/settings" ] && \
kleing@16293
    51
  { source "$ISABELLE_HOME_USER/etc/settings" || exit 2; }
wenzelm@2299
    52
wenzelm@21468
    53
#produce ML system and Isabelle version identifier
wenzelm@6413
    54
if [ -z "$ML_PLATFORM" ]; then
wenzelm@6413
    55
  ML_IDENTIFIER="$ML_SYSTEM"
wenzelm@6413
    56
else
wenzelm@6413
    57
  ML_IDENTIFIER="${ML_SYSTEM}_${ML_PLATFORM}"
wenzelm@6413
    58
fi
wenzelm@21468
    59
wenzelm@21468
    60
ISABELLE_VERSION=$("$ISABELLE_HOME/lib/Tools/version")
wenzelm@21468
    61
if [ "$ISABELLE_VERSION" != "Isabelle repository version" -a "$THIS_IS_ISABELLE_BUILD" != true ]
wenzelm@21468
    62
then
wenzelm@21468
    63
  ML_IDENTIFIER="${ML_IDENTIFIER}_${ISABELLE_VERSION}"
wenzelm@21468
    64
fi
wenzelm@21468
    65
wenzelm@6413
    66
ISABELLE_OUTPUT="$ISABELLE_OUTPUT/$ML_IDENTIFIER"
wenzelm@3118
    67
wenzelm@2299
    68
set +o allexport
wenzelm@7770
    69
wenzelm@7770
    70
fi