Add VDL option to waf to build dce-runner in order to run dce scenario using the VDL loader.
--- a/utils/clone_and_compile_ns3_dce.sh Tue Jun 12 17:10:08 2012 +0200
+++ b/utils/clone_and_compile_ns3_dce.sh Thu Jun 14 15:27:19 2012 +0200
@@ -1,6 +1,8 @@
#!/bin/bash
# this script checkout NS3 and DCE sources, and build them.
USE_KERNEL=NO
+USE_VDL=NO
+WAF_VDL=
args=("$@")
NB=$#
for (( i=0;i<$NB;i++)); do
@@ -9,6 +11,10 @@
USE_KERNEL=YES
WGET=wget
fi
+ if [ ${args[${i}]} = '-v' ]
+ then
+ USE_VDL=YES
+ fi
done
for i in patch hg make $WGET tar
do
@@ -74,16 +80,26 @@
cd build/bin_dce
ln -s ../../../ns-3-linux/libnet-next-2.6.so
ln -s ../../../iproute2-2.6.38/ip/ip
- cd ../../example/ccnx
- ln -s ../../build/bin_dce/libnet-next-2.6.so
+# cd ../../example/ccnx
+# ln -s ../../build/bin_dce/libnet-next-2.6.so
cd ../..
fi
+if [ "YES" == "$USE_VDL" ]
+then
+ hg clone http://code.nsnam.org/mathieu/elf-loader/ -r d7ef4732dccc
+ cd elf-loader
+ make vdl-config.h
+ make
+ make test
+ cd ..
+ WAF_VDL="--enable-vdl-loader"
+fi
cd ns-3-dce/
if [ "YES" == "$USE_KERNEL" ]
then
WAF_KERNEL=--enable-kernel-stack=`pwd`/../ns-3-linux
fi
-./waf configure --prefix=`pwd`/../build --verbose $WAF_KERNEL
+./waf configure --prefix=`pwd`/../build --verbose $WAF_KERNEL $WAF_VDL
./waf
./waf install
export LD_LIBRARY_PATH=$SAVE_LDLP:`pwd`/build/lib:`pwd`/build/bin:`pwd`/../build/lib
--- a/utils/wscript Tue Jun 12 17:10:08 2012 +0200
+++ b/utils/wscript Thu Jun 14 15:27:19 2012 +0200
@@ -1,16 +1,13 @@
import os
+def configure(conf):
+ conf.load('compiler_c')
+ conf.load('compiler_cxx')
+
def build(bld):
- program = bld.new_task_gen('cc', 'program')
- program.source = ['dce-runner.c']
- program.name = 'dce-runner'
- program.target = 'dce-runner'
- program.env.append_value('CCFLAGS', '-fpic')
- program.env.append_value('LINKFLAGS', '-ldl')
- program.env.append_value('LINKFLAGS', '-pie')
- linker = os.path.join ('build', bld.env.variant (), 'src',
- 'dce', 'vdl', 'ldso')
- program.env.append_value('LINKFLAGS', '-Wl,--dynamic-linker=' +
- os.path.abspath (linker))
+ linkerpath=os.path.abspath(os.path.join('..', 'elf-loader','ldso'))
+ bld.program(source='dce-runner.c', target='../../build/bin/dce-runner',
+ cflags = [ '-fPIC'], linkflags = ['-pie','-ldl','-Wl,--dynamic-linker=' + linkerpath ] )
+
--- a/wscript Tue Jun 12 17:10:08 2012 +0200
+++ b/wscript Thu Jun 14 15:27:19 2012 +0200
@@ -14,7 +14,11 @@
help=('Path to the prefix where the kernel wrapper headers are installed'),
default=None,
dest='kernel_stack', type="string")
-
+ opt.add_option('--enable-vdl-loader',
+ help=('Enable the build of dce-runner.'),
+ dest='enable_vdl_loader', action='store_true',
+ default=False)
+
def search_file(files):
for f in files:
if os.path.isfile (f):
@@ -79,9 +83,17 @@
conf.env['KERNEL_STACK'] = Options.options.kernel_stack
conf_myscripts(conf)
-
+
+ # Decide if VDL
+ if Options.options.enable_vdl_loader:
+ # Tests were explicitly enabled.
+ conf.env['ENABLE_VDL'] = True
+ conf.recurse(os.path.join('utils'))
+ else:
+ # Tests were explicitly disabled.
+ conf.env['ENABLE_VDL'] = False
ns3waf.print_feature_summary(conf)
-
+
def build_netlink(bld):
module_source = [
'netlink/netlink-socket.cc',
@@ -450,3 +462,7 @@
linkflags=['-nostdlib', '-lc',
'-Wl,--version-script=' + os.path.join('model', 'libpthread.version'),
'-Wl,-soname=libpthread.so.0'])
+ if bld.env['ENABLE_VDL']:
+ bld.add_subdirs(['utils'])
+
+
\ No newline at end of file