blob: ad201d1dbd1f78892c6640f5718e0b7acce97105 [file] [log] [blame]
jeraldabrahamf9543a42014-02-11 06:37:34 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
Jennica Guanb82cace2017-02-22 12:19:00 +08002
Jennica Guanb82cace2017-02-22 12:19:00 +08003from waflib import Utils
4import os
jeraldabrahamf9543a42014-02-11 06:37:34 -07005
Davide Pesaventobfb33ab2022-03-12 23:30:23 -05006VERSION = '0.1'
7APPNAME = 'ndn-traffic-generator'
8
jeraldabrahamf9543a42014-02-11 06:37:34 -07009def options(opt):
Alexander Afanasyev740812e2014-10-30 15:37:45 -070010 opt.load(['compiler_cxx', 'gnu_dirs'])
Jennica Guanb82cace2017-02-22 12:19:00 +080011 opt.load(['default-compiler-flags'],
12 tooldir=['.waf-tools'])
jeraldabrahamf9543a42014-02-11 06:37:34 -070013
14def configure(conf):
Alexander Afanasyev740812e2014-10-30 15:37:45 -070015 conf.load(['compiler_cxx', 'gnu_dirs',
16 'default-compiler-flags'])
Jennica Guanb82cace2017-02-22 12:19:00 +080017
Davide Pesaventobfb33ab2022-03-12 23:30:23 -050018 pkg_config_path = os.environ.get('PKG_CONFIG_PATH', f'{conf.env.LIBDIR}/pkgconfig')
19 conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.0', '--cflags', '--libs'],
20 uselib_store='NDN_CXX', pkg_config_path=pkg_config_path)
jeraldabrahamf9543a42014-02-11 06:37:34 -070021
Davide Pesavento64cafaa2018-05-24 00:50:41 -040022 conf.check_compiler_flags()
23
jeraldabraham420dbf02014-04-25 22:58:31 -070024def build(bld):
Davide Pesavento032c9802019-01-25 17:10:26 -050025 bld.program(target='ndn-traffic-client',
Davide Pesavento7eaed5c2019-01-09 20:03:43 -050026 source='src/ndn-traffic-client.cpp',
27 use='NDN_CXX')
jeraldabrahamf9543a42014-02-11 06:37:34 -070028
Davide Pesavento7eaed5c2019-01-09 20:03:43 -050029 bld.program(target='ndn-traffic-server',
30 source='src/ndn-traffic-server.cpp',
31 use='NDN_CXX')
Alexander Afanasyevfda32a32014-03-20 10:50:00 -070032
33 bld.install_files('${SYSCONFDIR}/ndn', ['ndn-traffic-client.conf.sample',
34 'ndn-traffic-server.conf.sample'])
Davide Pesaventoe5a73942019-01-26 20:54:13 -050035
36 if Utils.unversioned_sys_platform() == 'linux':
37 systemd_units = bld.path.ant_glob('systemd/*.in')
38 bld(features='subst',
39 name='systemd-units',
40 source=systemd_units,
41 target=[u.change_ext('') for u in systemd_units])