--- a/targets/toolchain_gcc.py Thu Oct 08 11:09:01 2009 +0200
+++ b/targets/toolchain_gcc.py Thu Oct 08 11:26:40 2009 +0200
@@ -19,18 +19,24 @@
self.md5key = None
self.srcmd5 = {}
+ def getTarget(self):
+ target = self.PluginsRootInstance.BeremizRoot.getTargetType()
+ if target.getcontent() is None:
+ target = self.PluginsRootInstance.GetDefaultTarget()
+ return target
+
def getBuilderCFLAGS(self):
"""
Returns list of builder specific CFLAGS
"""
- return [self.PluginsRootInstance.BeremizRoot.getTargetType().getcontent()["value"].getCFLAGS()]
+ return [self.getTarget().getcontent()["value"].getCFLAGS()]
def getBuilderLDFLAGS(self):
"""
Returns list of builder specific LDFLAGS
"""
return self.PluginsRootInstance.LDFLAGS + \
- [self.PluginsRootInstance.BeremizRoot.getTargetType().getcontent()["value"].getLDFLAGS()]
+ [self.getTarget().getcontent()["value"].getLDFLAGS()]
def GetBinaryCode(self):
try:
@@ -78,7 +84,7 @@
def build(self):
# Retrieve toolchain user parameters
- toolchain_params = self.PluginsRootInstance.BeremizRoot.getTargetType().getcontent()["value"]
+ toolchain_params = self.getTarget().getcontent()["value"]
self.compiler = toolchain_params.getCompiler()
self.linker = toolchain_params.getLinker()