86 if Options.options.python_disable: |
86 if Options.options.python_disable: |
87 conf.report_optional_feature("python", "Python Bindings", False, |
87 conf.report_optional_feature("python", "Python Bindings", False, |
88 "disabled by user request") |
88 "disabled by user request") |
89 return |
89 return |
90 |
90 |
|
91 enabled_modules = list(conf.env['NS3_ENABLED_MODULES']) |
|
92 enabled_modules.sort() |
|
93 available_modules = list(conf.env['NS3_MODULES']) |
|
94 available_modules.sort() |
|
95 all_modules_enabled = (enabled_modules == available_modules) |
|
96 |
91 conf.check_tool('misc') |
97 conf.check_tool('misc') |
92 |
98 |
93 if sys.platform == 'cygwin': |
99 if sys.platform == 'cygwin': |
94 conf.report_optional_feature("python", "Python Bindings", False, |
100 conf.report_optional_feature("python", "Python Bindings", False, |
95 "unsupported platform 'cygwin'") |
101 "unsupported platform 'cygwin'") |
202 if conf.env['PYTHON_BINDINGS_APIDEFS'] is None: |
208 if conf.env['PYTHON_BINDINGS_APIDEFS'] is None: |
203 conf.report_optional_feature("python", "Python Bindings", False, |
209 conf.report_optional_feature("python", "Python Bindings", False, |
204 "No apidefs are available that can be used in this system") |
210 "No apidefs are available that can be used in this system") |
205 return |
211 return |
206 |
212 |
|
213 |
|
214 conf.env['BINDINGS_TYPE'] = Options.options.bindings_type |
|
215 |
|
216 if not all_modules_enabled: |
|
217 if conf.env['BINDINGS_TYPE'] == 'both': |
|
218 conf.env['BINDINGS_TYPE'] = 'modular' |
|
219 elif conf.env['BINDINGS_TYPE'] == 'monolithic': |
|
220 conf.report_optional_feature("python", "Python Bindings", False, "Monolithic python bindings need all ns-3 modules to be enabled") |
|
221 return |
|
222 |
207 ## If all has gone well, we finally enable the Python bindings |
223 ## If all has gone well, we finally enable the Python bindings |
208 conf.env['ENABLE_PYTHON_BINDINGS'] = True |
224 conf.env['ENABLE_PYTHON_BINDINGS'] = True |
209 conf.report_optional_feature("python", "Python Bindings", True, None) |
225 conf.report_optional_feature("python", "Python Bindings", True, None) |
210 |
226 |
211 conf.env['BINDINGS_TYPE'] = Options.options.bindings_type |
|
212 if conf.env['BINDINGS_TYPE'] == 'both': |
227 if conf.env['BINDINGS_TYPE'] == 'both': |
213 msg = "monolithic and modular" |
228 msg = "monolithic and modular" |
214 else: |
229 else: |
215 msg = conf.env['BINDINGS_TYPE'] |
230 msg = conf.env['BINDINGS_TYPE'] |
216 conf.check_message_custom('type of bindings to build', '', msg) |
231 conf.check_message_custom('type of bindings to build', '', msg) |