# HG changeset patch # User Gustavo J. A. M. Carneiro # Date 1215611882 -3600 # Node ID 94ac3e381075315a856dd672c6c03bdac329e678 # Parent 2cc40b3e4fa5f3ac5b0f5ecb0814951268865b7f The 'everything.h' header file is only used for Python bindings and should be generated into bindings/python/, not ns3/. diff -r 2cc40b3e4fa5 -r 94ac3e381075 bindings/python/ns3modulegen.py --- a/bindings/python/ns3modulegen.py Tue Jul 08 10:43:58 2008 -0700 +++ b/bindings/python/ns3modulegen.py Wed Jul 09 14:58:02 2008 +0100 @@ -77,7 +77,7 @@ def main(): out = MyMultiSectionFactory(sys.argv[1], sys.argv[2:]) root_module = module_init() - root_module.add_include('"ns3/everything.h"') + root_module.add_include('"everything.h"') register_types(root_module) diff -r 2cc40b3e4fa5 -r 94ac3e381075 bindings/python/ns3modulescan.py --- a/bindings/python/ns3modulescan.py Tue Jul 08 10:43:58 2008 -0700 +++ b/bindings/python/ns3modulescan.py Wed Jul 09 14:58:02 2008 +0100 @@ -228,7 +228,7 @@ return '__main__' -def ns3_module_scan(top_builddir, pygen_file_name): +def ns3_module_scan(top_builddir, pygen_file_name, everything_h): ns3_modules = eval(sys.stdin.read()) @@ -239,7 +239,7 @@ for dep in ns3_module_deps: graph.append((dep, ns3_module_name)) sorted_ns3_modules = topsort(graph) - print >> sys.stderr, "******* topological sort: ", sorted_ns3_modules + #print >> sys.stderr, "******* topological sort: ", sorted_ns3_modules sections = [PygenSection('__main__', FileCodeSink(open(pygen_file_name, "wt")))] headers_map = {} # header_name -> section_name @@ -255,8 +255,8 @@ module_parser.add_pre_scan_hook(pre_scan_hook) #module_parser.add_post_scan_hook(post_scan_hook) - module_parser.parse_init([os.path.join(top_builddir, 'ns3', 'everything.h')], - include_paths=[top_builddir], whitelist_paths=[top_builddir], + module_parser.parse_init([everything_h], + include_paths=[top_builddir], whitelist_paths=[top_builddir, os.path.dirname(everything_h)], #includes=['"ns3/everything.h"'], pygen_sink=sections, pygen_classifier=MyPygenClassifier(headers_map)) @@ -277,5 +277,5 @@ if __name__ == '__main__': - ns3_module_scan(sys.argv[1], sys.argv[2]) + ns3_module_scan(sys.argv[1], sys.argv[3], sys.argv[2]) diff -r 2cc40b3e4fa5 -r 94ac3e381075 bindings/python/wscript --- a/bindings/python/wscript Tue Jul 08 10:43:58 2008 -0700 +++ b/bindings/python/wscript Wed Jul 09 14:58:02 2008 +0100 @@ -219,8 +219,8 @@ """ def __init__(self, *features): Object.task_gen.__init__(self, *features) - self.inst_var = 'INCLUDEDIR' - self.inst_dir = 'ns3' + self.inst_var = 0#'INCLUDEDIR' + #self.inst_dir = 'ns3' def apply(self): ## get all of the ns3 headers @@ -249,7 +249,7 @@ fatal("missing header file %s" % (source,)) all_headers_inputs.append(node) assert all_headers_inputs - all_headers_outputs = [ns3_dir_node.find_build("everything.h")] + all_headers_outputs = [self.path.find_build("everything.h")] task = self.create_task('gen-ns3-metaheader', self.env, 4) task.set_inputs(all_headers_inputs) task.set_outputs(all_headers_outputs) @@ -302,6 +302,7 @@ env['PYTHON'], os.path.join(curdir, 'ns3modulescan.py'), # scanning script bld.m_curdirnode.find_dir('../..').abspath(env), # include path (where the ns3 include dir is) + bld.m_curdirnode.find_build('everything.h').abspath(env), os.path.join(curdir, 'ns3modulegen_generated.py'), # output file ] scan = subprocess.Popen(argv, stdin=subprocess.PIPE) @@ -323,7 +324,7 @@ bindgen.output_file("ns3module.cc"), ] bindgen.argv.extend(get_modules_and_headers().iterkeys()) - bindgen.hidden_inputs = ['../../ns3/everything.h', + bindgen.hidden_inputs = ['everything.h', 'ns3modulegen_generated.py', 'ns3modulegen_core_customizations.py'] for module in get_modules_and_headers().iterkeys():