From b8c1e370faca4513c102e17e57f2e00791189644 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sun, 13 Mar 2016 17:47:33 -0700 Subject: [PATCH] scons: fix building in non-standard locations It's apparently not widely known that our scons scripts allow you to put the build directory wherever you want; not only does it not have to be immediately under the root of your repo, it doesn't even have to be underneath the root at all. (For example, sometimes it's useful to build on a local disk if your repo is on a slow NFS mount.) I point this out because this functionality has been broken for close to two years but no one seems to have noticed yet. This patch fixes an assumption that crept in in changeset be0e1724eb39 (May 09 2014) that the build dir would be immediately under the top level of the repo, preventing builds anywhere else. --- src/SConscript | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SConscript b/src/SConscript index 9b6c2170b..d0835bda3 100755 --- a/src/SConscript +++ b/src/SConscript @@ -1251,7 +1251,6 @@ needed_envs = [identifyTarget(target) for target in BUILD_TARGETS] if 'all' in needed_envs: needed_envs += target_types -gem5_root = Dir('.').up().up().abspath def makeEnvirons(target, source, env): # cause any later Source() calls to be fatal, as a diagnostic. Source.done() @@ -1300,7 +1299,7 @@ def makeEnvirons(target, source, env): # Set up the regression tests for each build. for e in envList: - SConscript(os.path.join(gem5_root, 'tests', 'SConscript'), + SConscript(os.path.join(env.root.abspath, 'tests', 'SConscript'), variant_dir = variantd('tests', e.Label), exports = { 'env' : e }, duplicate = False) -- 2.30.2