-
Notifications
You must be signed in to change notification settings - Fork 0
/
cc-slib
executable file
·71 lines (61 loc) · 1.02 KB
/
cc-slib
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
#!/bin/sh
fatal()
{
echo "cc-slib: fatal: $1" 1>&2
exit 1
}
if [ $# -lt 2 ]
then
echo "cc-slib: usage: [@dir] basename objects ..." 1>&2
exit 1
fi
#
# check if base directory was specified
#
BASE_DIR="."
echo "$1" | grep '^@' 2>&1 >/dev/null
if [ $? -eq 0 ]
then
BASE_DIR=`echo $1 | sed 's/^@//g'`
shift
fi
SYS_TYPE=`head -n 1 "${BASE_DIR}/conf-systype"`
if [ $? -ne 0 ]
then
fatal "could not read ${BASE_DIR}/conf-systype"
fi
AR="ar cr"
if [ -f "${BASE_DIR}/conf-ar" ]
then
AR=`head -n 1 "${BASE_DIR}/conf-ar"`
if [ $? -ne 0 ]
then
fatal "could not read ${BASE_DIR}/conf-ar"
fi
fi
RANLIB="ranlib"
if [ -f ${BASE_DIR}/conf-ranlib ]
then
RANLIB=`head -n 1 ${BASE_DIR}/conf-ranlib`
if [ $? -ne 0 ]
then
fatal "could not read ${BASE_DIR}/conf-ranlib"
fi
fi
main="$1"
shift
rm -f "${main}".a
${AR} "${main}".a ${1+"$@"}
case "${SYS_TYPE}" in
SUNOS) ;;
SCO_OPENSERVER) ;;
UNIXWARE) ;;
IRIX) ;;
DG_UX) ;;
UNIXWARE) ;;
CRAY_UNICOS) ;;
VMS) ;;
*)
${RANLIB} "$main.a"
;;
esac