Advertisement
Guest User

Untitled

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