aboutsummaryrefslogtreecommitdiff
path: root/mesalib/scons/custom.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-17 10:55:40 +0200
committermarha <marha@users.sourceforge.net>2012-08-17 10:55:40 +0200
commit6d3ef5c3fe5b69e59e3511202db6a66f71c2f234 (patch)
tree3830d989b529135e92edb6004aa368f287ed20c5 /mesalib/scons/custom.py
parentcf506c799c2281867a28ac33ac985994918bc0ba (diff)
parent5d9b8cf0e4054e774f906cde9dd6b61ceca72d44 (diff)
downloadvcxsrv-6d3ef5c3fe5b69e59e3511202db6a66f71c2f234.tar.gz
vcxsrv-6d3ef5c3fe5b69e59e3511202db6a66f71c2f234.tar.bz2
vcxsrv-6d3ef5c3fe5b69e59e3511202db6a66f71c2f234.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/scons/custom.py')
-rw-r--r--mesalib/scons/custom.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/mesalib/scons/custom.py b/mesalib/scons/custom.py
index 43e7727aa..277c05b67 100644
--- a/mesalib/scons/custom.py
+++ b/mesalib/scons/custom.py
@@ -236,8 +236,13 @@ def parse_source_list(env, filename, names=None):
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'])
+ cur_srcdir = env.Dir('.').srcnode().abspath
+ top_srcdir = env.Dir('#').abspath
+ top_builddir = os.path.join(top_srcdir, env['build_dir'])
+
+ # Populate the symbol table of the Makefile parser.
+ parser.add_symbol('top_srcdir', top_srcdir)
+ parser.add_symbol('top_builddir', top_builddir)
sym_table = parser.parse(src.abspath)
@@ -253,7 +258,21 @@ def parse_source_list(env, filename, names=None):
src_lists = {}
for sym in symbols:
val = sym_table[sym]
- src_lists[sym] = [f for f in val.split(' ') if f]
+ srcs = []
+ for f in val.split():
+ if f:
+ # Process source paths
+ if f.startswith(top_builddir + '/src'):
+ # Automake puts build output on a `src` subdirectory, bue
+ # SCons does no, so strip it here.
+ f = top_builddir + f[len(top_builddir + '/src'):]
+ if f.startswith(cur_srcdir + '/'):
+ # Prefer relative source paths, as absolute files tend to
+ # cause duplicate actions.
+ f = f[len(cur_srcdir + '/'):]
+ srcs.append(f)
+
+ src_lists[sym] = srcs
# if names are given, concatenate the lists
if names: