author | wenzelm |
Sun, 30 Nov 2008 14:03:45 +0100 | |
changeset 28915 | 0642cbb60c98 |
parent 28650 | a7ba12e0d3b7 |
child 29143 | 72c960b2b83e |
permissions | -rwxr-xr-x |
10555 | 1 |
#!/usr/bin/env bash |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
2 |
# |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
3 |
# $Id$ |
9788 | 4 |
# Author: Markus Wenzel, TU Muenchen |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
5 |
# |
6417 | 6 |
# DESCRIPTION: install standalone Isabelle executables |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
7 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
8 |
|
9788 | 9 |
PRG=$(basename "$0") |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
10 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
11 |
function usage() |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
12 |
{ |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
13 |
echo |
28650 | 14 |
echo "Usage: isabelle $PRG [OPTIONS]" |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
15 |
echo |
5403 | 16 |
echo " Options are:" |
7887 | 17 |
echo " -d DISTDIR refer to DISTDIR as Isabelle distribution" |
18 |
echo " (default ISABELLE_HOME)" |
|
6417 | 19 |
echo " -p DIR install standalone binaries in DIR" |
5403 | 20 |
echo |
6417 | 21 |
echo " Install Isabelle executables with absolute references to the current" |
22 |
echo " distribution directory." |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
23 |
echo |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
24 |
exit 1 |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
25 |
} |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
26 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
27 |
function fail() |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
28 |
{ |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
29 |
echo "$1" >&2 |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
30 |
exit 2 |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
31 |
} |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
32 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
33 |
|
5403 | 34 |
## process command line |
35 |
||
36 |
# options |
|
37 |
||
6450 | 38 |
NO_OPTS=true |
39 |
||
5403 | 40 |
DISTDIR="$ISABELLE_HOME" |
6417 | 41 |
BINDIR="" |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
42 |
|
16653 | 43 |
while getopts "d:p:" OPT |
5403 | 44 |
do |
15856 | 45 |
NO_OPTS="" |
5403 | 46 |
case "$OPT" in |
5404 | 47 |
d) |
5403 | 48 |
DISTDIR="$OPTARG" |
49 |
;; |
|
6417 | 50 |
p) |
51 |
BINDIR="$OPTARG" |
|
15733 | 52 |
;; |
5403 | 53 |
\?) |
54 |
usage |
|
55 |
;; |
|
56 |
esac |
|
57 |
done |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
58 |
|
5403 | 59 |
shift $(($OPTIND - 1)) |
60 |
||
61 |
||
62 |
# args |
|
63 |
||
9788 | 64 |
[ "$#" -ne 0 -o -n "$NO_OPTS" ] && usage |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
65 |
|
15848
3001067227af
restored AUTO_BASH/PERL -- beware of ./configure!
wenzelm
parents:
15733
diff
changeset
|
66 |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
67 |
## main |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
68 |
|
6459 | 69 |
echo "referring to distribution at $DISTDIR" |
6417 | 70 |
|
71 |
||
72 |
# standalone binaries |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
73 |
|
6417 | 74 |
if [ -n "$BINDIR" ]; then |
75 |
mkdir -p "$BINDIR" || fail "Bad directory: $BINDIR" |
|
76 |
||
28915
0642cbb60c98
removed obsolete isabelle-interface executable and ISABELLE_INTERFACE setting;
wenzelm
parents:
28650
diff
changeset
|
77 |
for NAME in isabelle isabelle-process |
6417 | 78 |
do |
79 |
BIN="$BINDIR/$NAME" |
|
15856 | 80 |
DIST="$DISTDIR/bin/$NAME" |
6417 | 81 |
echo "installing $BIN" |
15848
3001067227af
restored AUTO_BASH/PERL -- beware of ./configure!
wenzelm
parents:
15733
diff
changeset
|
82 |
rm -f "$BIN" |
26577 | 83 |
echo "#!/usr/bin/env bash" > "$BIN" || fail "Cannot write file: $BIN" |
9788 | 84 |
echo >> "$BIN" |
85 |
echo "exec \"$DIST\" \"\$@\"" >> "$BIN" |
|
86 |
chmod +x "$BIN" |
|
6417 | 87 |
done |
88 |
fi |