enable static libns3 builds for python module
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 22 Apr 2009 13:06:22 +0200
changeset 4393 4d9d3ff807a9
parent 4392 25d38a0c9851
child 4394 dced016d5f49
enable static libns3 builds for python module
bindings/python/wscript
wscript
--- a/bindings/python/wscript	Tue Apr 21 14:38:47 2009 +0200
+++ b/bindings/python/wscript	Wed Apr 22 13:06:22 2009 +0200
@@ -445,6 +445,10 @@
         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'])
--- a/wscript	Tue Apr 21 14:38:47 2009 +0200
+++ b/wscript	Wed Apr 22 13:06:22 2009 +0200
@@ -291,7 +291,6 @@
     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