Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/bindings/python/wscript b/bindings/python/wscript
- --- a/bindings/python/wscript
- +++ b/bindings/python/wscript
- @@ -168,6 +168,7 @@
- # Check for pybindgen
- set_pybindgen_pythonpath(conf.env)
- + print(os.environ.get('PYTHONPATH', ''))
- try:
- conf.check_python_module('pybindgen')
- @@ -175,6 +176,7 @@
- Logs.warn("pybindgen missing => no python bindings")
- conf.report_optional_feature("python", "Python Bindings", False,
- "PyBindGen missing")
- + exit()
- return
- else:
- out = subprocess.Popen([conf.env['PYTHON'][0], "-c",
- @@ -183,6 +185,7 @@
- stdout=subprocess.PIPE).communicate()[0]
- pybindgen_version = maybe_decode(out.strip())
- conf.msg('Checking for pybindgen version', pybindgen_version)
- + exit()
- if not (pybindgen_version == REQUIRED_PYBINDGEN_VERSION):
- Logs.warn("pybindgen (found %r), (need %r)" %
- (pybindgen_version, REQUIRED_PYBINDGEN_VERSION))
- @@ -330,15 +333,15 @@
- raise ValueError("Module %r not found" % module)
- return ns3headers.path.abspath()
- -class apiscan_task(Task.Task):
- +class ns3apiscanner(Task.Task):
- """Uses gccxml to scan the file 'everything.h' and extract API definitions.
- """
- - after = 'gen_ns3_module_header ns3header'
- + after = 'ns3moduleheader ns3header'
- before = 'cxx command'
- color = "BLUE"
- def __init__(self, curdirnode, env, bld, target, cflags, module):
- self.bld = bld
- - super(apiscan_task, self).__init__(generator=self, env=env)
- + super(ns3apiscanner, self).__init__(generator=self, env=env)
- self.curdirnode = curdirnode
- self.env = env
- self.target = target
- @@ -421,7 +424,7 @@
- -class gen_ns3_compat_pymod_task(Task.Task):
- +class ns3compatpymod(Task.Task):
- """Generates a 'ns3.py' compatibility module."""
- before = 'cxx'
- color = 'BLUE'
- @@ -484,12 +487,12 @@
- for target, cflags in scan_targets:
- group = bld.get_group(bld.current_group)
- for module in scan_modules:
- - group.append(apiscan_task(bld.path, env, bld, target, cflags, module))
- + group.append(ns3apiscanner(bld.path, env, bld, target, cflags, module))
- return
- if env['ENABLE_PYTHON_BINDINGS']:
- - task = gen_ns3_compat_pymod_task(env=env.derive())
- + task = ns3compatpymod(env=env.derive())
- task.set_outputs(bld.path.find_or_declare("ns3.py"))
- task.dep_vars = ['PYTHON_MODULES_BUILT']
- task.bld = bld
- diff --git a/src/core/wscript b/src/core/wscript
- --- a/src/core/wscript
- +++ b/src/core/wscript
- @@ -78,7 +78,7 @@
- # Check for POSIX threads
- test_env = conf.env.derive()
- - if Options.platform != 'darwin' and Options.platform != 'cygwin':
- + if sys.platform != 'darwin' and sys.platform != 'cygwin':
- test_env.append_value('LINKFLAGS', '-pthread')
- test_env.append_value('CXXFLAGS', '-pthread')
- test_env.append_value('CCFLAGS', '-pthread')
- @@ -102,7 +102,7 @@
- errmsg='Could not find pthread support (build/config.log for details)')
- if have_pthread:
- # darwin accepts -pthread but prints a warning saying it is ignored
- - if Options.platform != 'darwin' and Options.platform != 'cygwin':
- + if sys.platform != 'darwin' and sys.platform != 'cygwin':
- conf.env['CXXFLAGS_PTHREAD'] = '-pthread'
- conf.env['CCFLAGS_PTHREAD'] = '-pthread'
- conf.env['LINKFLAGS_PTHREAD'] = '-pthread'
- diff --git a/src/internet/wscript b/src/internet/wscript
- --- a/src/internet/wscript
- +++ b/src/internet/wscript
- @@ -67,7 +67,7 @@
- "NSC not found (see option --with-nsc)")
- return
- - if Options.platform in ['linux', 'freebsd']:
- + if sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
- arch = os.uname()[4]
- else:
- arch = None
- diff --git a/src/wscript b/src/wscript
- --- a/src/wscript
- +++ b/src/wscript
- @@ -263,7 +263,7 @@
- bindgen.env['FEATURES'] = ','.join(features)
- bindgen.dep_vars = ['FEATURES', "GCC_RTTI_ABI_COMPLETE"]
- bindgen.before = 'cxx'
- - bindgen.after = 'gen_ns3_module_header'
- + bindgen.after = 'ns3moduleheader'
- bindgen.name = "pybindgen(ns3 module %s)" % module
- bindgen.install_path = None
- @@ -287,7 +287,7 @@
- pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive')
- defines = list(pymod.env['DEFINES'])
- defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H'])
- - if Options.platform == 'win32':
- + if sys.platform == 'win32':
- try:
- defines.remove('_DEBUG') # causes undefined symbols on win32
- except ValueError:
- @@ -330,7 +330,7 @@
- modheader = bld(features='ns3moduleheader')
- modheader.module = module.split('/')[-1]
- -class ns3pcfile_task(Task.Task):
- +class ns3pcfile(Task.Task):
- after = 'cxx'
- def __str__(self):
- @@ -339,7 +339,7 @@
- return 'pcfile: %s\n' % (tgt_str)
- def runnable_status(self):
- - return super(ns3pcfile_task, self).runnable_status()
- + return super(ns3pcfile, self).runnable_status()
- def _self_libs(self, env, name, libdir):
- if env['ENABLE_STATIC_NS3']:
- @@ -466,8 +466,8 @@
- self.source = '' # tell WAF not to process these files further
- -class ns3header_task(Task.Task):
- - before = 'cxx gen_ns3_module_header'
- +class ns3header(Task.Task):
- + before = 'cxx ns3moduleheader'
- color = 'BLUE'
- def __str__(self):
- @@ -506,7 +506,7 @@
- else:
- return Task.SKIP_ME
- else:
- - return super(ns3header_task, self).runnable_status()
- + return super(ns3header, self).runnable_status()
- def run(self):
- if self.mode == 'install':
- @@ -557,8 +557,8 @@
- self.headers = set(self.to_list(self.source))
- self.source = '' # tell WAF not to process these files further
- -class ns3privateheader_task(Task.Task):
- - before = 'cxx gen_ns3_module_header'
- +class ns3privateheader(Task.Task):
- + before = 'cxx ns3moduleheader'
- after = 'ns3header'
- color = 'BLUE'
- @@ -598,7 +598,7 @@
- else:
- return Task.SKIP_ME
- else:
- - return super(ns3privateheader_task, self).runnable_status()
- + return super(ns3privateheader, self).runnable_status()
- def run(self):
- if self.mode == 'install':
- @@ -627,7 +627,7 @@
- return 0
- -class gen_ns3_module_header_task(Task.Task):
- +class ns3moduleheader(Task.Task):
- before = 'cxx'
- after = 'ns3header'
- color = 'BLUE'
- @@ -639,7 +639,7 @@
- else:
- return Task.SKIP_ME
- else:
- - return super(gen_ns3_module_header_task, self).runnable_status()
- + return super(ns3moduleheader, self).runnable_status()
- def __str__(self):
- "string to display to the user"
- @@ -738,7 +738,7 @@
- return
- all_headers_outputs = [ns3_dir_node.find_or_declare("%s-module.h" % self.module)]
- - task = self.create_task('gen_ns3_module_header')
- + task = self.create_task('ns3moduleheader')
- task.module = self.module
- task.mode = getattr(self, "mode", "install")
- if task.mode == 'install':
- diff --git a/wscript b/wscript
- --- a/wscript
- +++ b/wscript
- @@ -380,13 +380,13 @@
- if libstdcxx_location:
- conf.env.append_value('NS3_MODULE_PATH', libstdcxx_location)
- - if Options.platform in ['linux']:
- + if sys.platform.startswith('linux'):
- if conf.check_compilation_flag('-Wl,--soname=foo'):
- env['WL_SONAME_SUPPORTED'] = True
- # bug 2181 on clang warning suppressions
- if conf.env['CXX_NAME'] in ['clang']:
- - if Options.platform == 'darwin':
- + if sys.platform == 'darwin':
- if conf.env['CC_VERSION'] >= darwin_clang_version_warn_unused_local_typedefs:
- env.append_value('CXXFLAGS', '-Wno-unused-local-typedefs')
- if conf.env['CC_VERSION'] >= darwin_clang_version_warn_potentially_evaluated:
- @@ -398,7 +398,7 @@
- env.append_value('CXXFLAGS', '-Wno-potentially-evaluated-expression')
- env['ENABLE_STATIC_NS3'] = False
- if Options.options.enable_static:
- - if Options.platform == 'darwin':
- + if sys.platform == 'darwin':
- if conf.check_compilation_flag(flag=[], linkflags=['-Wl,-all_load']):
- conf.report_optional_feature("static", "Static build", True, '')
- env['ENABLE_STATIC_NS3'] = True
- @@ -605,12 +605,12 @@
- print("%-30s: %s%s%s" % (caption, Logs.colors(color), status, Logs.colors('NORMAL')))
- -class SuidBuild_task(Task.Task):
- +class suid_bit_adder(Task.Task):
- """task that makes a binary Suid
- """
- after = 'link'
- def __init__(self, *args, **kwargs):
- - super(SuidBuild_task, self).__init__(*args, **kwargs)
- + super(suid_bit_adder, self).__init__(*args, **kwargs)
- self.m_display = 'build-suid'
- try:
- program_obj = wutils.find_program(self.generator.name, self.generator.env)
- @@ -649,7 +649,7 @@
- program.target = "%s%s-%s%s" % (wutils.APPNAME, wutils.VERSION, name, bld.env.BUILD_SUFFIX)
- if bld.env['ENABLE_SUDO']:
- - program.create_task("SuidBuild")
- + program.create_task('suid_bit_adder')
- bld.set_group(grp)
- @@ -1050,13 +1050,13 @@
- wutils.run_python_program("test.py -n -c core", bld.env)
- -class print_introspected_doxygen_task(Task.TaskBase):
- +class introspected_doxygen_printer(Task.TaskBase):
- after = 'cxx link'
- color = 'BLUE'
- def __init__(self, bld):
- self.bld = bld
- - super(print_introspected_doxygen_task, self).__init__(generator=self)
- + super(introspected_doxygen_printer, self).__init__(generator=self)
- def __str__(self):
- return 'print-introspected-doxygen\n'
- @@ -1089,13 +1089,13 @@
- raise SystemExit(1)
- text_out.close()
- -class run_python_unit_tests_task(Task.TaskBase):
- +class python_unit_tests_runner(Task.TaskBase):
- after = 'cxx link'
- color = 'BLUE'
- def __init__(self, bld):
- self.bld = bld
- - super(run_python_unit_tests_task, self).__init__(generator=self)
- + super(python_unit_tests_runner, self).__init__(generator=self)
- def __str__(self):
- return 'run-python-unit-tests\n'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement