equal
deleted
inserted
replaced
23 libpath="/usr/lib64") |
23 libpath="/usr/lib64") |
24 |
24 |
25 if not conf.env['BOOST']: |
25 if not conf.env['BOOST']: |
26 conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False, |
26 conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False, |
27 "Required boost libraries not found") |
27 "Required boost libraries not found") |
|
28 |
|
29 # Add this module to the list of modules that won't be built |
|
30 # if they are enabled. |
|
31 conf.env['MODULES_NOT_BUILT'].append('openflow') |
|
32 |
28 return |
33 return |
29 |
34 |
30 if Options.options.with_openflow: |
35 if Options.options.with_openflow: |
31 if os.path.isdir(Options.options.with_openflow): |
36 if os.path.isdir(Options.options.with_openflow): |
32 conf.check_message("OpenFlow location", '', True, ("%s (given)" % Options.options.with_openflow)) |
37 conf.check_message("OpenFlow location", '', True, ("%s (given)" % Options.options.with_openflow)) |
39 del openflow_dir |
44 del openflow_dir |
40 if not conf.env['WITH_OPENFLOW']: |
45 if not conf.env['WITH_OPENFLOW']: |
41 conf.check_message("OpenFlow location", '', False) |
46 conf.check_message("OpenFlow location", '', False) |
42 conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False, |
47 conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", False, |
43 "OpenFlow not enabled (see option --with-openflow)") |
48 "OpenFlow not enabled (see option --with-openflow)") |
|
49 # Add this module to the list of modules that won't be built |
|
50 # if they are enabled. |
|
51 conf.env['MODULES_NOT_BUILT'].append('openflow') |
|
52 |
44 return |
53 return |
45 |
54 |
46 test_code = ''' |
55 test_code = ''' |
47 #include "openflow/openflow.h" |
56 #include "openflow/openflow.h" |
48 #include "openflow/nicira-ext.h" |
57 #include "openflow/nicira-ext.h" |
110 if conf.env['OPENFLOW']: |
119 if conf.env['OPENFLOW']: |
111 conf.env['ENABLE_OPENFLOW'] = True |
120 conf.env['ENABLE_OPENFLOW'] = True |
112 conf.env.append_value('CXXDEFINES', 'NS3_OPENFLOW') |
121 conf.env.append_value('CXXDEFINES', 'NS3_OPENFLOW') |
113 conf.env.append_value('CPPPATH', conf.env['CPPPATH_OPENFLOW']) |
122 conf.env.append_value('CPPPATH', conf.env['CPPPATH_OPENFLOW']) |
114 conf.env.append_value('LIBPATH', conf.env['LIBPATH_OPENFLOW']) |
123 conf.env.append_value('LIBPATH', conf.env['LIBPATH_OPENFLOW']) |
|
124 else: |
|
125 # Add this module to the list of modules that won't be built |
|
126 # if they are enabled. |
|
127 conf.env['MODULES_NOT_BUILT'].append('openflow') |
115 |
128 |
116 |
129 |
117 |
130 |
118 def build(bld): |
131 def build(bld): |
|
132 # Don't do anything for this module if openflow's not enabled. |
|
133 if 'openflow' in bld.env['MODULES_NOT_BUILT']: |
|
134 return |
|
135 |
119 # Build the Switch module |
136 # Build the Switch module |
120 obj = bld.create_ns3_module('openflow', ['internet']) |
137 obj = bld.create_ns3_module('openflow', ['internet']) |
121 obj.source = [ |
138 obj.source = [ |
122 ] |
139 ] |
123 |
140 |