COMPMID-1828: Allow the user to override the toolchain prefix

Change-Id: Ib04d3761a3a5211d5fbcdc7040223825bef82351
Reviewed-on: https://review.mlplatform.org/354
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/SConstruct b/SConstruct
index 49b1d17..e6c89bc 100644
--- a/SConstruct
+++ b/SConstruct
@@ -58,6 +58,7 @@
     BoolVariable("exceptions", "Enable/disable C++ exception support", True),
     #FIXME Remove before release (And remove all references to INTERNAL_ONLY)
     BoolVariable("internal_only", "Enable ARM internal only tests", False),
+    ("toolchain_prefix", "Override the toolchain prefix", ""),
     ("extra_cxx_flags", "Extra CXX flags to be appended to the build command", ""),
     ("extra_link_flags", "Extra LD flags to be appended to the build command", ""),
     ("compiler_cache", "Command to prefix to the C and C++ compiler (e.g ccache)", "")
@@ -211,6 +212,9 @@
 if env['build'] == 'native':
     prefix = ""
 
+if env["toolchain_prefix"] != "":
+    prefix = env["toolchain_prefix"]
+
 env['CC'] = env['compiler_cache']+" "+prefix + c_compiler
 env['CXX'] = env['compiler_cache']+" "+prefix + cpp_compiler
 env['LD'] = prefix + "ld"