Again, make Python depend only on scanned modules (last fix was incomplete).
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Mon, 14 Jul 2008 11:35:58 +0100
changeset 3424 fd8ae9ea848b
parent 3423 f84261098ab0
child 3425 c69779f5e51e
child 3427 3401e899479c
child 3456 7f2d5300ad02
Again, make Python depend only on scanned modules (last fix was incomplete).
bindings/python/wscript
--- a/bindings/python/wscript	Mon Jul 14 11:25:10 2008 +0100
+++ b/bindings/python/wscript	Mon Jul 14 11:35:58 2008 +0100
@@ -313,6 +313,16 @@
         print "Rescanning the python bindings done."
         raise SystemExit
 
+    ## Get a list of scanned modules; the set of scanned modules
+    ## may be smaller than the set of all modules, in case a new
+    ## ns3 module is being developed which wasn't scanned yet.
+    scanned_modules = []
+    for filename in os.listdir(bld.m_curdirnode.abspath()):
+        m = re.match(r"^ns3_module_(.+)\.py$", filename)
+        if m is None:
+            continue
+        scanned_modules.append(m.group(1))
+
     if env['ENABLE_PYTHON_BINDINGS']:
         bindgen = bld.create_obj('command-output')
         bindgen.name = 'pybindgen'
@@ -328,16 +338,6 @@
                                  'ns3modulegen_generated.py',
                                  'ns3modulegen_core_customizations.py']
 
-        ## Get a list of scanned modules; the set of scanned modules
-        ## may be smaller than the set of all modules, in case a new
-        ## ns3 module is being developed which wasn't scanned yet.
-        scanned_modules = []
-        for filename in os.listdir(bindgen.path.abspath()):
-            m = re.match(r"^ns3_module_(.+)\.py$", filename)
-            if m is None:
-                continue
-            scanned_modules.append(m.group(1))
-            
         for module in scanned_modules:
             bindgen.hidden_inputs.append("ns3_module_%s.py" % module)
 
@@ -360,8 +360,8 @@
         pymod = bld.create_obj('cpp', 'shlib', 'pyext')
         pymod.source = ['ns3module.cc', 'ns3module_helpers.cc']
         pymod.includes = '.'
-        for module in get_modules_and_headers().iterkeys():
-            pymod.source.append("ns3_module_%s.cc" % module.replace('-', '_'))
+        for module in scanned_modules:
+            pymod.source.append("ns3_module_%s.cc" % module)
         pymod.target = 'ns3/_ns3'
         pymod.name = 'ns3module'
         pymod.uselib_local = "ns3"