-
Notifications
You must be signed in to change notification settings - Fork 7
/
:mksyshead
71 lines (66 loc) · 1.25 KB
/
:mksyshead
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
#ident "@(#)mk::mksyshead 1.25.1.1"
#
# Install UNIX System 'sys' header files
#
SRCDIR=${SRC:-$ROOT/usr/src}/uts
TARGDIR=$ROOT/usr/include
SUBDIRS="sys vm fs net netinet nfs rpc des klm"
if [ ! -d $TARGDIR ]
then
mkdir $TARGDIR
fi
trap "cd $TARGDIR; rm -fr $SUBDIRS ; exit 1" 1 2 3 15
if vax
then
MACH=vax
elif i286
then
MACH=i286
elif i386
then
MACH=i386
elif pdp11
then
MACH=pdp11
elif u3b
then
MACH=3b
elif u3b2
then
MACH=3b2
elif u3b5
then
MACH=3b5
fi
#
for DIR in $SUBDIRS
do
if [ -d $SRCDIR/$MACH/$DIR ]
then (
cd $SRCDIR/$MACH
echo "Installing $SRCDIR/$MACH/$DIR into $TARGDIR/$DIR:"
find $DIR -type f -name "*.h" -print | cpio -pduv $TARGDIR
) fi
done
#
# Copy system-dependent sysent table file
echo "$TARGDIR/sys/sys.s"
[ -d $TARGDIR/sys ] || mkdir $TARGDIR/sys
if u3b5 || u3b2
then
cp $SRCDIR/${MACH}/sys/sys.u3b5 $TARGDIR/sys/sys.s
else
cp $SRCDIR/${MACH}/sys/sys.${MACH} $TARGDIR/sys/sys.s
fi
# Set file and directory permissions
# Arg list too long for chmod 755 *
cd $TARGDIR
find $SUBDIRS -type d -print | xargs chmod 755
find $SUBDIRS -type f -print | xargs chmod 664
# If native build then set owner and group
if [ "$ROOT" = "" ]
then
find $SUBDIRS -print | xargs chgrp bin
find $SUBDIRS -print | xargs chown bin
fi
exit 0