From c95c773d1750de4f1bbdf451ea38aef8d1ed196d Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Sat, 26 Jul 2008 15:10:34 +0100 Subject: [PATCH] When generating the everything.h header file for Python, handle ns3 headers inside subdirectories properly. --- bindings/python/wscript | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bindings/python/wscript b/bindings/python/wscript index 9f0b33811..9713505e6 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -186,9 +186,19 @@ def get_header_prio(header): return prio return 1 + +def calc_header_include(path): + (head, tail) = os.path.split (path) + if tail == 'ns3': + return '' + else: + return os.path.join (calc_header_include (head), tail) + + def gen_ns3_metaheader(task): assert len(task.m_outputs) == 1 - header_files = [os.path.basename(node.abspath(task.m_env)) for node in task.m_inputs] + + header_files = [calc_header_include(node.abspath(task.m_env)) for node in task.m_inputs] outfile = file(task.m_outputs[0].bldpath(task.m_env), "w") def sort_func(h1, h2): @@ -243,8 +253,8 @@ class all_ns3_headers_taskgen(Object.task_gen): continue for source in ns3headers.to_list(ns3headers.source): - source = os.path.basename(source) - node = ns3_dir_node.find_build(os.path.basename(source)) + #source = os.path.basename(source) + node = ns3_dir_node.find_build(source) if node is None: fatal("missing header file %s" % (source,)) all_headers_inputs.append(node)