build: Enabled to run python scripts located in the contrib directory
This commit is contained in:
committed by
Tom Henderson
parent
0ef0690969
commit
b2b1b08bf2
@@ -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/<module>/bindings,
|
||||
# if there exists a scan-header.h file in src/<module>/bindings or contrib/<module>/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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user