forked from TommyPec/ns-3-dev-NB-IOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwscript
97 lines (81 loc) · 3.28 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
from waflib import Options
required_python_modules = [
'gtk',
'goocanvas',
'pygraphviz',
]
def configure(conf):
# If Python was explicitly disabled, then add this module to the
# list of modules that won't be built if they are enabled.
conf.env['ENABLE_PYVIZ'] = True
if not conf.check_optional_feature("python"):
conf.env['ENABLE_PYVIZ'] = False
conf.report_optional_feature("PyViz", "PyViz visualizer",
False,
"Python Bindings are needed but not enabled")
conf.env['MODULES_NOT_BUILT'].append('visualizer')
return
modules_missing = []
for pymod in required_python_modules:
try:
conf.check_python_module(pymod)
except conf.errors.ConfigurationError:
modules_missing.append(pymod)
if modules_missing:
conf.report_optional_feature("PyViz", "PyViz visualizer",
False, "Missing python modules: %s" % (', '.join(modules_missing),))
conf.env['ENABLE_PYVIZ'] = False
conf.env['MODULES_NOT_BUILT'].append('visualizer')
return
conf.report_optional_feature("PyViz", "PyViz visualizer", True, None)
def build(bld):
module = bld.create_ns3_module('visualizer', ['internet', 'wifi', 'point-to-point'])
headers = bld(features='ns3header')
headers.module = 'visualizer'
# Don't do anything more for this module if Python was explicitly
# disabled.
if not bld.env['ENABLE_PYVIZ']:
return
headers.source = []
# XXX This file was added so that static builds would work on
# Darwin, which doesn't like modules with no source files. It
# would have been better to add this module to the list
# conf.env['MODULES_NOT_BUILT'] if Python bindings were not
# enabled, but it's not possible for this module to determine in
# its configure() function if Python bindings will be enabled
# because that is done by the wscript file in bindings/python that
# is parsed after this module's wscript file is parsed.
module.source = [
'model/dummy-file-for-static-builds.cc',
]
module.features += ' pyembed'
#module.env.append_value('CXXFLAGS', module.env['shlib_CXXFLAGS'])
#module.includes = '.'
module.source.extend([
'model/pyviz.cc',
'model/visual-simulator-impl.cc',
])
headers.source.append('model/pyviz.h')
vissrc = [
'visualizer/base.py',
'visualizer/core.py',
'visualizer/higcontainer.py',
'visualizer/hud.py',
'visualizer/__init__.py',
'visualizer/svgitem.py',
]
pyviz = bld(features='py')
pyviz.source = vissrc
pyviz.install_path = '${PYTHONARCHDIR}/visualizer'
visplugin_src = [
'visualizer/plugins/interface_statistics.py',
'visualizer/plugins/ipv4_routing_table.py',
'visualizer/plugins/olsr.py',
'visualizer/plugins/show_last_packets.py',
'visualizer/plugins/wifi_intrastructure_link.py'
]
pyvizplug = bld(features='py')
pyvizplug.source = visplugin_src
pyvizplug.install_path = '${PYTHONARCHDIR}/visualizer/plugins'
bld.ns3_python_bindings()