From b2b1b08bf20f5c6fb23cdb440ac869bf75a4af56 Mon Sep 17 00:00:00 2001 From: Gabriel Arrobo Date: Wed, 7 Apr 2021 05:25:39 +0000 Subject: [PATCH] build: Enabled to run python scripts located in the contrib directory --- bindings/python/ns3modulescan-modular.py | 2 +- contrib/wscript | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bindings/python/ns3modulescan-modular.py b/bindings/python/ns3modulescan-modular.py index 5e5bee5da..d78938acc 100644 --- a/bindings/python/ns3modulescan-modular.py +++ b/bindings/python/ns3modulescan-modular.py @@ -251,7 +251,7 @@ def ns3_module_scan(top_builddir, module_name, headers_map, output_file_name, cf output_file = open(output_file_name, "wt") output_sink = FileCodeSink(output_file) - # if there exists a scan-header.h file in src//bindings, + # if there exists a scan-header.h file in src//bindings or contrib//bindings, # scan it, otherwise scan ns3/xxxx-module.h. scan_header = os.path.join(os.path.dirname(output_file_name), "scan-header.h") if not os.path.exists(scan_header): diff --git a/contrib/wscript b/contrib/wscript index 5545f1830..9fff14961 100644 --- a/contrib/wscript +++ b/contrib/wscript @@ -197,7 +197,7 @@ def ns3_python_bindings(bld): Warning, stacklevel=2) return - if ("ns3-%s" % (module,)) not in env.NS3_ENABLED_MODULES: + if ("ns3-%s" % (module,)) not in env.NS3_ENABLED_CONTRIBUTED_MODULES: #print "bindings for module %s which is not enabled, skip" % module) return @@ -260,6 +260,7 @@ def ns3_python_bindings(bld): bindgen.before = ['cxxprogram', 'cxxshlib', 'cxxstlib'] bindgen.after = 'gen_ns3_module_header' bindgen.name = "pybindgen(ns3 module %s)" % module + bindgen.module = module bindgen.install_path = None # generate the extension module @@ -267,7 +268,8 @@ def ns3_python_bindings(bld): pymod.source = ['bindings/ns3module.cc'] pymod.target = '%s/%s' % (module_target_dir, extension_name) pymod.name = 'ns3module_%s' % module - pymod.use = ["%s" % mod for mod in pymod.env['NS3_ENABLED_MODULES']] # Should be '"ns3-"+module', but see bug 1117 + pymod.module = module + pymod.use = ["%s" % mod for mod in pymod.env['NS3_ENABLED_CONTRIBUTED_MODULES']] if pymod.env['ENABLE_STATIC_NS3']: if sys.platform == 'darwin': pymod.env.append_value('LINKFLAGS', '-Wl,-all_load') @@ -282,6 +284,10 @@ def ns3_python_bindings(bld): pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive') defines = list(pymod.env['DEFINES']) defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H']) + defines.extend(['NS_DEPRECATED_3_34=', 'NS3_DEPRECATED_H']) + defines.extend(['NS_DEPRECATED_3_32=', 'NS3_DEPRECATED_H']) + defines.extend(['NS_DEPRECATED_3_31=', 'NS3_DEPRECATED_H']) + defines.extend(['NS_DEPRECATED_3_30=', 'NS3_DEPRECATED_H']) if Utils.unversioned_sys_platform() == 'win32': try: defines.remove('_DEBUG') # causes undefined symbols on win32