blob: a1fbfb742bad373f76ab6f803036014f6c84a6ee [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 Afanasyev9d313d42011-11-25 13:36:15 -080033 'point-to-point-layout', 'netanim']
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 Afanasyevb3e4b852011-12-23 15:58:20 -080060 "helper/ccnx-trace-helper.h",
Alexander Afanasyevc4f88282012-01-03 11:27:20 -080061 "helper/tracers/ipv4-app-tracer.h",
Alexander Afanasyev7e71c752012-01-25 21:40:39 -080062 "helper/tracers/ipv4-l3-tracer.h",
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080063 "helper/tracers/ccnx-app-tracer.h",
64 "helper/tracers/ccnx-l3-tracer.h",
Alexander Afanasyeve4c2ece2012-01-11 10:44:40 -080065 "helper/tracers/ccnx-consumer-window-tracer.h",
Alexander Afanasyeve9c9d722012-01-19 16:59:30 -080066 "helper/tracers/ccnx-path-weight-tracer.h",
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080067 "helper/ccnx-face-container.h",
Ilya Moiseenko1762af72011-07-18 16:43:10 -070068
Alexander Afanasyev07827182011-12-13 01:07:32 -080069 "apps/ccnx-app.h",
Alexander Afanasyev07827182011-12-13 01:07:32 -080070
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 Afanasyeve9c9d722012-01-19 16:59:30 -080078 "model/ccnx-path-stretch-tag.h",
Alexander Afanasyev07827182011-12-13 01:07:32 -080079 "model/ccnx-fib.h",
Alexander Afanasyev4975f732011-12-20 17:52:19 -080080
81 "utils/spring-mobility-model.h",
82 "utils/spring-mobility-helper.h",
Alexander Afanasyevb3e4b852011-12-23 15:58:20 -080083
Alexander Afanasyev07827182011-12-13 01:07:32 -080084 "model/rocketfuel-weights-reader.h",
85 "model/annotated-topology-reader.h",
Alexander Afanasyevb7ad2322012-01-17 22:54:49 -080086
87 "model/batches.h"
Alexander Afanasyev07827182011-12-13 01:07:32 -080088 ]
Alexander Afanasyev3b936292011-09-20 08:45:36 -070089
90 tests.source = bld.path.ant_glob('test/*.cc');
91
Alexander Afanasyev4ac503d2011-10-28 15:45:39 -070092 if True or bld.env['ENABLE_EXAMPLES']:
Alexander Afanasyeve1a065d2012-01-10 15:55:14 -080093 obj = bld.create_ns3_program('ccnx-routing-simple', ['NDNabstraction'])
Alexander Afanasyev5b433862011-10-31 15:25:07 -070094 obj.source = 'examples/ccnx-routing-simple.cc'
95
Alexander Afanasyeve1a065d2012-01-10 15:55:14 -080096 obj = bld.create_ns3_program('ccnx-grid', ['NDNabstraction'])
Ilya Moiseenkoc9266042011-11-02 17:49:21 -070097 obj.source = 'examples/ccnx-grid.cc'
Alexander Afanasyev4ac503d2011-10-28 15:45:39 -070098
Alexander Afanasyeve1a065d2012-01-10 15:55:14 -080099 obj = bld.create_ns3_program('annotated-topology', ['NDNabstraction'])
Ilya Moiseenko00b30482011-11-15 17:58:00 -0800100 obj.source = 'examples/annotated-topology-read-example.cc'
101
Alexander Afanasyev09374c02011-12-08 13:54:56 -0800102 obj = bld.create_ns3_program('ccnx-sprint-topology', ['NDNabstraction'])
Ilya Moiseenko58d26672011-12-08 13:48:06 -0800103 obj.source = 'examples/sprint-topology.cc'
104
Alexander Afanasyev09374c02011-12-08 13:54:56 -0800105 obj = bld.create_ns3_program('ccnx-abilene-topology', ['NDNabstraction'])
Ilya Moiseenko58d26672011-12-08 13:48:06 -0800106 obj.source = 'examples/abilene-topology.cc'
Alexander Afanasyevc39f0b42011-11-28 12:51:12 -0800107
Ilya Moiseenko6f5e8fa2011-12-16 15:20:19 -0800108 obj = bld.create_ns3_program('ccnx-synthetic-topology', ['NDNabstraction'])
109 obj.source = 'examples/synthetic-topology.cc'
110
Alexander Afanasyev1d2642a2012-01-02 16:20:05 -0800111 obj = bld.create_ns3_program('congestion-pop', ['NDNabstraction'])
112 obj.source = 'examples/congestion-pop.cc'
113
Alexander Afanasyev6c678382012-01-22 16:15:41 -0800114 obj = bld.create_ns3_program('link-failure', ['NDNabstraction'])
115 obj.source = 'examples/link-failure-sprint.cc'
Ilya Moiseenko1a3164d2012-01-09 14:44:45 -0800116
Alexander Afanasyev812f7ab2012-01-24 11:08:04 -0800117 obj = bld.create_ns3_program('link-failure-base', ['NDNabstraction'])
118 obj.source = 'examples/link-failure-base.cc'
119
Ilya Moiseenko2063c882012-01-11 19:59:32 -0800120 obj = bld.create_ns3_program('blackhole-sprint', ['NDNabstraction'])
121 obj.source = 'examples/blackhole-sprint.cc'
Alexander Afanasyeved78b632012-01-25 19:26:43 -0800122
123 obj = bld.create_ns3_program('congestion-zoom', ['NDNabstraction'])
124 obj.source = 'examples/congestion-zoom.cc'
Ilya Moiseenko1a3164d2012-01-09 14:44:45 -0800125
Alexander Afanasyev18750bb2012-02-02 23:11:30 -0800126 obj = bld.create_ns3_program('vanet-ccnx', ['NDNabstraction', 'highway-mobility'])
127 obj.source = 'examples/vanet-ccnx.cc'
128
Alexander Afanasyev07827182011-12-13 01:07:32 -0800129 bld.ns3_python_bindings()