From: Gabe Black Date: Mon, 10 Sep 2007 23:42:41 +0000 (-0700) Subject: Fix for leaving EXTRAS blank X-Git-Tag: m5_2.0_beta4~111 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87408d5ad27c7240d9169c0becd0cd01725c2a80;p=gem5.git Fix for leaving EXTRAS blank Apparently env['EXTRAS'] will return an empty string if not set. split will then split it into an empty string, and normalize will turn "" into ".". --HG-- extra : convert_revision : f79efebb129fdd65161fcf4d4582c2a8541aeacd --- diff --git a/src/SConscript b/src/SConscript index a4bd55269..a2df88c06 100644 --- a/src/SConscript +++ b/src/SConscript @@ -163,15 +163,17 @@ for root, dirs, files in os.walk(srcdir, topdown=True): base = root[len(srcdir) + 1:] SConscript(joinpath(base, 'SConscript')) -for extra in env['EXTRAS'].split(':'): - extra = os.path.expanduser(extra) - extra = os.path.normpath(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) +extra_string = env['EXTRAS'] +if extra_string and extra_string != '' and not extra_string.isspace(): + for extra in extra_string.split(':'): + extra = os.path.expanduser(extra) + extra = os.path.normpath(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: env.ConfigFile(opt)