Updating the build framework
diff --git a/wscript b/wscript
index e779031..068c3e4 100644
--- a/wscript
+++ b/wscript
@@ -1,23 +1,60 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
VERSION='0.1'
-APPNAME="ndn-tlv-ping"
+APPNAME="ndns"
def options(opt):
- opt.load('compiler_cxx gnu_dirs')
+ opt.load(['compiler_cxx', 'gnu_dirs'])
+ opt.load(['boost', 'default-compiler-flags', 'doxygen', 'sphinx_build',
+ 'sqlite3', 'pch', 'coverage'], tooldir=['.waf-tools'])
+
+ ropt = opt.add_option_group('NDNS Options')
+
+ ropt.add_option('--with-tests', action='store_true', default=False, dest='with_tests',
+ help='''build unit tests''')
def configure(conf):
- conf.load("compiler_cxx gnu_dirs")
+ conf.load(['compiler_cxx', 'gnu_dirs',
+ 'boost', 'default-compiler-flags', 'doxygen',
+ 'sqlite3', 'pch', 'coverage'])
+
conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
uselib_store='NDN_CXX', mandatory=True)
+ conf.check_sqlite3(mandatory=True)
+
+ if conf.options.with_tests:
+ conf.env['WITH_TESTS'] = True
+
+ USED_BOOST_LIBS = ['system']
+ if conf.env['WITH_TESTS']:
+ USED_BOOST_LIBS += ['unit_test_framework']
+ conf.check_boost(lib=USED_BOOST_LIBS, mandatory=True)
+
+ # conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/ndns.conf' % conf.env['SYSCONFDIR'])
+
+ if not conf.options.with_sqlite_locking:
+ conf.define('DISABLE_SQLITE3_FS_LOCKING', 1)
+
+ conf.write_config_header('src/config.hpp')
+
def build (bld):
-
- bld.program (
- features = 'cxx',
- target = 'rr-test',
- source = 'tests/RR_test.cpp',
- use = 'rr',
- )
- bld.stlib(source="src/rr.cpp", target="rr", use="NDN_CXX")
+ bld(
+ features='cxx',
+ name='ndns-objects',
+ source=bld.path.ant_glob(['src/**/*.cpp'],
+ excl=['src/main.cpp']),
+ use='NDN_CXX BOOST',
+ includes='src',
+ export_includes='src',
+ )
+ # bld(
+ # features='cxx cxxprogram',
+ # target='ndns',
+ # source='src/main.cpp',
+ # use='ndns-objects',
+ # )
+ bld.recurse('tests')
+
+ # bld.install_files('${SYSCONFDIR}/ndn', 'ndns.conf.sample')