author | frederic.urbani@inria.fr |
Tue, 13 Dec 2011 10:51:45 +0100 | |
changeset 204 | 60a9cf52e24a |
parent 203 | 84a1955f45cf |
child 205 | cecb106ffa9a |
permissions | -rwxr-xr-x |
119 | 1 |
#!/bin/bash |
2 |
# this script checkout NS3 and DCE sources, and build them. |
|
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
3 |
USE_KERNEL=NO |
120 | 4 |
cd `dirname $BASH_SOURCE`/../.. |
119 | 5 |
SAVE_PATH=$PATH |
6 |
SAVE_LDLP=$LD_LIBRARY_PATH |
|
7 |
SAVE_PKG=$PKG_CONFIG_PATH |
|
120 | 8 |
#echo clone ns-3-dce : |
9 |
#hg clone http://code.nsnam.org/furbani/ns-3-dce |
|
119 | 10 |
echo clone readversiondef |
11 |
hg clone http://code.nsnam.org/mathieu/readversiondef |
|
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
12 |
if [ "YES" == "$USE_KERNEL" ] |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
13 |
then |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
14 |
echo clone ns-3-linux |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
15 |
hg clone http://code.nsnam.org/furbani/ns-3-linux |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
16 |
fi |
134 | 17 |
echo clone ns-3-dev |
203 | 18 |
hg clone http://code.nsnam.org/ns-3-dev -r 027aae146ae2 |
119 | 19 |
mkdir build |
134 | 20 |
cd ns-3-dev |
162
cb46566adf75
Add prototype implementation for socket of domain AF_PACKET and type SOCK_RAW.
frederic.urbani@inria.fr
parents:
161
diff
changeset
|
21 |
patch -p1 <../ns-3-dce/utils/packet-socket-upgrade-exp.patch |
187
83c9c0630720
update build script add some patchs (from Alexander Afanasyev )needed by DCE for quagga.
frederic.urbani@inria.fr
parents:
178
diff
changeset
|
22 |
patch -p1 <../ns-3-dce/utils/0001-Replace-references-to-m_recvpktinfo-with-method-call.patch |
83c9c0630720
update build script add some patchs (from Alexander Afanasyev )needed by DCE for quagga.
frederic.urbani@inria.fr
parents:
178
diff
changeset
|
23 |
patch -p1 <../ns-3-dce/utils/0002-A-new-templated-static-method-Ipv4RoutingHelper-GetR.patch |
134 | 24 |
./waf configure --prefix=`pwd`/../build --enable-tests |
119 | 25 |
./waf |
26 |
./waf install |
|
27 |
cd .. |
|
28 |
export PATH=$SAVE_PATH:`pwd`/build/bin |
|
29 |
export LD_LIBRARY_PATH=$SAVE_LDLP:`pwd`/build/lib |
|
30 |
export PKG_CONFIG_PATH=$SAVE_PKG:`pwd`/build/lib/pkgconfig |
|
31 |
cd readversiondef/ |
|
32 |
make |
|
33 |
make install PREFIX=`pwd`/../build/ |
|
34 |
cd .. |
|
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
35 |
if [ "YES" == "$USE_KERNEL" ] |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
36 |
then |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
37 |
cd ns-3-linux/ |
173
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
38 |
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git net-next-2.6 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
39 |
git clone git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git net-next-2.6 |
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
40 |
make unpatch |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
41 |
make setup |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
42 |
make defconfig |
173
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
43 |
make config |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
44 |
sed s/CONFIG_PACKET=m/CONFIG_PACKET=y/ config >c2 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
45 |
rm config |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
46 |
mv c2 config |
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
47 |
make |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
48 |
cd .. |
173
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
49 |
# wget http://devresources.linuxfoundation.org/dev/iproute2/download/iproute2-2.6.33.tar.bz2 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
50 |
wget http://www.linuxgrill.com/anonymous/iproute2/NEW-OSDL/iproute2-2.6.38.tar.bz2 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
51 |
# tar jxf iproute2-2.6.33.tar.bz2 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
52 |
tar jxf iproute2-2.6.38.tar.bz2 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
53 |
# cd iproute2-2.6.33 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
54 |
cd iproute2-2.6.38 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
55 |
./configure |
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
56 |
LDFLAGS=-pie make CCOPTS='-fpic -D_GNU_SOURCE -O0 -U_FORTIFY_SOURCE' |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
57 |
cd ../ns-3-dce |
204 | 58 |
mkdir -p build/bin_dce |
59 |
cd build/bin_dce |
|
60 |
ln -s ../../../ns-3-linux/libnet-next-2.6.so |
|
173
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
61 |
# ln -s ../iproute2-2.6.33/ip/ip |
204 | 62 |
ln -s ../../../iproute2-2.6.38/ip/ip |
63 |
cd ../../example/ccnx |
|
64 |
ln -s ../../build/bin_dce/libnet-next-2.6.so |
|
65 |
# ln -s ../../ip |
|
66 |
cd ../.. |
|
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
67 |
fi |
119 | 68 |
cd ns-3-dce/ |
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
69 |
if [ "YES" == "$USE_KERNEL" ] |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
70 |
then |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
71 |
WAF_KERNEL=--enable-kernel-stack=`pwd`/../ns-3-linux |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
72 |
fi |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
73 |
./waf configure --prefix=`pwd`/../build --verbose $WAF_KERNEL |
119 | 74 |
./waf |
75 |
./waf install |
|
76 |
export LD_LIBRARY_PATH=$SAVE_LDLP:`pwd`/build/lib:`pwd`/build/bin:`pwd`/../build/lib |
|
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
77 |
. utils/setenv.sh |
119 | 78 |
echo Launch NS3TEST-DCE |
79 |
./build/bin/ns3test-dce --verbose |
|
80 |
||
81 |
||
82 |
||
83 |
||
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
84 |