blob: e7dd99b8cbed3c1683b145fb3c549c3a24d8e649 [file] [log] [blame]
Junxiao Shif7191242015-03-19 05:53:41 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2import os
3
4VERSION='0.1'
Junxiao Shi2219a052015-05-28 02:53:48 -07005APPNAME='ndn-tools'
Junxiao Shif7191242015-03-19 05:53:41 -07006
7def options(opt):
8 opt.load(['compiler_cxx', 'gnu_dirs'])
Junxiao Shi2222a612015-06-06 08:01:38 -07009 opt.load(['default-compiler-flags', 'sphinx_build', 'boost'], tooldir=['.waf-tools'])
Junxiao Shi2713a3b2015-06-22 16:19:05 -070010 opt.add_option('--with-tests', action='store_true', default=False,
11 dest='with_tests', help='''Build unit tests''')
Junxiao Shif7191242015-03-19 05:53:41 -070012
13def configure(conf):
14 conf.load(['compiler_cxx', 'gnu_dirs',
Junxiao Shi2222a612015-06-06 08:01:38 -070015 'default-compiler-flags', 'sphinx_build', 'boost'])
Junxiao Shif7191242015-03-19 05:53:41 -070016
17 if not os.environ.has_key('PKG_CONFIG_PATH'):
18 os.environ['PKG_CONFIG_PATH'] = ':'.join([
19 '/usr/lib/pkgconfig',
20 '/usr/local/lib/pkgconfig',
21 '/opt/local/lib/pkgconfig'])
22 conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
23 uselib_store='NDN_CXX', mandatory=True)
24
Junxiao Shi2713a3b2015-06-22 16:19:05 -070025 boost_libs = 'system iostreams regex'
26 if conf.options.with_tests:
27 conf.env['WITH_TESTS'] = 1
28 conf.define('WITH_TESTS', 1);
29 boost_libs += ' unit_test_framework'
30 conf.check_boost(lib=boost_libs)
Junxiao Shi2222a612015-06-06 08:01:38 -070031
Junxiao Shif7191242015-03-19 05:53:41 -070032 conf.recurse('tools')
33
34def build(bld):
Junxiao Shi2219a052015-05-28 02:53:48 -070035 bld.env['VERSION'] = VERSION
36
Junxiao Shif7191242015-03-19 05:53:41 -070037 bld(
38 target='core-objects',
39 name='core-objects',
40 features='cxx',
41 source=bld.path.ant_glob(['core/*.cpp']),
Junxiao Shi2713a3b2015-06-22 16:19:05 -070042 use='NDN_CXX BOOST',
Junxiao Shif7191242015-03-19 05:53:41 -070043 export_includes='.',
44 )
45
46 bld.recurse('tools')
Junxiao Shi2713a3b2015-06-22 16:19:05 -070047 bld.recurse('tests')
Junxiao Shi2219a052015-05-28 02:53:48 -070048 bld.recurse('manpages')