summaryrefslogtreecommitdiff
path: root/scons/custom.py
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2012-08-14 12:18:45 +0100
committerJosé Fonseca <jfonseca@vmware.com>2012-08-14 12:19:56 +0100
commitea8dcfc90d5abbf699cd64be4dccd1e69fe82d75 (patch)
treeb455ea19ab8b015cf925605da801f8cf11886b0f /scons/custom.py
parent605f964d5cc7016fc74e0563829fa794da845c20 (diff)
scons: Populate top_srcdir and top_builddir variables when reading Makefiles.sources.
This is not entirely correct, as scons doesn't put binaries in a "src" subdirectory, but doesn't seem to be a problem for now.
Diffstat (limited to 'scons/custom.py')
-rw-r--r--scons/custom.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scons/custom.py b/scons/custom.py
index cc953bd999a..43e7727aa42 100644
--- a/scons/custom.py
+++ b/scons/custom.py
@@ -235,6 +235,10 @@ def parse_source_list(env, filename, names=None):
# parse the source list file
parser = source_list.SourceListParser()
src = env.File(filename).srcnode()
+
+ parser.add_symbol('top_srcdir', env.Dir('#').abspath)
+ parser.add_symbol('top_builddir', env['build_dir'])
+
sym_table = parser.parse(src.abspath)
if names: