author | frederic.urbani@inria.fr |
Tue, 27 Mar 2012 13:46:29 +0200 | |
changeset 225 | dd5e3466cb3c |
parent 224 | 7c6a6046bf4b |
child 227 | fe6f336cf5a8 |
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 |
224 | 4 |
args=("$@") |
5 |
NB=$# |
|
6 |
for (( i=0;i<$NB;i++)); do |
|
7 |
if [ ${args[${i}]} = '-k' ] |
|
8 |
then |
|
9 |
USE_KERNEL=YES |
|
225
dd5e3466cb3c
Add a myscripts directories for user scripts build.
frederic.urbani@inria.fr
parents:
224
diff
changeset
|
10 |
WGET=wget |
224 | 11 |
fi |
12 |
done |
|
225
dd5e3466cb3c
Add a myscripts directories for user scripts build.
frederic.urbani@inria.fr
parents:
224
diff
changeset
|
13 |
for i in patch hg make $WGET tar |
224 | 14 |
do |
15 |
which $i >/dev/null |
|
16 |
if [ 1 == $? ] |
|
17 |
then |
|
18 |
echo $i not found ! |
|
19 |
echo "Please, install $i command line tool." |
|
20 |
exit 1 |
|
206
0f48e3ded7e3
Add checking of patch command existance in compile script.
frederic.urbani@inria.fr
parents:
205
diff
changeset
|
21 |
fi |
224 | 22 |
done |
120 | 23 |
cd `dirname $BASH_SOURCE`/../.. |
119 | 24 |
SAVE_PATH=$PATH |
25 |
SAVE_LDLP=$LD_LIBRARY_PATH |
|
26 |
SAVE_PKG=$PKG_CONFIG_PATH |
|
120 | 27 |
#echo clone ns-3-dce : |
28 |
#hg clone http://code.nsnam.org/furbani/ns-3-dce |
|
119 | 29 |
echo clone readversiondef |
30 |
hg clone http://code.nsnam.org/mathieu/readversiondef |
|
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
31 |
if [ "YES" == "$USE_KERNEL" ] |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
32 |
then |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
33 |
echo clone ns-3-linux |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
34 |
hg clone http://code.nsnam.org/furbani/ns-3-linux |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
35 |
fi |
134 | 36 |
echo clone ns-3-dev |
223
4e681b956203
Remove 2 patch concerning quagga integration.
frederic.urbani@inria.fr
parents:
211
diff
changeset
|
37 |
hg clone http://code.nsnam.org/ns-3-dev -r 49dadc40be43 |
119 | 38 |
mkdir build |
134 | 39 |
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
|
40 |
patch -p1 <../ns-3-dce/utils/packet-socket-upgrade-exp.patch |
134 | 41 |
./waf configure --prefix=`pwd`/../build --enable-tests |
119 | 42 |
./waf |
43 |
./waf install |
|
44 |
cd .. |
|
45 |
export PATH=$SAVE_PATH:`pwd`/build/bin |
|
46 |
export LD_LIBRARY_PATH=$SAVE_LDLP:`pwd`/build/lib |
|
47 |
export PKG_CONFIG_PATH=$SAVE_PKG:`pwd`/build/lib/pkgconfig |
|
48 |
cd readversiondef/ |
|
49 |
make |
|
50 |
make install PREFIX=`pwd`/../build/ |
|
51 |
cd .. |
|
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
52 |
if [ "YES" == "$USE_KERNEL" ] |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
53 |
then |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
54 |
cd ns-3-linux/ |
173
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
55 |
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
|
56 |
make unpatch |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
57 |
make setup |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
58 |
make defconfig |
173
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
59 |
make config |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
60 |
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
|
61 |
rm config |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
62 |
mv c2 config |
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
63 |
make |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
64 |
cd .. |
173
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
65 |
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
|
66 |
tar jxf iproute2-2.6.38.tar.bz2 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
67 |
cd iproute2-2.6.38 |
721b6053d1af
Update kernel and iproute2 sources of sources !
frederic.urbani@inria.fr
parents:
162
diff
changeset
|
68 |
./configure |
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
69 |
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
|
70 |
cd ../ns-3-dce |
205
cecb106ffa9a
Linux kernel file is searched using DCE_PATH env var now.
frederic.urbani@inria.fr
parents:
204
diff
changeset
|
71 |
ln -s ../ns-3-linux/libnet-next-2.6.so |
204 | 72 |
mkdir -p build/bin_dce |
73 |
cd build/bin_dce |
|
74 |
ln -s ../../../ns-3-linux/libnet-next-2.6.so |
|
75 |
ln -s ../../../iproute2-2.6.38/ip/ip |
|
76 |
cd ../../example/ccnx |
|
77 |
ln -s ../../build/bin_dce/libnet-next-2.6.so |
|
78 |
cd ../.. |
|
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
79 |
fi |
119 | 80 |
cd ns-3-dce/ |
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
81 |
if [ "YES" == "$USE_KERNEL" ] |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
82 |
then |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
83 |
WAF_KERNEL=--enable-kernel-stack=`pwd`/../ns-3-linux |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
84 |
fi |
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
85 |
./waf configure --prefix=`pwd`/../build --verbose $WAF_KERNEL |
119 | 86 |
./waf |
87 |
./waf install |
|
88 |
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
|
89 |
. utils/setenv.sh |
119 | 90 |
echo Launch NS3TEST-DCE |
91 |
./build/bin/ns3test-dce --verbose |
|
92 |
||
93 |
||
94 |
||
95 |
||
148
5dd2d890f1a0
Update documentation and build script.
frederic.urbani@inria.fr
parents:
140
diff
changeset
|
96 |