|
13 |
run_command([sys.executable, 'scons.py']) |
13 |
run_command([sys.executable, 'scons.py']) |
14 |
|
14 |
|
15 |
|
15 |
|
|
|
16 |
def build_netanim(qmakepath): |
17 |
qmake = 'qmake' |
18 |
if qmakepath: |
19 |
qmake = qmakepath |
20 |
try: |
21 |
if sys.platform in ['darwin']: |
22 |
run_command([qmake, '-spec', 'macx-g++', 'NetAnim.pro']) |
23 |
else: |
24 |
run_command([qmake, 'NetAnim.pro']) |
25 |
run_command(['make']) |
26 |
except OSError: |
27 |
print "Error building NetAnim. Ensure the path to qmake is correct" |
28 |
print "Note: Some systems use qmake-qt4 instead of qmake" |
29 |
print "Skipping NetAnim ...." |
30 |
pass |
31 |
except: |
32 |
print "Error building NetAnim." |
33 |
print "Skipping NetAnim ...." |
34 |
pass |
35 |
|
16 |
def build_ns3(config, build_examples, build_tests, args, build_options): |
36 |
def build_ns3(config, build_examples, build_tests, args, build_options): |
17 |
cmd = [sys.executable, "waf", "configure"] + args |
37 |
cmd = [sys.executable, "waf", "configure"] + args |
18 |
|
38 |
|
|
66 |
parser.add_option('--disable-nsc', |
86 |
parser.add_option('--disable-nsc', |
67 |
help=("Don't try to build NSC (built by default)"), action="store_true", default=False, |
87 |
help=("Don't try to build NSC (built by default)"), action="store_true", default=False, |
68 |
dest='disable_nsc') |
88 |
dest='disable_nsc') |
|
|
89 |
parser.add_option('--disable-netanim', |
90 |
help=("Don't try to build NetAnim (built by default)"), action="store_true", default=False, |
91 |
dest='disable_netanim') |
92 |
parser.add_option('--qmake-path', |
93 |
help=("Provide absolute path to qmake executable for NetAnim"), action="store", default='qmake', |
94 |
dest='qmake_path') |
69 |
parser.add_option('--enable-examples', |
95 |
parser.add_option('--enable-examples', |
70 |
help=("Do try to build examples (not built by default)"), action="store_true", default=False, |
96 |
help=("Do try to build examples (not built by default)"), action="store_true", default=False, |
71 |
dest='enable_examples') |
97 |
dest='enable_examples') |
|
112 |
os.chdir(cwd) |
138 |
os.chdir(cwd) |
113 |
print "Leaving directory `%s'" % nsc_dir |
139 |
print "Leaving directory `%s'" % nsc_dir |
114 |
|
140 |
|
|
|
141 |
if options.disable_netanim: |
142 |
print "# Skip NetAnimC (by user request)" |
143 |
for node in config.getElementsByTagName("netanim"): |
144 |
config.documentElement.removeChild(node) |
145 |
elif sys.platform in ['cygwin', 'win32']: |
146 |
print "# Skip NetAnim (platform not supported)" |
147 |
else: |
148 |
netanim_config_elems = config.getElementsByTagName("netanim") |
149 |
if netanim_config_elems: |
150 |
netanim_config, = netanim_config_elems |
151 |
netanim_dir = netanim_config.getAttribute("dir") |
152 |
print "# Build NetAnim" |
153 |
os.chdir(netanim_dir) |
154 |
print "Entering directory `%s'" % netanim_dir |
155 |
try: |
156 |
try: |
157 |
build_netanim(options.qmake_path) |
158 |
except CommandError: |
159 |
print "# Build NetAnim: failure (ignoring NetAnim)" |
160 |
config.documentElement.removeChild(netanim_config) |
161 |
finally: |
162 |
os.chdir(cwd) |
163 |
print "Leaving directory `%s'" % netanim_dir |
164 |
|
115 |
if options.enable_examples: |
165 |
if options.enable_examples: |
116 |
print "# Building examples (by user request)" |
166 |
print "# Building examples (by user request)" |
117 |
build_examples = True |
167 |
build_examples = True |