enable static builds, even when python is enabled

This commit is contained in:
Mathieu Lacage committed 2009-04-22 17:22:41 +02:00
1 parent 7eda961b1f
commit 5dff0e0ca6
3 files changed
+12 -1

No files matched your search

+4
View File
@@ -445,6 +445,10 @@ def build(bld):
pymod.target = 'ns3/_ns3'
pymod.name = 'ns3module'
pymod.uselib_local = "ns3"
if pymod.env['ENABLE_STATIC_NS3']:
pymod.env.append_value('LINKFLAGS', '-Wl,--whole-archive,-Bstatic')
pymod.env.append_value('LINKFLAGS', '-lns3')
pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive')
defines = list(pymod.env['CXXDEFINES'])
defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H'])
+8
View File
@@ -74,6 +74,14 @@ def create_ns3_module(bld, name, dependencies=()):
module.module_deps = list(dependencies)
if not module.env['ENABLE_STATIC_NS3']:
module.env.append_value('CXXFLAGS', module.env['shlib_CXXFLAGS'])
elif module.env['CXX_NAME'] == 'gcc' and \
os.uname()[4] == 'x86_64' and \
module.env['ENABLE_PYTHON_BINDINGS']:
# enable that flag for static builds only on x86-64 platforms
# when gcc is present and only when we want python bindings
# (it's more efficient to not use this option if we can avoid it)
module.env.append_value('CXXFLAGS', '-mcmodel=large')
module.env.append_value('CXXDEFINES', "NS3_MODULE_COMPILATION")
return module
-1
View File
@@ -291,7 +291,6 @@ def configure(conf):
conf.find_program('valgrind', var='VALGRIND')
if Options.options.enable_static and \
not conf.env['ENABLE_PYTHON_BINDINGS'] and \
env['PLATFORM'].startswith('linux'):
conf.env['ENABLE_STATIC_NS3'] = Options.options.enable_static