bin/isabelle
author berghofe
Wed, 07 Jun 2000 12:15:26 +0200
changeset 9046 17c5edf1706b
parent 8359 124ad46105dd
child 9786 270ca580b880
permissions -rwxr-xr-x
Exported system_command.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3203
af42c8cc8e75 fixed bash path!!!
wenzelm
parents: 3184
diff changeset
     1
#!/bin/bash
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     2
#
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
     3
# $Id$
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
     4
#
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     5
# Basic Isabelle startup script.
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     6
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     7
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     8
## settings
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     9
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    10
PRG=$(basename $0)
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    11
2735
29434f9b95dd even more robust and user friendly invocation (no longer requieres
wenzelm
parents: 2711
diff changeset
    12
ISABELLE_HOME=$(dirname $0)/..
29434f9b95dd even more robust and user friendly invocation (no longer requieres
wenzelm
parents: 2711
diff changeset
    13
. $ISABELLE_HOME/lib/scripts/getsettings || \
2936
bd33e7aae062 fixed { ... } shell syntax to accomodate bash 2.x;
wenzelm
parents: 2768
diff changeset
    14
  { echo "$PRG probably not called from its original place!"; exit 2; }
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    15
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    16
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    17
## diagnostics
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    18
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    19
function usage()
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    20
{
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    21
  echo
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    22
  echo "Usage: $PRG [OPTIONS] [INPUT] [OUTPUT]"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    23
  echo
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    24
  echo "  Options are:"
5815
b4d4a97df438 option -I: startup Isar interaction mode;
wenzelm
parents: 4539
diff changeset
    25
  echo "    -I           startup Isar interaction mode"
8359
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    26
  echo "    -c           tell ML system to compress output image"
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
    27
  echo "    -e MLTEXT    pass MLTEXT to the ML session"
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    28
  echo "    -m MODE      add print mode for output"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    29
  echo "    -q           non-interactive session"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    30
  echo "    -r           open heap file read-only"
4516
f90b2d459a1b added -u option (again);
wenzelm
parents: 4355
diff changeset
    31
  echo "    -u           pass 'use\"ROOT.ML\";' to the ML session"
3502
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
    32
  echo "    -w           reset write permissions on OUTPUT"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    33
  echo
3184
4e0bbfb113d5 renamed DEFAULT_LOGIC to ISABELLE_LOGIC;
wenzelm
parents: 3183
diff changeset
    34
  echo "  INPUT (default \"$ISABELLE_LOGIC\") and OUTPUT specify in/out heaps."
7887
eedfff88ee40 tuned usage;
wenzelm
parents: 6286
diff changeset
    35
  echo "  These are either names to be searched in the Isabelle path, or"
eedfff88ee40 tuned usage;
wenzelm
parents: 6286
diff changeset
    36
  echo "  actual file names (containing at least one /)."
2768
bc6d915b8019 renamed SYSTEM to RAW_ML_SYSTEM;
wenzelm
parents: 2735
diff changeset
    37
  echo "  If INPUT is \"RAW_ML_SYSTEM\", just start the bare bones ML system."
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    38
  echo
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    39
  exit 1
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    40
}
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    41
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    42
function fail()
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    43
{
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
    44
  echo "$1" >&2
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    45
  exit 2
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    46
}
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    47
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    48
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    49
## process command line
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    50
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    51
# options
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    52
8359
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    53
COMPRESS=""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    54
MLTEXT=""
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    55
MODES=""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    56
TERMINATE=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    57
READONLY=""
3502
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
    58
NOWRITE=""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    59
8359
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    60
while getopts "Ice:m:qruw" OPT
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    61
do
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    62
  case "$OPT" in
5815
b4d4a97df438 option -I: startup Isar interaction mode;
wenzelm
parents: 4539
diff changeset
    63
    I)
5954
4ec8b8f957e6 Isar.main();
wenzelm
parents: 5815
diff changeset
    64
      MLTEXT="$MLTEXT Isar.main();"
5815
b4d4a97df438 option -I: startup Isar interaction mode;
wenzelm
parents: 4539
diff changeset
    65
      ;;
8359
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    66
    c)
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    67
      COMPRESS=true
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    68
      ;;
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    69
    e)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    70
      MLTEXT="$MLTEXT $OPTARG"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    71
      ;;
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    72
    m)
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    73
      if [ -z "$MODES" ]; then
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    74
        MODES="\"$OPTARG\""
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    75
      else
6286
ce30e19af3df fixed order of multiple -m options;
wenzelm
parents: 5954
diff changeset
    76
        MODES="$MODES, \"$OPTARG\""
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    77
      fi
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    78
      ;;
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    79
    q)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    80
      TERMINATE=true
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    81
      ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    82
    r)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    83
      READONLY=true
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    84
      ;;
4516
f90b2d459a1b added -u option (again);
wenzelm
parents: 4355
diff changeset
    85
    u)
f90b2d459a1b added -u option (again);
wenzelm
parents: 4355
diff changeset
    86
      MLTEXT="$MLTEXT use\"ROOT.ML\";"
f90b2d459a1b added -u option (again);
wenzelm
parents: 4355
diff changeset
    87
      ;;
3502
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
    88
    w)
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
    89
      NOWRITE=true
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
    90
      ;;
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    91
    \?)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    92
      usage
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    93
      ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    94
  esac
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    95
done
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    96
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    97
shift $(($OPTIND - 1))
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    98
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    99
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   100
# args
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   101
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   102
INPUT=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   103
OUTPUT=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   104
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   105
if [ $# -ge 1 ]; then
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   106
  INPUT="$1"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   107
  shift
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   108
fi
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   109
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   110
if [ $# -ge 1 ]; then
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   111
  OUTPUT="$1"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   112
  shift
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   113
fi
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   114
2936
bd33e7aae062 fixed { ... } shell syntax to accomodate bash 2.x;
wenzelm
parents: 2768
diff changeset
   115
[ $# -ne 0 ] && { echo "Bad args: $*"; usage; }
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   116
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   117
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   118
## check ML system
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   119
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   120
[ -z "$ML_SYSTEM" ] && fail "Missing ML system settings! Unable to run Isabelle."
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   121
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   122
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   123
## input heap file
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   124
3184
4e0bbfb113d5 renamed DEFAULT_LOGIC to ISABELLE_LOGIC;
wenzelm
parents: 3183
diff changeset
   125
[ -z "$INPUT" ] && INPUT="$ISABELLE_LOGIC"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   126
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   127
case "$INPUT" in
2768
bc6d915b8019 renamed SYSTEM to RAW_ML_SYSTEM;
wenzelm
parents: 2735
diff changeset
   128
  RAW_ML_SYSTEM)
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   129
    INFILE=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   130
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   131
  */*)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   132
    INFILE="$INPUT"
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
   133
    [ ! -f "$INFILE" ] && fail "Bad heap file: \"$INFILE\""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   134
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   135
  *)
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   136
    ISA_PATH=""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   137
    INFILE=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   138
    for DIR in $(echo $ISABELLE_PATH | tr : " ")
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   139
    do
2968
8ba30b031f31 eliminated PLATFORM;
wenzelm
parents: 2936
diff changeset
   140
      ISA_PATH="$ISA_PATH $DIR"
8ba30b031f31 eliminated PLATFORM;
wenzelm
parents: 2936
diff changeset
   141
      [ -z "$INFILE" -a -f $DIR/$INPUT ] && INFILE=$DIR/$INPUT
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   142
    done
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   143
    if [ -z "$INFILE" ]; then
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
   144
      echo "Unknown logic \"$INPUT\" -- no heap file found in:" >&2
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   145
      for DIR in $ISA_PATH
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   146
      do
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
   147
        echo "  $DIR" >&2
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   148
      done
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   149
      exit 2
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   150
    fi
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   151
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   152
esac
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   153
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   154
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   155
## output heap file
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   156
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   157
case "$OUTPUT" in
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   158
  "")
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   159
    [ -z "$READONLY" -a -w "$INFILE" ] && OUTFILE="$INFILE"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   160
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   161
  */*)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   162
    OUTFILE="$OUTPUT"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   163
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   164
  *)
3118
24dae6222579 fixed ISABELLE_OUTPUT, ISABELLE_PATH (finally?);
wenzelm
parents: 3054
diff changeset
   165
    mkdir -p "$ISABELLE_OUTPUT"
24dae6222579 fixed ISABELLE_OUTPUT, ISABELLE_PATH (finally?);
wenzelm
parents: 3054
diff changeset
   166
    OUTFILE="$ISABELLE_OUTPUT/$OUTPUT"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   167
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   168
esac
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   169
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   170
4333
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   171
## prepare tmp directory
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   172
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   173
[ -z "$ISABELLE_TMP_PREFIX" ] && ISABELLE_TMP_PREFIX=/tmp/isabelle
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   174
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   175
ISABELLE_TMP="$ISABELLE_TMP_PREFIX$$"
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   176
mkdir -p "$ISABELLE_TMP"
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   177
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   178
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   179
## run it!
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   180
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   181
ML_SYSTEM_BASE=$(echo $ML_SYSTEM | cut -f1 -d-)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   182
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
   183
[ -n "$MODES" ] && MLTEXT="print_mode := [$MODES]; $MLTEXT"
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
   184
8359
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
   185
export INFILE OUTFILE COMPRESS MLTEXT TERMINATE NOWRITE ISABELLE_TMP
4333
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   186
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   187
if [ -f $ISABELLE_HOME/lib/scripts/run-$ML_SYSTEM ]; then
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   188
  $ISABELLE_HOME/lib/scripts/run-$ML_SYSTEM
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   189
else
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   190
  $ISABELLE_HOME/lib/scripts/run-$ML_SYSTEM_BASE
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   191
fi
4355
68c7c544570c pass return code!!
wenzelm
parents: 4333
diff changeset
   192
RC=$?
4333
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   193
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   194
#Do not even think of 'rm -r'!!
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   195
rmdir $ISABELLE_TMP
4355
68c7c544570c pass return code!!
wenzelm
parents: 4333
diff changeset
   196
68c7c544570c pass return code!!
wenzelm
parents: 4333
diff changeset
   197
exit $RC