blob: ef4989b23dc2d593771ad2602b0634c59a3ee0af [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'])
Shock Jiang0f0bc4b2015-06-22 15:11:30 -07009
Junxiao Shi2222a612015-06-06 08:01:38 -070010 opt.load(['default-compiler-flags', 'sphinx_build', 'boost'], tooldir=['.waf-tools'])
Junxiao Shi2713a3b2015-06-22 16:19:05 -070011 opt.add_option('--with-tests', action='store_true', default=False,
12 dest='with_tests', help='''Build unit tests''')
Shock Jiang0f0bc4b2015-06-22 15:11:30 -070013 opt.recurse("tools")
Junxiao Shif7191242015-03-19 05:53:41 -070014
15def configure(conf):
16 conf.load(['compiler_cxx', 'gnu_dirs',
Junxiao Shi2222a612015-06-06 08:01:38 -070017 'default-compiler-flags', 'sphinx_build', 'boost'])
Junxiao Shif7191242015-03-19 05:53:41 -070018
19 if not os.environ.has_key('PKG_CONFIG_PATH'):
20 os.environ['PKG_CONFIG_PATH'] = ':'.join([
21 '/usr/lib/pkgconfig',
22 '/usr/local/lib/pkgconfig',
23 '/opt/local/lib/pkgconfig'])
24 conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
25 uselib_store='NDN_CXX', mandatory=True)
26
Junxiao Shi2713a3b2015-06-22 16:19:05 -070027 boost_libs = 'system iostreams regex'
28 if conf.options.with_tests:
29 conf.env['WITH_TESTS'] = 1
30 conf.define('WITH_TESTS', 1);
31 boost_libs += ' unit_test_framework'
32 conf.check_boost(lib=boost_libs)
Junxiao Shi2222a612015-06-06 08:01:38 -070033
Junxiao Shif7191242015-03-19 05:53:41 -070034 conf.recurse('tools')
35
36def build(bld):
Junxiao Shi2219a052015-05-28 02:53:48 -070037 bld.env['VERSION'] = VERSION
38
Junxiao Shif7191242015-03-19 05:53:41 -070039 bld(
40 target='core-objects',
41 name='core-objects',
42 features='cxx',
43 source=bld.path.ant_glob(['core/*.cpp']),
Junxiao Shi2713a3b2015-06-22 16:19:05 -070044 use='NDN_CXX BOOST',
Junxiao Shif7191242015-03-19 05:53:41 -070045 export_includes='.',
46 )
47
48 bld.recurse('tools')
Junxiao Shi2713a3b2015-06-22 16:19:05 -070049 bld.recurse('tests')
Junxiao Shi2219a052015-05-28 02:53:48 -070050 bld.recurse('manpages')