bindings/python/ns3modulescan-modular.py
changeset 6893 5dccd86f90cf
parent 6889 3a137dbf9789
child 6896 fb47685b1dad
--- a/bindings/python/ns3modulescan-modular.py	Fri Mar 11 15:55:38 2011 +0000
+++ b/bindings/python/ns3modulescan-modular.py	Sat Mar 12 18:34:30 2011 +0000
@@ -229,7 +229,14 @@
         pass
     output_file = open(output_file_name, "wt")
     output_sink = FileCodeSink(output_file)
-    module_parser.parse_init([os.path.join(top_builddir, "ns3", "%s-module.h" % module_name)],
+
+    # if there exists a scan-header.h file in src/<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):
+        scan_header = os.path.join(top_builddir, "ns3", "%s-module.h" % module_name)
+
+    module_parser.parse_init([scan_header],
                              None, whitelist_paths=[top_builddir],
                              #includes=['"ns3/everything.h"'],
                              pygen_sink=output_sink,