author | paulson |
Mon, 01 Mar 1999 15:57:29 +0100 | |
changeset 6291 | 2c3f72d9f5d1 |
parent 6082 | 590f9e3bf4d8 |
child 6417 | 39941b906910 |
permissions | -rwxr-xr-x |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
1 |
#!/bin/bash |
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$ |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
4 |
# |
5403 | 5 |
# DESCRIPTION: install binaries with absolute references to distribution |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
6 |
|
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 |
PRG=$(basename $0) |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
9 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
10 |
function usage() |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
11 |
{ |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
12 |
echo |
5403 | 13 |
echo "Usage: $PRG BINDIR" |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
14 |
echo |
5403 | 15 |
echo " Options are:" |
16 |
echo " -d DISTDIR use DISTDIR as Isabelle distribution (default ISABELLE_HOME)" |
|
17 |
echo |
|
5404 | 18 |
echo " Install standalone Isabelle binaries in directory BINDIR with absolute" |
19 |
echo " references to DISTDIR/bin, which becomes non-relocatable this way." |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
20 |
echo |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
21 |
exit 1 |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
22 |
} |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
23 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
24 |
function fail() |
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 |
echo "$1" >&2 |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
27 |
exit 2 |
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 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
30 |
|
5403 | 31 |
## process command line |
32 |
||
33 |
# options |
|
34 |
||
35 |
DISTDIR="$ISABELLE_HOME" |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
36 |
|
5403 | 37 |
while getopts "d:" OPT |
38 |
do |
|
39 |
case "$OPT" in |
|
5404 | 40 |
d) |
5403 | 41 |
DISTDIR="$OPTARG" |
42 |
;; |
|
43 |
\?) |
|
44 |
usage |
|
45 |
;; |
|
46 |
esac |
|
47 |
done |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
48 |
|
5403 | 49 |
shift $(($OPTIND - 1)) |
50 |
||
51 |
||
52 |
# args |
|
53 |
||
54 |
BINDIR="" |
|
55 |
[ $# -ge 1 ] && { BINDIR="$1"; shift; } |
|
56 |
||
57 |
[ $# -ne 0 -o -z "$BINDIR" -o "$BINDIR" = "-?" ] && usage |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
58 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
59 |
|
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
60 |
## main |
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
61 |
|
5403 | 62 |
mkdir -p "$BINDIR" || fail "Bad directory: $BINDIR" |
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
63 |
|
6082 | 64 |
#set by configure |
65 |
AUTO_BASH=/bin/bash |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
66 |
|
5403 | 67 |
echo "using $DISTDIR" |
68 |
||
69 |
for NAME in isatool isabelle Isabelle |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
70 |
do |
5403 | 71 |
BIN="$BINDIR/$NAME" |
72 |
DIST="$DISTDIR/bin/$NAME" |
|
73 |
echo "installing $BIN" |
|
6082 | 74 |
echo "#!$AUTO_BASH" >$BIN || fail "Cannot write file: $BIN" |
5403 | 75 |
echo >>$BIN |
76 |
echo "exec $DIST \"\$@\"" >>$BIN |
|
77 |
chmod +x $BIN |
|
5362
29ce4f1fe72c
install binaries with absolute references to ISABELLE_HOME/bin;
wenzelm
parents:
diff
changeset
|
78 |
done |