Skip to content

Commit

Permalink
build: Make wscript changes to default to Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhenderson committed Aug 12, 2019
1 parent 27067ca commit 40fc2d2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion wscript
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,15 @@ def configure(conf):

env = conf.env

# ns-3 now only supports Python3 but Waf is based on Python2
# This can be removed once Waf moves to Python3
if Options.options.with_python is None:
if sys.version_info < (3,):
# Forcing otherwise unused Options.options.python to select python3
# This option is checked later by waflib
Options.options.python = 'python3'
conf.msg('Configuring Waf to use python3: ', Options.options.python, 'GREEN')

if Options.options.enable_gcov:
env['GCOV_ENABLED'] = True
env.append_value('CCFLAGS', '-fprofile-arcs')
Expand Down Expand Up @@ -1128,7 +1137,7 @@ def shutdown(ctx):
# Write the build status file.
build_status_file = os.path.join(bld.out_dir, 'build-status.py')
out = open(build_status_file, 'w')
out.write('#! /usr/bin/env python\n')
out.write('#! /usr/bin/env python3\n')
out.write('\n')
out.write('# Programs that are runnable.\n')
out.write('ns3_runnable_programs = ' + str(env['NS3_RUNNABLE_PROGRAMS']) + '\n')
Expand Down

0 comments on commit 40fc2d2

Please sign in to comment.