lib/scripts/getsettings
author wenzelm
Thu Mar 10 12:11:50 2016 +0100 (2016-03-10)
changeset 62588 cd266473b81b
parent 62416 cb6c4e307b1c
child 67099 3345d53e7c58
permissions -rwxr-xr-x
isabelle_process is superseded by "isabelle process" tool;
tuned tool usage;
misc updates and tuning of "system" manual;
     1 # -*- shell-script -*- :mode=shellscript:
     2 #
     3 # Author: Makarius
     4 #
     5 # Static Isabelle environment for root of process tree.
     6 
     7 export ISABELLE_HOME
     8 
     9 export BASH_ENV="$ISABELLE_HOME/lib/scripts/getfunctions"
    10 source "$BASH_ENV"
    11 
    12 
    13 if [ -z "$ISABELLE_SETTINGS_PRESENT" ]
    14 then
    15 
    16 export ISABELLE_SETTINGS_PRESENT=true
    17 
    18 set -o allexport
    19 
    20 #sane environment defaults (notably on Mac OS X)
    21 if [ "$ISABELLE_APP" = true -a -x /usr/libexec/path_helper ]; then
    22   eval $(/usr/libexec/path_helper -s)
    23 fi
    24 
    25 #Cygwin vs. POSIX
    26 if [ "$OSTYPE" = cygwin ]
    27 then
    28   unset INI_DIR
    29 
    30   if [ -n "$TEMP_WINDOWS" ]; then
    31     TMPDIR="$(cygpath -u "$TEMP_WINDOWS")"
    32     TMP="$TMPDIR"
    33     TEMP="$TMPDIR"
    34   fi
    35 
    36   if [ -z "$USER_HOME" ]; then
    37     USER_HOME="$(cygpath -u "$USERPROFILE")"
    38   fi
    39 
    40   CYGWIN_ROOT="$(platform_path "/")"
    41   ISABELLE_ROOT="$(platform_path "$ISABELLE_HOME")"
    42 
    43   ISABELLE_CLASSPATH="$(cygpath -i -u -p "$CLASSPATH")"
    44   unset CLASSPATH
    45 else
    46   if [ -z "$USER_HOME" ]; then
    47     USER_HOME="$HOME"
    48   fi
    49 
    50   ISABELLE_ROOT="$ISABELLE_HOME"
    51 
    52   ISABELLE_CLASSPATH="$CLASSPATH"
    53   unset CLASSPATH
    54 fi
    55 
    56 #main executables
    57 ISABELLE_TOOL="$ISABELLE_HOME/bin/isabelle"
    58 ISABELLE_SCALA_SCRIPT="$ISABELLE_HOME/bin/isabelle_scala_script"
    59 PATH="$ISABELLE_HOME/bin:$PATH"
    60 
    61 #platform
    62 source "$ISABELLE_HOME/lib/scripts/isabelle-platform"
    63 if [ -z "$ISABELLE_PLATFORM" ]; then
    64   echo 1>&2 "Failed to determine hardware and operating system type!"
    65   exit 2
    66 fi
    67 
    68 #Isabelle distribution identifier -- filled in automatically!
    69 ISABELLE_ID=""
    70 [ -z "$ISABELLE_IDENTIFIER" ] && ISABELLE_IDENTIFIER=""
    71 
    72 
    73 # components
    74 
    75 ISABELLE_COMPONENTS=""
    76 ISABELLE_COMPONENTS_MISSING=""
    77 
    78 #main components
    79 init_component "$ISABELLE_HOME"
    80 [ -d "$ISABELLE_HOME/Admin" ] && init_component "$ISABELLE_HOME/Admin"
    81 if [ -d "$ISABELLE_HOME_USER" ]; then
    82   init_component "$ISABELLE_HOME_USER"
    83 else
    84   mkdir -p "$ISABELLE_HOME_USER"
    85   chmod $(umask -S) "$ISABELLE_HOME_USER"
    86 fi
    87 
    88 #ML system identifier
    89 if [ -z "$ML_PLATFORM" ]; then
    90   ML_IDENTIFIER="$ML_SYSTEM"
    91 else
    92   ML_IDENTIFIER="${ML_SYSTEM}_${ML_PLATFORM}"
    93 fi
    94 
    95 ISABELLE_OUTPUT="$ISABELLE_OUTPUT/$ML_IDENTIFIER"
    96 
    97 #enforce JAVA_HOME
    98 export JAVA_HOME="$ISABELLE_JDK_HOME/jre"
    99 
   100 set +o allexport
   101 
   102 fi