blob: 00eec0e2b2f30c7dd15b13d3566992f811816a17 [file] [log] [blame]
Ilya Moiseenko1762af72011-07-18 16:43:10 -07001## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
Alexander Afanasyev45b92d42011-08-14 23:11:38 -07003import os
4import Logs
5import Utils
Alexander Afanasyev2a5df202011-08-15 22:39:05 -07006import Options
7
Alexander Afanasyev9de011f2011-11-11 00:55:05 -08008from waflib.Errors import WafError
9
Alexander Afanasyev3b936292011-09-20 08:45:36 -070010def options(opt):
11 opt.tool_options('boost', tooldir=["waf-tools"])
Alexander Afanasyev2a5df202011-08-15 22:39:05 -070012
13def configure(conf):
Alexander Afanasyev3b936292011-09-20 08:45:36 -070014 try:
15 conf.check_tool('boost')
16 conf.check_boost(lib = 'iostreams')
17 except WafError:
18 conf.env['LIB_BOOST'] = []
19
20 if not conf.env['LIB_BOOST']:
Alexander Afanasyev2a5df202011-08-15 22:39:05 -070021 conf.report_optional_feature("ndn-abstract", "NDN abstraction", False,
22 "Required boost libraries not found")
23 conf.env['ENABLE_NDN_ABSTRACT']=False;
Alexander Afanasyev3b936292011-09-20 08:45:36 -070024 conf.env['MODULES_NOT_BUILT'].append('NDNabstraction')
Alexander Afanasyev2a5df202011-08-15 22:39:05 -070025 return
26
27 conf.env['ENABLE_NDN_ABSTRACT']=True;
28
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070029
Ilya Moiseenko1762af72011-07-18 16:43:10 -070030def build(bld):
Alexander Afanasyev3bea3702011-11-16 10:27:18 -080031 deps = ['core', 'network', 'point-to-point',
32 'topology-read','internet','applications',
Alexander Afanasyevf04d4512012-02-14 18:42:47 -080033 'point-to-point-layout']
Alexander Afanasyev3bea3702011-11-16 10:27:18 -080034 if bld.env['ENABLE_PYTHON_BINDINGS']:
35 deps.append ('visualizer')
36
37 module = bld.create_ns3_module ('NDNabstraction', deps)
Alexander Afanasyev0ab833e2011-08-18 15:49:13 -070038 module.uselib = 'BOOST BOOST_IOSTREAMS'
Alexander Afanasyev404c0792011-08-09 17:09:59 -070039
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070040 tests = bld.create_ns3_module_test_library('NDNabstraction')
Alexander Afanasyev3b936292011-09-20 08:45:36 -070041 headers = bld.new_task_gen(features=['ns3header'])
Ilya Moiseenko1762af72011-07-18 16:43:10 -070042 headers.module = 'NDNabstraction'
Alexander Afanasyev2a5df202011-08-15 22:39:05 -070043
44 if not bld.env['ENABLE_NDN_ABSTRACT']:
Alexander Afanasyev3b936292011-09-20 08:45:36 -070045 bld.env['MODULES_NOT_BUILT'].append('NDNabstraction')
Alexander Afanasyev2a5df202011-08-15 22:39:05 -070046 return
47
Alexander Afanasyev3b936292011-09-20 08:45:36 -070048 module.source = bld.path.ant_glob(['model/*.cc', 'apps/*.cc',
Alexander Afanasyev07827182011-12-13 01:07:32 -080049 'utils/*.cc',
50 'helper/*.cc',
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080051 'helper/tracers/*.cc',
Alexander Afanasyev07827182011-12-13 01:07:32 -080052 'helper/ccnb-parser/*.cc',
53 'helper/ccnb-parser/visitors/*.cc',
54 'helper/ccnb-parser/syntax-tree/*.cc'])
Alexander Afanasyev2a5df202011-08-15 22:39:05 -070055
Alexander Afanasyev07827182011-12-13 01:07:32 -080056 headers.source = [
57 "helper/ccnx-stack-helper.h",
Alexander Afanasyev4975f732011-12-20 17:52:19 -080058 "helper/ccnx-app-helper.h",
Alexander Afanasyevf9f4eb02011-12-16 01:51:14 -080059 "helper/ccnx-header-helper.h",
Alexander Afanasyevc1e33eb2012-05-31 12:13:17 -070060 # "helper/ccnx-trace-helper.h",
61 # "helper/tracers/ipv4-app-tracer.h",
62 # "helper/tracers/ipv4-l3-tracer.h",
63 # "helper/tracers/ccnx-app-tracer.h",
64 # "helper/tracers/ccnx-l3-tracer.h",
65 # "helper/tracers/ccnx-consumer-window-tracer.h",
66 # "helper/tracers/ccnx-path-weight-tracer.h",
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080067 "helper/ccnx-face-container.h",
Alexander Afanasyeva5abcd92012-04-17 13:34:43 -070068 "helper/ccnx-global-routing-helper.h",
Ilya Moiseenko1762af72011-07-18 16:43:10 -070069
Alexander Afanasyev07827182011-12-13 01:07:32 -080070 "apps/ccnx-app.h",
Alexander Afanasyev07827182011-12-13 01:07:32 -080071
Alexander Afanasyev07827182011-12-13 01:07:32 -080072 "model/ccnx.h",
Alexander Afanasyev7f3e49e2012-04-30 00:17:07 -070073 "model/ccnx-pit.h",
74 "model/ccnx-pit-entry.h",
75 "model/ccnx-pit-entry-incoming-face.h",
76 "model/ccnx-pit-entry-outgoing-face.h",
Alexander Afanasyev161a5c42012-04-17 15:14:04 -070077 "model/ccnx-fib.h",
Alexander Afanasyev07827182011-12-13 01:07:32 -080078 "model/ccnx-face.h",
Alexander Afanasyev07827182011-12-13 01:07:32 -080079 "model/ccnx-interest-header.h",
80 "model/ccnx-content-object-header.h",
81 "model/ccnx-name-components.h",
Alexander Afanasyev161a5c42012-04-17 15:14:04 -070082 "model/ccnx-name-components-hash-helper.h",
Alexander Afanasyev4975f732011-12-20 17:52:19 -080083
Alexander Afanasyev161a5c42012-04-17 15:14:04 -070084 "utils/batches.h",
Alexander Afanasyevc1e33eb2012-05-31 12:13:17 -070085 # "utils/weights-path-stretch-tag.h",
86 # "utils/spring-mobility-model.h",
87 # "utils/spring-mobility-helper.h",
88 # "utils/rocketfuel-weights-reader.h",
89 # "utils/annotated-topology-reader.h",
Alexander Afanasyev07827182011-12-13 01:07:32 -080090 ]
Alexander Afanasyev3b936292011-09-20 08:45:36 -070091
92 tests.source = bld.path.ant_glob('test/*.cc');
93
Alexander Afanasyevf04d4512012-02-14 18:42:47 -080094 if bld.env.ENABLE_EXAMPLES:
95 bld.add_subdirs('examples')
Lucas64b85362012-01-30 16:28:37 -080096
Alexander Afanasyev07827182011-12-13 01:07:32 -080097 bld.ns3_python_bindings()