Adrian Herrera has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/38416 )
Change subject: util: m5ops, optional extra build flags
......................................................................
util: m5ops, optional extra build flags
This increases compilation control for users. Main use case is building
m5ops as part of an image distribution. Specifying a different sysroot
or dynamic linker may be required when the cross toolchain is built as
part of the process.
Change-Id: Icbd3faa92ea6e084fc4a9b2db83129bce73faf21
Signed-off-by: Adrian Herrera <[email protected]>
---
M util/m5/SConstruct
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/util/m5/SConstruct b/util/m5/SConstruct
index 6f1ca9f..61cee6a 100644
--- a/util/m5/SConstruct
+++ b/util/m5/SConstruct
@@ -197,16 +197,22 @@
#
# This also considers scons command line settings which may look
like
# environment variables, but are set after "scons" on the command
line.
- def get_abi_opt(name, default):
+ def get_abi_opt_val(name, default):
var_name = env.subst('${ABI}.%s' % name)
- env[name] = os.environ.get(
- var_name, ARGUMENTS.get(var_name, default))
+ return os.environ.get(var_name, ARGUMENTS.get(var_name,
default))
+ def get_abi_opt(name, default):
+ env[name] = get_abi_opt_val(name, default)
# Process the ABI's settings in the SConsopts file, storing them
# in a copy of the primary environment.
env.SConscript(Dir(root).File('SConsopts'),
exports=[ 'env', 'get_abi_opt' ])
+ # The user can pass extra build flags for each ABI
+ env.Append(CFLAGS=[get_abi_opt_val('CFLAGS', '')])
+ env.Append(CXXFLAGS=[get_abi_opt_val('CXXFLAGS', '')])
+ env.Append(CXXFLAGS=[get_abi_opt_val('LDFLAGS', '')])
+
# Check if this version of QEMU is available for running unit
tests.
env['HAVE_QEMU'] = env.Detect('${QEMU}') is not None
if env['HAVE_QEMU'] and env.Detect('${CC}'):
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38416
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Icbd3faa92ea6e084fc4a9b2db83129bce73faf21
Gerrit-Change-Number: 38416
Gerrit-PatchSet: 1
Gerrit-Owner: Adrian Herrera <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s