-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathada-bind
executable file
·79 lines (66 loc) · 1.23 KB
/
ada-bind
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh
fatal()
{
echo "ada-bind: fatal: $1" 1>&2
exit 1
}
if [ $# -lt 1 ]
then
echo "ada-bind: usage: [@dir] source" 1>&2
exit 1
fi
#
# Check if new base dir was specified.
#
BASE_DIR="."
if [ $# -eq 2 ]
then
BASE_DIR=`echo "$1" | sed 's/^@//g'`
shift
fi
#
# Extract base name of given source file.
#
out=`echo "$1" | awk -F. '{print $1}'`
src="$1"
shift
ADABIND=`head -n 1 conf-adabind`
if [ $? -ne 0 ]
then
fatal "could not read conf-adabind"
fi
SYSTYPE=`head -n 1 conf-systype`
if [ $? -ne 0 ]
then
fatal "could not read conf-systype"
fi
ADATYPE=`head -n 1 conf-adatype`
if [ $? -ne 0 ]
then
fatal "could not read conf-adatype"
fi
ADAFLAGS="${ADAFLAGS} `head -n 1 conf-adabflags 2>/dev/null`"
#
# Read global flag file list, if present.
#
if [ -f "conf-adafflist" ]
then
for f in `cat "conf-adafflist"`
do
FLAGS=`cat $f 2>/dev/null` || fatal "could not read $f"
ADAFLAGS="${ADAFLAGS} ${FLAGS}"
done
fi
#
# Read local flag file list, if present.
#
if [ -f "${out}.iff" ]
then
for f in `cat "${out}.iff"`
do
targ="`dirname $out`/`dirname $f`/`basename $f`"
FLAGS="`cat $targ 2>/dev/null`" || fatal "could not read $f"
ADAFLAGS="${ADAFLAGS} ${FLAGS}"
done
fi
exec ${ADABIND} ${src} ${ADAFLAGS}