The 'everything.h' header file is only used for Python bindings and should be generated into bindings/python/, not ns3/.
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed, 09 Jul 2008 14:58:02 +0100
changeset 340994ac3e381075
parent 3408 2cc40b3e4fa5
child 3410 2d66cad7db94
The 'everything.h' header file is only used for Python bindings and should be generated into bindings/python/, not ns3/.
bindings/python/ns3modulegen.py
bindings/python/ns3modulescan.py
bindings/python/wscript
     1.1 --- a/bindings/python/ns3modulegen.py	Tue Jul 08 10:43:58 2008 -0700
     1.2 +++ b/bindings/python/ns3modulegen.py	Wed Jul 09 14:58:02 2008 +0100
     1.3 @@ -77,7 +77,7 @@
     1.4  def main():
     1.5      out = MyMultiSectionFactory(sys.argv[1], sys.argv[2:])
     1.6      root_module = module_init()
     1.7 -    root_module.add_include('"ns3/everything.h"')
     1.8 +    root_module.add_include('"everything.h"')
     1.9  
    1.10      register_types(root_module)
    1.11  
     2.1 --- a/bindings/python/ns3modulescan.py	Tue Jul 08 10:43:58 2008 -0700
     2.2 +++ b/bindings/python/ns3modulescan.py	Wed Jul 09 14:58:02 2008 +0100
     2.3 @@ -228,7 +228,7 @@
     2.4              return '__main__'
     2.5  
     2.6  
     2.7 -def ns3_module_scan(top_builddir, pygen_file_name):
     2.8 +def ns3_module_scan(top_builddir, pygen_file_name, everything_h):
     2.9  
    2.10      ns3_modules = eval(sys.stdin.read())
    2.11  
    2.12 @@ -239,7 +239,7 @@
    2.13          for dep in ns3_module_deps:
    2.14              graph.append((dep, ns3_module_name))
    2.15      sorted_ns3_modules = topsort(graph)
    2.16 -    print >> sys.stderr, "******* topological sort: ", sorted_ns3_modules
    2.17 +    #print >> sys.stderr, "******* topological sort: ", sorted_ns3_modules
    2.18  
    2.19      sections = [PygenSection('__main__', FileCodeSink(open(pygen_file_name, "wt")))]
    2.20      headers_map = {} # header_name -> section_name
    2.21 @@ -255,8 +255,8 @@
    2.22  
    2.23      module_parser.add_pre_scan_hook(pre_scan_hook)
    2.24      #module_parser.add_post_scan_hook(post_scan_hook)
    2.25 -    module_parser.parse_init([os.path.join(top_builddir, 'ns3', 'everything.h')],
    2.26 -                             include_paths=[top_builddir], whitelist_paths=[top_builddir],
    2.27 +    module_parser.parse_init([everything_h],
    2.28 +                             include_paths=[top_builddir], whitelist_paths=[top_builddir, os.path.dirname(everything_h)],
    2.29                               #includes=['"ns3/everything.h"'],
    2.30                               pygen_sink=sections,
    2.31                               pygen_classifier=MyPygenClassifier(headers_map))
    2.32 @@ -277,5 +277,5 @@
    2.33  
    2.34  
    2.35  if __name__ == '__main__':
    2.36 -    ns3_module_scan(sys.argv[1], sys.argv[2])
    2.37 +    ns3_module_scan(sys.argv[1], sys.argv[3], sys.argv[2])
    2.38  
     3.1 --- a/bindings/python/wscript	Tue Jul 08 10:43:58 2008 -0700
     3.2 +++ b/bindings/python/wscript	Wed Jul 09 14:58:02 2008 +0100
     3.3 @@ -219,8 +219,8 @@
     3.4      """
     3.5      def __init__(self, *features):
     3.6          Object.task_gen.__init__(self, *features)
     3.7 -        self.inst_var = 'INCLUDEDIR'
     3.8 -        self.inst_dir = 'ns3'
     3.9 +        self.inst_var = 0#'INCLUDEDIR'
    3.10 +        #self.inst_dir = 'ns3'
    3.11  
    3.12      def apply(self):
    3.13          ## get all of the ns3 headers
    3.14 @@ -249,7 +249,7 @@
    3.15                              fatal("missing header file %s" % (source,))
    3.16                          all_headers_inputs.append(node)
    3.17          assert all_headers_inputs
    3.18 -        all_headers_outputs = [ns3_dir_node.find_build("everything.h")]
    3.19 +        all_headers_outputs = [self.path.find_build("everything.h")]
    3.20          task = self.create_task('gen-ns3-metaheader', self.env, 4)
    3.21          task.set_inputs(all_headers_inputs)
    3.22          task.set_outputs(all_headers_outputs)
    3.23 @@ -302,6 +302,7 @@
    3.24              env['PYTHON'],
    3.25              os.path.join(curdir, 'ns3modulescan.py'), # scanning script
    3.26              bld.m_curdirnode.find_dir('../..').abspath(env), # include path (where the ns3 include dir is)
    3.27 +            bld.m_curdirnode.find_build('everything.h').abspath(env),
    3.28              os.path.join(curdir, 'ns3modulegen_generated.py'), # output file
    3.29              ]
    3.30          scan = subprocess.Popen(argv, stdin=subprocess.PIPE)
    3.31 @@ -323,7 +324,7 @@
    3.32              bindgen.output_file("ns3module.cc"),
    3.33              ]
    3.34          bindgen.argv.extend(get_modules_and_headers().iterkeys())
    3.35 -        bindgen.hidden_inputs = ['../../ns3/everything.h',
    3.36 +        bindgen.hidden_inputs = ['everything.h',
    3.37                                   'ns3modulegen_generated.py',
    3.38                                   'ns3modulegen_core_customizations.py']
    3.39          for module in get_modules_and_headers().iterkeys():