Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.31 KB | None | 0 0
  1. diff --git a/bindings/python/wscript b/bindings/python/wscript
  2. --- a/bindings/python/wscript
  3. +++ b/bindings/python/wscript
  4. @@ -345,15 +345,15 @@
  5. raise ValueError("Module %r not found" % module)
  6. return ns3headers.path.abspath()
  7.  
  8. -class apiscan_task(Task.Task):
  9. - """Uses castxml to scan the file 'everything.h' and extract API definitions.
  10. +class ns3apiscanner(Task.Task):
  11. + """Uses gccxml to scan the file 'everything.h' and extract API definitions.
  12. """
  13. - after = 'gen_ns3_module_header ns3header'
  14. + after = 'ns3moduleheader ns3header'
  15. before = 'cxx command'
  16. color = "BLUE"
  17. def __init__(self, curdirnode, env, bld, target, cflags, module):
  18. self.bld = bld
  19. - super(apiscan_task, self).__init__(generator=self, env=env)
  20. + super(ns3apiscanner, self).__init__(generator=self, env=env)
  21. self.curdirnode = curdirnode
  22. self.env = env
  23. self.target = target
  24. @@ -436,7 +436,7 @@
  25.  
  26.  
  27.  
  28. -class gen_ns3_compat_pymod_task(Task.Task):
  29. +class ns3compatpymod(Task.Task):
  30. """Generates a 'ns3.py' compatibility module."""
  31. before = 'cxx'
  32. color = 'BLUE'
  33. @@ -499,12 +499,12 @@
  34. for target, cflags in scan_targets:
  35. group = bld.get_group(bld.current_group)
  36. for module in scan_modules:
  37. - group.append(apiscan_task(bld.path, env, bld, target, cflags, module))
  38. + group.append(ns3apiscanner(bld.path, env, bld, target, cflags, module))
  39. return
  40.  
  41.  
  42. if env['ENABLE_PYTHON_BINDINGS']:
  43. - task = gen_ns3_compat_pymod_task(env=env.derive())
  44. + task = ns3compatpymod(env=env.derive())
  45. task.set_outputs(bld.path.find_or_declare("ns3.py"))
  46. task.dep_vars = ['PYTHON_MODULES_BUILT']
  47. task.bld = bld
  48. diff --git a/contrib/wscript b/contrib/wscript
  49. --- a/contrib/wscript
  50. +++ b/contrib/wscript
  51. @@ -287,7 +287,7 @@
  52. pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive')
  53. defines = list(pymod.env['DEFINES'])
  54. defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H'])
  55. - if Options.platform == 'win32':
  56. + if Utils.unversioned_sys_platform() == 'win32':
  57. try:
  58. defines.remove('_DEBUG') # causes undefined symbols on win32
  59. except ValueError:
  60. diff --git a/src/core/wscript b/src/core/wscript
  61. --- a/src/core/wscript
  62. +++ b/src/core/wscript
  63. @@ -1,7 +1,7 @@
  64. ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
  65. import sys
  66.  
  67. -from waflib import Options
  68. +from waflib import Options, Utils
  69. import wutils
  70.  
  71. int64x64 = {
  72. @@ -78,7 +78,7 @@
  73.  
  74. # Check for POSIX threads
  75. test_env = conf.env.derive()
  76. - if Options.platform != 'darwin' and Options.platform != 'cygwin':
  77. + if Utils.unversioned_sys_platform() != 'darwin' and Utils.unversioned_sys_platform() != 'cygwin':
  78. test_env.append_value('LINKFLAGS', '-pthread')
  79. test_env.append_value('CXXFLAGS', '-pthread')
  80. test_env.append_value('CCFLAGS', '-pthread')
  81. @@ -102,7 +102,7 @@
  82. errmsg='Could not find pthread support (build/config.log for details)')
  83. if have_pthread:
  84. # darwin accepts -pthread but prints a warning saying it is ignored
  85. - if Options.platform != 'darwin' and Options.platform != 'cygwin':
  86. + if Utils.unversioned_sys_platform() != 'darwin' and Utils.unversioned_sys_platform() != 'cygwin':
  87. conf.env['CXXFLAGS_PTHREAD'] = '-pthread'
  88. conf.env['CCFLAGS_PTHREAD'] = '-pthread'
  89. conf.env['LINKFLAGS_PTHREAD'] = '-pthread'
  90. diff --git a/src/internet/wscript b/src/internet/wscript
  91. --- a/src/internet/wscript
  92. +++ b/src/internet/wscript
  93. @@ -67,7 +67,7 @@
  94. "NSC not found (see option --with-nsc)")
  95. return
  96.  
  97. - if Options.platform in ['linux', 'freebsd']:
  98. + if Utils.unversioned_sys_platform() in ['linux', 'freebsd']:
  99. arch = os.uname()[4]
  100. else:
  101. arch = None
  102. diff --git a/src/wscript b/src/wscript
  103. --- a/src/wscript
  104. +++ b/src/wscript
  105. @@ -263,7 +263,7 @@
  106. bindgen.env['FEATURES'] = ','.join(features)
  107. bindgen.dep_vars = ['FEATURES', "GCC_RTTI_ABI_COMPLETE"]
  108. bindgen.before = 'cxx'
  109. - bindgen.after = 'gen_ns3_module_header'
  110. + bindgen.after = 'ns3moduleheader'
  111. bindgen.name = "pybindgen(ns3 module %s)" % module
  112. bindgen.install_path = None
  113.  
  114. @@ -287,7 +287,7 @@
  115. pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive')
  116. defines = list(pymod.env['DEFINES'])
  117. defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H'])
  118. - if Options.platform == 'win32':
  119. + if Utils.unversioned_sys_platform() == 'win32':
  120. try:
  121. defines.remove('_DEBUG') # causes undefined symbols on win32
  122. except ValueError:
  123. @@ -330,7 +330,7 @@
  124. modheader = bld(features='ns3moduleheader')
  125. modheader.module = module.split('/')[-1]
  126.  
  127. -class ns3pcfile_task(Task.Task):
  128. +class ns3pcfile(Task.Task):
  129. after = 'cxx'
  130.  
  131. def __str__(self):
  132. @@ -339,7 +339,7 @@
  133. return 'pcfile: %s\n' % (tgt_str)
  134.  
  135. def runnable_status(self):
  136. - return super(ns3pcfile_task, self).runnable_status()
  137. + return super(ns3pcfile, self).runnable_status()
  138.  
  139. def _self_libs(self, env, name, libdir):
  140. if env['ENABLE_STATIC_NS3']:
  141. @@ -466,8 +466,8 @@
  142. self.source = '' # tell WAF not to process these files further
  143.  
  144.  
  145. -class ns3header_task(Task.Task):
  146. - before = 'cxx gen_ns3_module_header'
  147. +class ns3header(Task.Task):
  148. + before = 'cxx ns3moduleheader'
  149. color = 'BLUE'
  150.  
  151. def __str__(self):
  152. @@ -506,7 +506,7 @@
  153. else:
  154. return Task.SKIP_ME
  155. else:
  156. - return super(ns3header_task, self).runnable_status()
  157. + return super(ns3header, self).runnable_status()
  158.  
  159. def run(self):
  160. if self.mode == 'install':
  161. @@ -557,8 +557,8 @@
  162. self.headers = set(self.to_list(self.source))
  163. self.source = '' # tell WAF not to process these files further
  164.  
  165. -class ns3privateheader_task(Task.Task):
  166. - before = 'cxx gen_ns3_module_header'
  167. +class ns3privateheader(Task.Task):
  168. + before = 'cxx ns3moduleheader'
  169. after = 'ns3header'
  170. color = 'BLUE'
  171.  
  172. @@ -598,7 +598,7 @@
  173. else:
  174. return Task.SKIP_ME
  175. else:
  176. - return super(ns3privateheader_task, self).runnable_status()
  177. + return super(ns3privateheader, self).runnable_status()
  178.  
  179. def run(self):
  180. if self.mode == 'install':
  181. @@ -627,7 +627,7 @@
  182. return 0
  183.  
  184.  
  185. -class gen_ns3_module_header_task(Task.Task):
  186. +class ns3moduleheader(Task.Task):
  187. before = 'cxx'
  188. after = 'ns3header'
  189. color = 'BLUE'
  190. @@ -639,7 +639,7 @@
  191. else:
  192. return Task.SKIP_ME
  193. else:
  194. - return super(gen_ns3_module_header_task, self).runnable_status()
  195. + return super(ns3moduleheader, self).runnable_status()
  196.  
  197. def __str__(self):
  198. "string to display to the user"
  199. @@ -738,7 +738,7 @@
  200. return
  201.  
  202. all_headers_outputs = [ns3_dir_node.find_or_declare("%s-module.h" % self.module)]
  203. - task = self.create_task('gen_ns3_module_header')
  204. + task = self.create_task('ns3moduleheader')
  205. task.module = self.module
  206. task.mode = getattr(self, "mode", "install")
  207. if task.mode == 'install':
  208. diff --git a/wscript b/wscript
  209. --- a/wscript
  210. +++ b/wscript
  211. @@ -412,13 +412,13 @@
  212. if libstdcxx_location:
  213. conf.env.append_value('NS3_MODULE_PATH', libstdcxx_location)
  214.  
  215. - if Options.platform in ['linux']:
  216. + if Utils.unversioned_sys_platform() == 'linux':
  217. if conf.check_compilation_flag('-Wl,--soname=foo'):
  218. env['WL_SONAME_SUPPORTED'] = True
  219.  
  220. # bug 2181 on clang warning suppressions
  221. if conf.env['CXX_NAME'] in ['clang']:
  222. - if Options.platform == 'darwin':
  223. + if Utils.unversioned_sys_platform() == 'darwin':
  224. if conf.env['CC_VERSION'] >= darwin_clang_version_warn_unused_local_typedefs:
  225. env.append_value('CXXFLAGS', '-Wno-unused-local-typedefs')
  226. if conf.env['CC_VERSION'] >= darwin_clang_version_warn_potentially_evaluated:
  227. @@ -430,7 +430,7 @@
  228. env.append_value('CXXFLAGS', '-Wno-potentially-evaluated-expression')
  229. env['ENABLE_STATIC_NS3'] = False
  230. if Options.options.enable_static:
  231. - if Options.platform == 'darwin':
  232. + if Utils.unversioned_sys_platform() == 'darwin':
  233. if conf.check_compilation_flag(flag=[], linkflags=['-Wl,-all_load']):
  234. conf.report_optional_feature("static", "Static build", True, '')
  235. env['ENABLE_STATIC_NS3'] = True
  236. @@ -655,12 +655,12 @@
  237. print_config(env)
  238.  
  239.  
  240. -class SuidBuild_task(Task.Task):
  241. +class suid_bit_adder(Task.Task):
  242. """task that makes a binary Suid
  243. """
  244. after = 'link'
  245. def __init__(self, *args, **kwargs):
  246. - super(SuidBuild_task, self).__init__(*args, **kwargs)
  247. + super(suid_bit_adder, self).__init__(*args, **kwargs)
  248. self.m_display = 'build-suid'
  249. try:
  250. program_obj = wutils.find_program(self.generator.name, self.generator.env)
  251. @@ -699,7 +699,7 @@
  252. program.target = "%s%s-%s%s" % (wutils.APPNAME, wutils.VERSION, name, bld.env.BUILD_SUFFIX)
  253.  
  254. if bld.env['ENABLE_SUDO']:
  255. - program.create_task("SuidBuild")
  256. + program.create_task('suid_bit_adder')
  257.  
  258. bld.set_group(grp)
  259.  
  260. @@ -1125,13 +1125,13 @@
  261. wutils.run_python_program("test.py -n -c core", bld.env)
  262.  
  263.  
  264. -class print_introspected_doxygen_task(Task.TaskBase):
  265. +class introspected_doxygen_printer(Task.TaskBase):
  266. after = 'cxx link'
  267. color = 'BLUE'
  268.  
  269. def __init__(self, bld):
  270. self.bld = bld
  271. - super(print_introspected_doxygen_task, self).__init__(generator=self)
  272. + super(introspected_doxygen_printer, self).__init__(generator=self)
  273.  
  274. def __str__(self):
  275. return 'print-introspected-doxygen\n'
  276. @@ -1164,13 +1164,13 @@
  277. raise SystemExit(1)
  278. text_out.close()
  279.  
  280. -class run_python_unit_tests_task(Task.TaskBase):
  281. +class python_unit_tests_runner(Task.TaskBase):
  282. after = 'cxx link'
  283. color = 'BLUE'
  284.  
  285. def __init__(self, bld):
  286. self.bld = bld
  287. - super(run_python_unit_tests_task, self).__init__(generator=self)
  288. + super(python_unit_tests_runner, self).__init__(generator=self)
  289.  
  290. def __str__(self):
  291. return 'run-python-unit-tests\n'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement