This repository has been archived by the owner on Oct 18, 2018. It is now read-only.
forked from rumpkernel/rumpctrl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildnb.sh
executable file
·102 lines (83 loc) · 2.81 KB
/
buildnb.sh
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/sh
# modified version of buildxen.sh from https://github.com/rumpkernel/rumpuser-xen
# Just a script to run the handful of commands required to build NetBSD libc, headers
LIBLIBS="c crypt ipsec m npf pthread prop rmt util pci y z"
MORELIBS="external/bsd/flex/lib
crypto/external/bsd/openssl/lib/libcrypto
crypto/external/bsd/openssl/lib/libdes
crypto/external/bsd/openssl/lib/libssl
external/bsd/libpcap/lib"
LIBS=""
for lib in ${LIBLIBS}; do
LIBS="${LIBS} rumpsrc/lib/lib${lib}"
done
for lib in ${MORELIBS}; do
LIBS="${LIBS} rumpsrc/${lib}"
done
STDJ='-j4'
: ${BUILD_QUIET:=-q}
set -e
# ok, urgh, we need just one tree due to how build systems work (or
# don't work). So here's what we'll do for now. Checkout rumpsrc,
# checkout nbusersrc, and copy nbusersrc over rumpsrc. Obviously, we cannot
# update rumpsrc except manually after the copy operation, but that's
# a price we're just going to be paying for now.
if [ ! -d rumpsrc ]; then
git submodule update --init --recursive
./buildrump.sh/buildrump.sh -s rumpsrc checkout
cp -Rp nbusersrc/* rumpsrc/
fi
# Build rump kernel
./buildrump.sh/buildrump.sh ${BUILD_QUIET} ${STDJ} $* \
-s rumpsrc -T rumptools -o rumpdynobj -d rumpdyn \
-R /usr/local/genode-rump -V MKSTATICLIB=no fullbuild
# Now build a static libc.
# build tools
./buildrump.sh/buildrump.sh ${BUILD_QUIET} ${STDJ} $* -s rumpsrc \
-T rumptools -o rumpobj -N -k -V MKPIC=no -V BUILDRUMP_SYSROOT=yes tools
RMAKE=`pwd`/rumptools/rumpmake
RMAKE_INST=`pwd`/rumptools/_buildrumpsh-rumpmake
#
# install full set of headers.
#
# first, "mtree" (TODO: fetch/use nbmtree)
INCSDIRS='adosfs altq arpa crypto dev filecorefs fs i386 isofs miscfs
msdosfs net net80211 netatalk netbt netinet netinet6 netipsec
netisdn netkey netmpls netnatm netsmb nfs ntfs openssl pcap ppath prop
protocols rpc rpcsvc ssp sys ufs uvm x86'
for dir in ${INCSDIRS}; do
mkdir -p rump/include/$dir
done
# XXX
mkdir -p rumpobj/dest.stage/usr/lib/pkgconfig
# then, install
echo '>> Installing headers. please wait (may take a while) ...'
(
# sys/ produces a lot of errors due to missing tools/sources
# "protect" the user from that spew
cd rumpsrc/sys
${RMAKE} -k obj >/dev/null 2>&1
${RMAKE} -k includes >/dev/null 2>&1
)
# rpcgen lossage
( cd rumpsrc/include && ${RMAKE} -k includes > /dev/null 2>&1)
# other lossage
for lib in ${LIBS}; do
( cd ${lib} && ${RMAKE} includes >/dev/null 2>&1)
done
( cd rumpsrc/lib/librumpclient && ${RMAKE} includes >/dev/null 2>&1)
echo '>> done with headers'
makeuserlib ()
{
( cd $1
${RMAKE} obj
${RMAKE} MKMAN=no MKLINT=no MKPROFILE=no MKYP=no \
NOGCCERROR=1 ${STDJ} dependall
${RMAKE_INST} MKMAN=no MKLINT=no MKPROFILE=no MKYP=no install
)
}
for lib in ${LIBS}; do
makeuserlib ${lib}
done
./buildrump.sh/buildrump.sh ${BUILD_QUIET} $* \
-s rumpsrc -T rumptools -o rumpobj install