author | wenzelm |
Mon, 29 Feb 2016 20:35:06 +0100 | |
changeset 62475 | 43e64c770f28 |
parent 62459 | 7a5d88dd8cc9 |
permissions | -rwxr-xr-x |
10555 | 1 |
#!/usr/bin/env bash |
2301 | 2 |
# |
26215
94d32a7cd0fb
rearrangements to make latest Poly/ML the default, not old 4.x;
wenzelm
parents:
25123
diff
changeset
|
3 |
# Author: Makarius |
2314 | 4 |
# |
62459 | 5 |
# Startup script for Poly/ML 5.3.0. |
9977 | 6 |
|
62475
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
7 |
export -n HEAP_FILE ML_TEXT TERMINATE |
2301 | 8 |
|
9 |
||
10 |
## diagnostics |
|
11 |
||
40544 | 12 |
function fail() |
13 |
{ |
|
14 |
echo "$1" >&2 |
|
15 |
exit 2 |
|
16 |
} |
|
17 |
||
10206 | 18 |
function check_file() |
5063 | 19 |
{ |
40544 | 20 |
[ ! -f "$1" ] && fail "Unable to locate \"$1\"" |
5063 | 21 |
} |
22 |
||
2301 | 23 |
|
24 |
## prepare databases |
|
25 |
||
62475
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
26 |
if [ -z "$HEAP_FILE" ]; then |
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
27 |
INIT="fun exit rc = Posix.Process.exit (Word8.fromInt rc);" |
10105 | 28 |
else |
62475
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
29 |
check_file "$HEAP_FILE" |
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
30 |
INIT="(Signal.signal (2, Signal.SIG_HANDLE (fn _ => Process.interruptConsoleProcesses ())); PolyML.SaveState.loadState \"$HEAP_FILE\" handle exn => (TextIO.output (TextIO.stdErr, General.exnMessage exn ^ \": $HEAP_FILE\\n\"); Posix.Process.exit 0w1));" |
2301 | 31 |
fi |
32 |
||
33 |
||
62475
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
34 |
## poly process |
2301 | 35 |
|
62475
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
36 |
ML_TEXT="$INIT $ML_TEXT" |
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
37 |
|
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
38 |
check_file "$ML_HOME/poly" |
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
39 |
librarypath "$ML_HOME" |
26215
94d32a7cd0fb
rearrangements to make latest Poly/ML the default, not old 4.x;
wenzelm
parents:
25123
diff
changeset
|
40 |
|
16254
1b2683e18fd2
DISCGARB_OPTIONS: proper treatment of specific polyml versions;
wenzelm
parents:
15850
diff
changeset
|
41 |
if [ -z "$TERMINATE" ]; then |
1b2683e18fd2
DISCGARB_OPTIONS: proper treatment of specific polyml versions;
wenzelm
parents:
15850
diff
changeset
|
42 |
FEEDER_OPTS="" |
1b2683e18fd2
DISCGARB_OPTIONS: proper treatment of specific polyml versions;
wenzelm
parents:
15850
diff
changeset
|
43 |
else |
1b2683e18fd2
DISCGARB_OPTIONS: proper treatment of specific polyml versions;
wenzelm
parents:
15850
diff
changeset
|
44 |
FEEDER_OPTS="-q" |
1b2683e18fd2
DISCGARB_OPTIONS: proper treatment of specific polyml versions;
wenzelm
parents:
15850
diff
changeset
|
45 |
fi |
1b2683e18fd2
DISCGARB_OPTIONS: proper treatment of specific polyml versions;
wenzelm
parents:
15850
diff
changeset
|
46 |
|
62475
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
47 |
"$ISABELLE_HOME/lib/scripts/feeder" -p -h "$ML_TEXT" $FEEDER_OPTS | \ |
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62459
diff
changeset
|
48 |
{ read FPID; "$ML_HOME/poly" -q $ML_OPTIONS; RC="$?"; kill -TERM "$FPID"; exit "$RC"; } |
9789 | 49 |
RC="$?" |
2301 | 50 |
|
9789 | 51 |
exit "$RC" |
40480 | 52 |
|
53 |
#:wrap=soft:maxLineLen=100: |