Merge with head.

--HG--
extra : convert_revision : e4be9d5f2ce8e3252958e2c5e03710b0bf9755c7
This commit is contained in:
Gabe Black 2007-07-26 22:13:48 -07:00
commit d4e69c006b
2 changed files with 21 additions and 2 deletions

View file

@ -435,6 +435,13 @@ all_isa_list.sort()
all_cpu_list.sort() all_cpu_list.sort()
default_cpus.sort() default_cpus.sort()
def ExtraPathValidator(key, val, env):
paths = val.split(':')
for path in paths:
path = os.path.expanduser(path)
if not isdir(path):
raise AttributeError, "Invalid path: '%s'" % path
sticky_opts.AddOptions( sticky_opts.AddOptions(
EnumOption('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list), EnumOption('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list),
BoolOption('FULL_SYSTEM', 'Full-system support', False), BoolOption('FULL_SYSTEM', 'Full-system support', False),
@ -461,7 +468,9 @@ sticky_opts.AddOptions(
('BATCH_CMD', 'Batch pool submission command name', 'qdo'), ('BATCH_CMD', 'Batch pool submission command name', 'qdo'),
('PYTHONHOME', ('PYTHONHOME',
'Override the default PYTHONHOME for this system (use with caution)', 'Override the default PYTHONHOME for this system (use with caution)',
'%s:%s' % (sys.prefix, sys.exec_prefix)) '%s:%s' % (sys.prefix, sys.exec_prefix)),
('EXTRAS', 'Add Extra directories to the compilation', '',
ExtraPathValidator)
) )
nonsticky_opts.AddOptions( nonsticky_opts.AddOptions(
@ -613,6 +622,8 @@ base_env = env
for build_path in build_paths: for build_path in build_paths:
print "Building in", build_path print "Building in", build_path
env['BUILDDIR'] = build_path
# build_dir is the tail component of build path, and is used to # build_dir is the tail component of build path, and is used to
# determine the build parameters (e.g., 'ALPHA_SE') # determine the build parameters (e.g., 'ALPHA_SE')
(build_root, build_dir) = os.path.split(build_path) (build_root, build_dir) = os.path.split(build_path)

View file

@ -151,7 +151,6 @@ env.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
# #
# Walk the tree and execute all SConscripts # Walk the tree and execute all SConscripts
# #
scripts = []
srcdir = env['SRCDIR'] srcdir = env['SRCDIR']
for root, dirs, files in os.walk(srcdir, topdown=True): for root, dirs, files in os.walk(srcdir, topdown=True):
if root == srcdir: if root == srcdir:
@ -164,6 +163,15 @@ for root, dirs, files in os.walk(srcdir, topdown=True):
base = root[len(srcdir) + 1:] base = root[len(srcdir) + 1:]
SConscript(joinpath(base, 'SConscript')) SConscript(joinpath(base, 'SConscript'))
for extra in env['EXTRAS'].split(':'):
extra = os.path.expanduser(extra)
env.Append(CPPPATH=[Dir(extra)])
for root, dirs, files in os.walk(extra, topdown=True):
if 'SConscript' in files:
subdir = root[len(os.path.dirname(extra))+1:]
build_dir = joinpath(env['BUILDDIR'], subdir)
SConscript(joinpath(root, 'SConscript'), build_dir=build_dir)
for opt in env.ExportOptions: for opt in env.ExportOptions:
env.ConfigFile(opt) env.ConfigFile(opt)