diff options
author | Steve Reinhardt <stever@gmail.com> | 2007-11-16 20:10:33 -0800 |
---|---|---|
committer | Steve Reinhardt <stever@gmail.com> | 2007-11-16 20:10:33 -0800 |
commit | 785eb131907c4a3e326598643fc9b72b96911278 (patch) | |
tree | 153940765b513233bdd785fec7b96de7c62e4e8d /SConstruct | |
parent | 21a99af0099f35a35072e3e929f42cb8caed5017 (diff) | |
download | gem5-785eb131907c4a3e326598643fc9b72b96911278.tar.xz |
Make EXTRAS work for relative directories.
Also print a little feedback when processing EXTRAS.
--HG--
extra : convert_revision : 9cb324b0d5bc60a3c98af6495f16415b529e4af2
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct index c87ac50f5..38fbe8d4c 100644 --- a/SConstruct +++ b/SConstruct @@ -68,6 +68,8 @@ import os from os.path import isdir, join as joinpath +import SCons + # Check for recent-enough Python and SCons versions. If your system's # default installation of Python is not recent enough, you can use a # non-default installation of the Python interpreter by either (1) @@ -472,14 +474,19 @@ all_isa_list.sort() all_cpu_list.sort() default_cpus.sort() -def ExtraPathValidator(key, val, env): +def PathListMakeAbsolute(val): + if not val: + return val + f = lambda p: os.path.abspath(os.path.expanduser(p)) + return ':'.join(map(f, val.split(':'))) + +def PathListAllExist(key, val, env): if not val: return paths = val.split(':') for path in paths: - path = os.path.expanduser(path) if not isdir(path): - raise AttributeError, "Invalid path: '%s'" % path + raise SCons.Errors.UserError("Path does not exist: '%s'" % path) sticky_opts.AddOptions( EnumOption('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list), @@ -509,7 +516,7 @@ sticky_opts.AddOptions( 'Override the default PYTHONHOME for this system (use with caution)', '%s:%s' % (sys.prefix, sys.exec_prefix)), ('EXTRAS', 'Add Extra directories to the compilation', '', - ExtraPathValidator) + PathListAllExist, PathListMakeAbsolute) ) nonsticky_opts.AddOptions( |