bindings/python/wscript
changeset 3409 94ac3e381075
parent 3408 2cc40b3e4fa5
child 3411 eca46ea15a04
equal deleted inserted replaced
3408:2cc40b3e4fa5 3409:94ac3e381075
   217     """Generates a 'everything.h' header file that includes some/all public ns3 headers.
   217     """Generates a 'everything.h' header file that includes some/all public ns3 headers.
   218     This single header file is to be parsed only once by gccxml, for greater efficiency.
   218     This single header file is to be parsed only once by gccxml, for greater efficiency.
   219     """
   219     """
   220     def __init__(self, *features):
   220     def __init__(self, *features):
   221         Object.task_gen.__init__(self, *features)
   221         Object.task_gen.__init__(self, *features)
   222         self.inst_var = 'INCLUDEDIR'
   222         self.inst_var = 0#'INCLUDEDIR'
   223         self.inst_dir = 'ns3'
   223         #self.inst_dir = 'ns3'
   224 
   224 
   225     def apply(self):
   225     def apply(self):
   226         ## get all of the ns3 headers
   226         ## get all of the ns3 headers
   227         ns3_dir_node = Params.g_build.m_srcnode.find_dir("ns3")
   227         ns3_dir_node = Params.g_build.m_srcnode.find_dir("ns3")
   228         all_headers_inputs = []
   228         all_headers_inputs = []
   247                         node = ns3_dir_node.find_build(os.path.basename(source))
   247                         node = ns3_dir_node.find_build(os.path.basename(source))
   248                         if node is None:
   248                         if node is None:
   249                             fatal("missing header file %s" % (source,))
   249                             fatal("missing header file %s" % (source,))
   250                         all_headers_inputs.append(node)
   250                         all_headers_inputs.append(node)
   251         assert all_headers_inputs
   251         assert all_headers_inputs
   252         all_headers_outputs = [ns3_dir_node.find_build("everything.h")]
   252         all_headers_outputs = [self.path.find_build("everything.h")]
   253         task = self.create_task('gen-ns3-metaheader', self.env, 4)
   253         task = self.create_task('gen-ns3-metaheader', self.env, 4)
   254         task.set_inputs(all_headers_inputs)
   254         task.set_inputs(all_headers_inputs)
   255         task.set_outputs(all_headers_outputs)
   255         task.set_outputs(all_headers_outputs)
   256 
   256 
   257     def install(self):
   257     def install(self):
   300         curdir = bld.m_curdirnode.abspath()
   300         curdir = bld.m_curdirnode.abspath()
   301         argv = [
   301         argv = [
   302             env['PYTHON'],
   302             env['PYTHON'],
   303             os.path.join(curdir, 'ns3modulescan.py'), # scanning script
   303             os.path.join(curdir, 'ns3modulescan.py'), # scanning script
   304             bld.m_curdirnode.find_dir('../..').abspath(env), # include path (where the ns3 include dir is)
   304             bld.m_curdirnode.find_dir('../..').abspath(env), # include path (where the ns3 include dir is)
       
   305             bld.m_curdirnode.find_build('everything.h').abspath(env),
   305             os.path.join(curdir, 'ns3modulegen_generated.py'), # output file
   306             os.path.join(curdir, 'ns3modulegen_generated.py'), # output file
   306             ]
   307             ]
   307         scan = subprocess.Popen(argv, stdin=subprocess.PIPE)
   308         scan = subprocess.Popen(argv, stdin=subprocess.PIPE)
   308         scan.stdin.write(repr(get_modules_and_headers()))
   309         scan.stdin.write(repr(get_modules_and_headers()))
   309         scan.stdin.close()
   310         scan.stdin.close()
   321         bindgen.argv = [
   322         bindgen.argv = [
   322             bindgen.input_file("ns3modulegen.py"),
   323             bindgen.input_file("ns3modulegen.py"),
   323             bindgen.output_file("ns3module.cc"),
   324             bindgen.output_file("ns3module.cc"),
   324             ]
   325             ]
   325         bindgen.argv.extend(get_modules_and_headers().iterkeys())
   326         bindgen.argv.extend(get_modules_and_headers().iterkeys())
   326         bindgen.hidden_inputs = ['../../ns3/everything.h',
   327         bindgen.hidden_inputs = ['everything.h',
   327                                  'ns3modulegen_generated.py',
   328                                  'ns3modulegen_generated.py',
   328                                  'ns3modulegen_core_customizations.py']
   329                                  'ns3modulegen_core_customizations.py']
   329         for module in get_modules_and_headers().iterkeys():
   330         for module in get_modules_and_headers().iterkeys():
   330             bindgen.hidden_inputs.append("ns3_module_%s.py" % module.replace('-', '_'))
   331             bindgen.hidden_inputs.append("ns3_module_%s.py" % module.replace('-', '_'))
   331         bindgen.hidden_outputs = ['ns3module.h']
   332         bindgen.hidden_outputs = ['ns3module.h']