Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- | 1 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
2 import os | 2 import os |
3 import Options | 3 import Options |
4 | 4 |
5 | 5 |
6 def options(opt): | 6 def options(opt): |
7 opt.add_option('--with-brite', | 7 opt.add_option('--with-brite', |
8 help=('Use BRITE integration support, given by the indicated path,' | 8 help=('Use BRITE integration support, given by the indicated path,' |
9 ' to allow the use of the BRITE topology generator'), | 9 ' to allow the use of the BRITE topology generator'), |
10 default=False, dest='with_brite') | 10 default=False, dest='with_brite') |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 | 57 |
58 conf.env['BRITE'] = conf.check(fragment=test_code, lib='brite', libpath=conf .env['LIBPATH_BRITE'], use='BRITE DL') | 58 conf.env['BRITE'] = conf.check(fragment=test_code, lib='brite', libpath=conf .env['LIBPATH_BRITE'], use='BRITE DL') |
59 conf.report_optional_feature("brite", "BRITE Integration", | 59 conf.report_optional_feature("brite", "BRITE Integration", |
60 conf.env['BRITE'], "BRITE library not found") | 60 conf.env['BRITE'], "BRITE library not found") |
61 | 61 |
62 if conf.env['BRITE']: | 62 if conf.env['BRITE']: |
63 conf.env['ENABLE_BRITE'] = True | 63 conf.env['ENABLE_BRITE'] = True |
64 conf.env.append_value('CXXDEFINES', 'NS3_BRITE') | 64 conf.env.append_value('CXXDEFINES', 'NS3_BRITE') |
65 conf.env.append_value('CPPPATH', conf.env['CPPPATH_BRITE']) | 65 conf.env.append_value('CPPPATH', conf.env['CPPPATH_BRITE']) |
66 | 66 |
67 def build(bld): | 67 def build(bld): |
Tom Henderson
2012/11/16 23:27:02
build() is defined twice. Delete from line 67-107
| |
68 | 68 |
69 module = bld.create_ns3_module('brite', ['network', 'core']) | 69 module = bld.create_ns3_module('brite', ['network', 'core', 'internet', 'poi nt-to-point']) |
Tom Henderson
2012/11/16 23:27:02
brite depends on 'internet' also, and point-to-poi
| |
70 module.source = [ | 70 module.source = [ |
71 ] | |
72 | |
73 module_test = bld.create_ns3_module_test_library('brite') | |
74 module_test.source = [ | |
71 ] | 75 ] |
72 | 76 |
73 if bld.env['BRITE'] and bld.env['DL']: | 77 if bld.env['BRITE'] and bld.env['DL']: |
74 module.uselib = 'BRITE DL' | 78 module.uselib = 'BRITE DL' |
75 | 79 |
76 headers = bld.new_task_gen(features=['ns3header']) | 80 headers = bld.new_task_gen(features=['ns3header']) |
77 headers.module = 'brite' | 81 headers.module = 'brite' |
78 headers.source = [ | 82 headers.source = [ |
79 ] | 83 ] |
80 | 84 |
81 if bld.env['ENABLE_BRITE']: | 85 if bld.env['ENABLE_BRITE']: |
82 module.source.append ('helper/brite-topology-helper.cc') | 86 module.source.append ('helper/brite-topology-helper.cc') |
83 headers.source.append ('helper/brite-topology-helper.h') | 87 headers.source.append ('helper/brite-topology-helper.h') |
88 module_test.source.append('test/brite-test-topology.cc') | |
84 | 89 |
85 if bld.env['ENABLE_EXAMPLES'] and bld.env['ENABLE_BRITE']: | 90 if bld.env['ENABLE_EXAMPLES'] and bld.env['ENABLE_BRITE']: |
86 bld.add_subdirs('examples') | 91 bld.add_subdirs('examples') |
87 | |
88 for brite_module in ['.']: | |
89 conf.env.append_value('NS3_MODULE_PATH', | |
90 os.path.abspath(os.path.join(conf.env['WITH_BRITE' ], brite_module))) | |
91 | |
92 conf.env['CPPPATH_BRITE'] = [ | |
93 os.path.abspath(os.path.join(conf.env['WITH_BRITE'],'.')), | |
94 os.path.abspath(os.path.join(conf.env['WITH_BRITE'],'Models')) | |
95 ] | |
96 conf.env['LIBPATH_BRITE'] = [os.path.abspath(os.path.join(conf.env['WITH_BRI TE'], '.'))] | |
97 | |
98 conf.env['BRITE'] = conf.check(fragment=test_code, lib='brite', uselib='BRIT E DL') | |
99 conf.report_optional_feature("brite", "BRITE Integration", | |
100 conf.env['BRITE'], "BRITE library not found") | |
101 | |
102 if conf.env['BRITE']: | |
103 conf.env['ENABLE_BRITE'] = True | |
104 conf.env.append_value('CXXDEFINES', 'NS3_BRITE') | |
105 conf.env.append_value('CPPPATH', conf.env['CPPPATH_BRITE']) | |
106 | |
107 | |
108 def build(bld): | |
109 | |
110 module = bld.create_ns3_module('brite', ['network', 'core']) | |
111 module.source = [ | |
112 ] | |
Tom Henderson
2012/11/16 23:27:02
You need to add test library here:
+ module_test
| |
113 | |
114 if bld.env['BRITE'] and bld.env['DL']: | |
115 module.uselib = 'BRITE DL' | |
116 | |
117 headers = bld.new_task_gen(features=['ns3header']) | |
118 headers.module = 'brite' | |
119 headers.source = [ | |
120 ] | |
121 | |
122 if bld.env['ENABLE_BRITE']: | |
123 module.source.append ('helper/brite-topology-helper.cc') | |
124 headers.source.append ('helper/brite-topology-helper.h') | |
Tom Henderson
2012/11/16 23:27:02
You need to add test code here:
+ module_test
| |
125 | |
126 if bld.env['ENABLE_EXAMPLES'] and bld.env['ENABLE_BRITE']: | |
127 bld.add_subdirs('examples') | |
LEFT | RIGHT |