build: Cleanup and update of build scripts
Change-Id: I7fb5b8696d3b068249ae16b117bd27646d990dc3
diff --git a/tools/chunks/wscript b/tools/chunks/wscript
index 56ff392..31f92f3 100644
--- a/tools/chunks/wscript
+++ b/tools/chunks/wscript
@@ -3,28 +3,30 @@
def build(bld):
- bld(features='cxx',
- name='ndncatchunks-objects',
+ bld.objects(
+ target='ndncatchunks-objects',
source=bld.path.ant_glob('catchunks/*.cpp', excl='catchunks/ndncatchunks.cpp'),
use='core-objects')
- bld(features='cxx cxxprogram',
+ bld.program(
target='../../bin/ndncatchunks',
+ name='ndncatchunks',
source='catchunks/ndncatchunks.cpp',
use='ndncatchunks-objects')
- bld(features='cxx',
- name='ndnputchunks-objects',
+ bld.objects(
+ target='ndnputchunks-objects',
source=bld.path.ant_glob('putchunks/*.cpp', excl='putchunks/ndnputchunks.cpp'),
use='core-objects')
- bld(features='cxx cxxprogram',
+ bld.program(
target='../../bin/ndnputchunks',
+ name='ndnputchunks',
source='putchunks/ndnputchunks.cpp',
use='ndnputchunks-objects')
## (for unit tests)
- bld(name='chunks-objects',
+ bld(target='chunks-objects',
use='ndncatchunks-objects ndnputchunks-objects')
diff --git a/tools/dissect/wscript b/tools/dissect/wscript
index 373f6a4..80c6375 100644
--- a/tools/dissect/wscript
+++ b/tools/dissect/wscript
@@ -2,14 +2,13 @@
top = '../..'
def build(bld):
- bld(features='cxx',
- name='dissect-objects',
+ bld.objects(
+ target='dissect-objects',
source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
- includes='.',
- export_includes='.',
use='core-objects')
- bld(features='cxx cxxprogram',
+ bld.program(
target='../../bin/ndn-dissect',
+ name='ndn-dissect',
source='main.cpp',
use='dissect-objects')
diff --git a/tools/dump/wscript b/tools/dump/wscript
index 946b296..f489d24 100644
--- a/tools/dump/wscript
+++ b/tools/dump/wscript
@@ -20,27 +20,26 @@
'''
def configure(conf):
- conf.check(header_name="inttypes.h", mandatory=False)
- conf.check(header_name="stdint.h", mandatory=False)
- conf.check(header_name="sys/bitypes.h", mandatory=False)
- conf.check(fragment=ATTRIBUTE_CHECK, msg="Checking for __attribute__", mandatory=False)
+ conf.check(header_name='inttypes.h', mandatory=False)
+ conf.check(header_name='stdint.h', mandatory=False)
+ conf.check(header_name='sys/bitypes.h', mandatory=False)
+ conf.check(fragment=ATTRIBUTE_CHECK, msg='Checking for __attribute__', mandatory=False)
- conf.check(header_name=["sys/types.h", "sys/time.h", "time.h"],
- define="TIME_WITH_SYS_TIME", mandatory=False)
+ conf.check(header_name=['sys/types.h', 'sys/time.h', 'time.h'],
+ define='TIME_WITH_SYS_TIME', mandatory=False)
conf.check_cfg(path='pcap-config',
- package="libpcap", args=['--libs', '--cflags'],
+ package='libpcap', args=['--libs', '--cflags'],
uselib_store='PCAP', mandatory=True)
def build(bld):
- bld(features='cxx',
- name='dump-objects',
+ bld.objects(
+ target='dump-objects',
source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
- includes='.',
- export_includes='.',
- use='core-objects BOOST PCAP')
+ use='core-objects PCAP')
- bld(features='cxx cxxprogram',
+ bld.program(
target='../../bin/ndndump',
+ name='ndndump',
source='main.cpp',
use='dump-objects')
diff --git a/tools/peek/wscript b/tools/peek/wscript
index b719c8b..fa657a0 100644
--- a/tools/peek/wscript
+++ b/tools/peek/wscript
@@ -20,5 +20,5 @@
## (for unit tests)
- bld(name='peek-objects',
+ bld(target='peek-objects',
use='ndnpeek-objects')
diff --git a/tools/ping/wscript b/tools/ping/wscript
index 3e6755d..f0c5f5e 100644
--- a/tools/ping/wscript
+++ b/tools/ping/wscript
@@ -3,27 +3,29 @@
def build(bld):
- bld(features='cxx',
- name='ping-client-objects',
+ bld.objects(
+ target='ping-client-objects',
source=bld.path.ant_glob('client/*.cpp', excl='client/ndn-ping.cpp'),
use='core-objects')
- bld(features='cxx cxxprogram',
+ bld.program(
target='../../bin/ndnping',
+ name='ndnping',
source='client/ndn-ping.cpp',
use='ping-client-objects')
- bld(features='cxx',
- name='ping-server-objects',
+ bld.objects(
+ target='ping-server-objects',
source=bld.path.ant_glob('server/*.cpp', excl='server/ndn-ping-server.cpp'),
use='core-objects')
- bld(features='cxx cxxprogram',
+ bld.program(
target='../../bin/ndnpingserver',
+ name='ndnpingserver',
source='server/ndn-ping-server.cpp',
use='ping-server-objects')
## (for unit tests)
- bld(name='ping-objects',
+ bld(target='ping-objects',
use='ping-client-objects ping-server-objects')
diff --git a/tools/wscript b/tools/wscript
index 00a0fdf..9c46966 100644
--- a/tools/wscript
+++ b/tools/wscript
@@ -1,7 +1,7 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
top = '..'
-from waflib import Options, Errors
+from waflib import Options
def options(opt):
for subdir in opt.path.ant_glob(['*'], dir=True, src=False):
@@ -21,15 +21,15 @@
Options.options.disable_pib = True
- for subdir in conf.path.ant_glob(['*'], dir=True, src=False):
- tool = str(subdir.path_from(conf.path))
+ for subdir in conf.path.ant_glob('*', dir=True, src=False):
+ tool = subdir.path_from(conf.path)
all_tools.add(tool)
is_enabled = getattr(Options.options, 'enable_%s' % tool)
is_disabled = getattr(Options.options, 'disable_%s' % tool)
if is_enabled and is_disabled:
- raise Errors.WafError("--enable-%s and --disable-%s cannot be both specified" % (tool, tool))
+ conf.fatal("--enable-%s and --disable-%s cannot be both specified" % (tool, tool))
if is_enabled:
enabled_tools.add(tool)