summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-11-10 11:51:18 -0800
committerNathan Binkert <nate@binkert.org>2008-11-10 11:51:18 -0800
commit4d64d7664c9c9c99a2172785829058a0e751e39f (patch)
tree4a2f60d46c718cde8cf698852f40725e7d029afb /SConstruct
parenteb5d9ba72b0309e7f98c382e3a80ce0601dbe084 (diff)
downloadgem5-4d64d7664c9c9c99a2172785829058a0e751e39f.tar.xz
SCons: Allow top level directory of EXTRAS able to contain SConscripts.
The current EXTRAS will fail if the top level directory pointed to by EXTRAS has a SConscript file in it. We allow this by including the directory name of the EXTRA in the build directory which prevents a clash between src/SConscript and extra/SConscript. Maintain compatibility with older uses of EXTRAS by adding a -I for each top level extra directory.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct13
1 files changed, 8 insertions, 5 deletions
diff --git a/SConstruct b/SConstruct
index ce34fa541..d33ed9079 100644
--- a/SConstruct
+++ b/SConstruct
@@ -324,11 +324,14 @@ global_sticky_opts.Save(global_sticky_opts_file, env)
# Parse EXTRAS option to build list of all directories where we're
# look for sources etc. This list is exported as base_dir_list.
-base_dir_list = [joinpath(ROOT, 'src')]
+base_dir = joinpath(ROOT, 'src')
if env['EXTRAS']:
- base_dir_list += env['EXTRAS'].split(':')
+ extras_dir_list = env['EXTRAS'].split(':')
+else:
+ extras_dir_list = []
-Export('base_dir_list')
+Export('base_dir')
+Export('extras_dir_list')
# M5_PLY is used by isa_parser.py to find the PLY package.
env.Append(ENV = { 'M5_PLY' : str(Dir('ext/ply')) })
@@ -594,8 +597,8 @@ Export('nonsticky_opts')
# Walk the tree and execute all SConsopts scripts that wil add to the
# above options
-for base_dir in base_dir_list:
- for root, dirs, files in os.walk(base_dir):
+for bdir in [ base_dir ] + extras_dir_list:
+ for root, dirs, files in os.walk(bdir):
if 'SConsopts' in files:
print "Reading", joinpath(root, 'SConsopts')
SConscript(joinpath(root, 'SConsopts'))