shockjiang | e9c1ab9 | 2014-07-21 12:02:52 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | VERSION='0.1' |
Alexander Afanasyev | 6e3d1ac | 2014-07-21 12:47:49 -0700 | [diff] [blame^] | 3 | APPNAME="ndns" |
shockjiang | e9c1ab9 | 2014-07-21 12:02:52 -0700 | [diff] [blame] | 4 | |
| 5 | def options(opt): |
Alexander Afanasyev | 6e3d1ac | 2014-07-21 12:47:49 -0700 | [diff] [blame^] | 6 | opt.load(['compiler_cxx', 'gnu_dirs']) |
| 7 | opt.load(['boost', 'default-compiler-flags', 'doxygen', 'sphinx_build', |
| 8 | 'sqlite3', 'pch', 'coverage'], tooldir=['.waf-tools']) |
| 9 | |
| 10 | ropt = opt.add_option_group('NDNS Options') |
| 11 | |
| 12 | ropt.add_option('--with-tests', action='store_true', default=False, dest='with_tests', |
| 13 | help='''build unit tests''') |
shockjiang | e9c1ab9 | 2014-07-21 12:02:52 -0700 | [diff] [blame] | 14 | |
| 15 | def configure(conf): |
Alexander Afanasyev | 6e3d1ac | 2014-07-21 12:47:49 -0700 | [diff] [blame^] | 16 | conf.load(['compiler_cxx', 'gnu_dirs', |
| 17 | 'boost', 'default-compiler-flags', 'doxygen', |
| 18 | 'sqlite3', 'pch', 'coverage']) |
| 19 | |
shockjiang | e9c1ab9 | 2014-07-21 12:02:52 -0700 | [diff] [blame] | 20 | conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'], |
| 21 | uselib_store='NDN_CXX', mandatory=True) |
| 22 | |
Alexander Afanasyev | 6e3d1ac | 2014-07-21 12:47:49 -0700 | [diff] [blame^] | 23 | conf.check_sqlite3(mandatory=True) |
| 24 | |
| 25 | if conf.options.with_tests: |
| 26 | conf.env['WITH_TESTS'] = True |
| 27 | |
| 28 | USED_BOOST_LIBS = ['system'] |
| 29 | if conf.env['WITH_TESTS']: |
| 30 | USED_BOOST_LIBS += ['unit_test_framework'] |
| 31 | conf.check_boost(lib=USED_BOOST_LIBS, mandatory=True) |
| 32 | |
| 33 | # conf.define('DEFAULT_CONFIG_FILE', '%s/ndn/ndns.conf' % conf.env['SYSCONFDIR']) |
| 34 | |
| 35 | if not conf.options.with_sqlite_locking: |
| 36 | conf.define('DISABLE_SQLITE3_FS_LOCKING', 1) |
| 37 | |
| 38 | conf.write_config_header('src/config.hpp') |
| 39 | |
shockjiang | e9c1ab9 | 2014-07-21 12:02:52 -0700 | [diff] [blame] | 40 | def build (bld): |
Alexander Afanasyev | 6e3d1ac | 2014-07-21 12:47:49 -0700 | [diff] [blame^] | 41 | bld( |
| 42 | features='cxx', |
| 43 | name='ndns-objects', |
| 44 | source=bld.path.ant_glob(['src/**/*.cpp'], |
| 45 | excl=['src/main.cpp']), |
| 46 | use='NDN_CXX BOOST', |
| 47 | includes='src', |
| 48 | export_includes='src', |
| 49 | ) |
shockjiang | e9c1ab9 | 2014-07-21 12:02:52 -0700 | [diff] [blame] | 50 | |
Alexander Afanasyev | 6e3d1ac | 2014-07-21 12:47:49 -0700 | [diff] [blame^] | 51 | # bld( |
| 52 | # features='cxx cxxprogram', |
| 53 | # target='ndns', |
| 54 | # source='src/main.cpp', |
| 55 | # use='ndns-objects', |
| 56 | # ) |
shockjiang | e9c1ab9 | 2014-07-21 12:02:52 -0700 | [diff] [blame] | 57 | |
Alexander Afanasyev | 6e3d1ac | 2014-07-21 12:47:49 -0700 | [diff] [blame^] | 58 | bld.recurse('tests') |
| 59 | |
| 60 | # bld.install_files('${SYSCONFDIR}/ndn', 'ndns.conf.sample') |