Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 1 | ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 3 | import os |
| 4 | import Logs |
| 5 | import Utils |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 6 | import Options |
| 7 | |
Alexander Afanasyev | 9de011f | 2011-11-11 00:55:05 -0800 | [diff] [blame] | 8 | from waflib.Errors import WafError |
| 9 | |
Alexander Afanasyev | 3b93629 | 2011-09-20 08:45:36 -0700 | [diff] [blame] | 10 | def options(opt): |
| 11 | opt.tool_options('boost', tooldir=["waf-tools"]) |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 12 | |
| 13 | def configure(conf): |
Alexander Afanasyev | 3b93629 | 2011-09-20 08:45:36 -0700 | [diff] [blame] | 14 | 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 Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 21 | conf.report_optional_feature("ndn-abstract", "NDN abstraction", False, |
| 22 | "Required boost libraries not found") |
| 23 | conf.env['ENABLE_NDN_ABSTRACT']=False; |
Alexander Afanasyev | 3b93629 | 2011-09-20 08:45:36 -0700 | [diff] [blame] | 24 | conf.env['MODULES_NOT_BUILT'].append('NDNabstraction') |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 25 | return |
| 26 | |
| 27 | conf.env['ENABLE_NDN_ABSTRACT']=True; |
| 28 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 29 | |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 30 | def build(bld): |
Alexander Afanasyev | 3bea370 | 2011-11-16 10:27:18 -0800 | [diff] [blame] | 31 | deps = ['core', 'network', 'point-to-point', |
| 32 | 'topology-read','internet','applications', |
Alexander Afanasyev | 9d313d4 | 2011-11-25 13:36:15 -0800 | [diff] [blame] | 33 | 'point-to-point-layout', 'netanim'] |
Alexander Afanasyev | 3bea370 | 2011-11-16 10:27:18 -0800 | [diff] [blame] | 34 | if bld.env['ENABLE_PYTHON_BINDINGS']: |
| 35 | deps.append ('visualizer') |
| 36 | |
| 37 | module = bld.create_ns3_module ('NDNabstraction', deps) |
Alexander Afanasyev | 0ab833e | 2011-08-18 15:49:13 -0700 | [diff] [blame] | 38 | module.uselib = 'BOOST BOOST_IOSTREAMS' |
Alexander Afanasyev | 404c079 | 2011-08-09 17:09:59 -0700 | [diff] [blame] | 39 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 40 | tests = bld.create_ns3_module_test_library('NDNabstraction') |
Alexander Afanasyev | 3b93629 | 2011-09-20 08:45:36 -0700 | [diff] [blame] | 41 | headers = bld.new_task_gen(features=['ns3header']) |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 42 | headers.module = 'NDNabstraction' |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 43 | |
| 44 | if not bld.env['ENABLE_NDN_ABSTRACT']: |
Alexander Afanasyev | 3b93629 | 2011-09-20 08:45:36 -0700 | [diff] [blame] | 45 | bld.env['MODULES_NOT_BUILT'].append('NDNabstraction') |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 46 | return |
| 47 | |
Alexander Afanasyev | 3b93629 | 2011-09-20 08:45:36 -0700 | [diff] [blame] | 48 | module.source = bld.path.ant_glob(['model/*.cc', 'apps/*.cc', |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 49 | 'utils/*.cc', |
| 50 | 'helper/*.cc', |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 51 | 'helper/tracers/*.cc', |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 52 | 'helper/ccnb-parser/*.cc', |
| 53 | 'helper/ccnb-parser/visitors/*.cc', |
| 54 | 'helper/ccnb-parser/syntax-tree/*.cc']) |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 55 | |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 56 | headers.source = [ |
| 57 | "helper/ccnx-stack-helper.h", |
Alexander Afanasyev | 4975f73 | 2011-12-20 17:52:19 -0800 | [diff] [blame] | 58 | "helper/ccnx-app-helper.h", |
Alexander Afanasyev | f9f4eb0 | 2011-12-16 01:51:14 -0800 | [diff] [blame] | 59 | "helper/ccnx-header-helper.h", |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 60 | "helper/ccnx-trace-helper.h", |
Alexander Afanasyev | c4f8828 | 2012-01-03 11:27:20 -0800 | [diff] [blame] | 61 | "helper/tracers/ipv4-app-tracer.h", |
Alexander Afanasyev | 7e71c75 | 2012-01-25 21:40:39 -0800 | [diff] [blame] | 62 | "helper/tracers/ipv4-l3-tracer.h", |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 63 | "helper/tracers/ccnx-app-tracer.h", |
| 64 | "helper/tracers/ccnx-l3-tracer.h", |
Alexander Afanasyev | e4c2ece | 2012-01-11 10:44:40 -0800 | [diff] [blame] | 65 | "helper/tracers/ccnx-consumer-window-tracer.h", |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 66 | "helper/tracers/ccnx-path-weight-tracer.h", |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 67 | "helper/ccnx-face-container.h", |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 68 | |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 69 | "apps/ccnx-app.h", |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 70 | |
| 71 | "model/hash-helper.h", |
| 72 | "model/ccnx.h", |
| 73 | "model/ccnx-face.h", |
| 74 | |
| 75 | "model/ccnx-interest-header.h", |
| 76 | "model/ccnx-content-object-header.h", |
| 77 | "model/ccnx-name-components.h", |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 78 | "model/ccnx-path-stretch-tag.h", |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 79 | "model/ccnx-fib.h", |
Alexander Afanasyev | 4975f73 | 2011-12-20 17:52:19 -0800 | [diff] [blame] | 80 | |
| 81 | "utils/spring-mobility-model.h", |
| 82 | "utils/spring-mobility-helper.h", |
Alexander Afanasyev | b3e4b85 | 2011-12-23 15:58:20 -0800 | [diff] [blame] | 83 | |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 84 | "model/rocketfuel-weights-reader.h", |
| 85 | "model/annotated-topology-reader.h", |
Alexander Afanasyev | b7ad232 | 2012-01-17 22:54:49 -0800 | [diff] [blame] | 86 | |
| 87 | "model/batches.h" |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 88 | ] |
Alexander Afanasyev | 3b93629 | 2011-09-20 08:45:36 -0700 | [diff] [blame] | 89 | |
| 90 | tests.source = bld.path.ant_glob('test/*.cc'); |
| 91 | |
Alexander Afanasyev | 4ac503d | 2011-10-28 15:45:39 -0700 | [diff] [blame] | 92 | if True or bld.env['ENABLE_EXAMPLES']: |
Alexander Afanasyev | e1a065d | 2012-01-10 15:55:14 -0800 | [diff] [blame] | 93 | obj = bld.create_ns3_program('ccnx-routing-simple', ['NDNabstraction']) |
Alexander Afanasyev | 5b43386 | 2011-10-31 15:25:07 -0700 | [diff] [blame] | 94 | obj.source = 'examples/ccnx-routing-simple.cc' |
| 95 | |
Alexander Afanasyev | e1a065d | 2012-01-10 15:55:14 -0800 | [diff] [blame] | 96 | obj = bld.create_ns3_program('ccnx-grid', ['NDNabstraction']) |
Ilya Moiseenko | c926604 | 2011-11-02 17:49:21 -0700 | [diff] [blame] | 97 | obj.source = 'examples/ccnx-grid.cc' |
Alexander Afanasyev | 4ac503d | 2011-10-28 15:45:39 -0700 | [diff] [blame] | 98 | |
Alexander Afanasyev | e1a065d | 2012-01-10 15:55:14 -0800 | [diff] [blame] | 99 | obj = bld.create_ns3_program('annotated-topology', ['NDNabstraction']) |
Ilya Moiseenko | 00b3048 | 2011-11-15 17:58:00 -0800 | [diff] [blame] | 100 | obj.source = 'examples/annotated-topology-read-example.cc' |
| 101 | |
Alexander Afanasyev | 09374c0 | 2011-12-08 13:54:56 -0800 | [diff] [blame] | 102 | obj = bld.create_ns3_program('ccnx-sprint-topology', ['NDNabstraction']) |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 103 | obj.source = 'examples/sprint-topology.cc' |
| 104 | |
Alexander Afanasyev | 09374c0 | 2011-12-08 13:54:56 -0800 | [diff] [blame] | 105 | obj = bld.create_ns3_program('ccnx-abilene-topology', ['NDNabstraction']) |
Ilya Moiseenko | 58d2667 | 2011-12-08 13:48:06 -0800 | [diff] [blame] | 106 | obj.source = 'examples/abilene-topology.cc' |
Alexander Afanasyev | c39f0b4 | 2011-11-28 12:51:12 -0800 | [diff] [blame] | 107 | |
Ilya Moiseenko | 6f5e8fa | 2011-12-16 15:20:19 -0800 | [diff] [blame] | 108 | obj = bld.create_ns3_program('ccnx-synthetic-topology', ['NDNabstraction']) |
| 109 | obj.source = 'examples/synthetic-topology.cc' |
| 110 | |
Alexander Afanasyev | 1d2642a | 2012-01-02 16:20:05 -0800 | [diff] [blame] | 111 | obj = bld.create_ns3_program('congestion-pop', ['NDNabstraction']) |
| 112 | obj.source = 'examples/congestion-pop.cc' |
| 113 | |
Alexander Afanasyev | 6c67838 | 2012-01-22 16:15:41 -0800 | [diff] [blame] | 114 | obj = bld.create_ns3_program('link-failure', ['NDNabstraction']) |
| 115 | obj.source = 'examples/link-failure-sprint.cc' |
Ilya Moiseenko | 1a3164d | 2012-01-09 14:44:45 -0800 | [diff] [blame] | 116 | |
Alexander Afanasyev | 812f7ab | 2012-01-24 11:08:04 -0800 | [diff] [blame] | 117 | obj = bld.create_ns3_program('link-failure-base', ['NDNabstraction']) |
| 118 | obj.source = 'examples/link-failure-base.cc' |
| 119 | |
Ilya Moiseenko | 2063c88 | 2012-01-11 19:59:32 -0800 | [diff] [blame] | 120 | obj = bld.create_ns3_program('blackhole-sprint', ['NDNabstraction']) |
| 121 | obj.source = 'examples/blackhole-sprint.cc' |
Alexander Afanasyev | ed78b63 | 2012-01-25 19:26:43 -0800 | [diff] [blame] | 122 | |
| 123 | obj = bld.create_ns3_program('congestion-zoom', ['NDNabstraction']) |
| 124 | obj.source = 'examples/congestion-zoom.cc' |
Ilya Moiseenko | 1a3164d | 2012-01-09 14:44:45 -0800 | [diff] [blame] | 125 | |
Alexander Afanasyev | 18750bb | 2012-02-02 23:11:30 -0800 | [diff] [blame] | 126 | obj = bld.create_ns3_program('vanet-ccnx', ['NDNabstraction', 'highway-mobility']) |
| 127 | obj.source = 'examples/vanet-ccnx.cc' |
| 128 | |
Alexander Afanasyev | 0782718 | 2011-12-13 01:07:32 -0800 | [diff] [blame] | 129 | bld.ns3_python_bindings() |