targets/Xenomai/__init__.py
author Edouard Tisserant
Sat, 01 Sep 2012 16:32:15 +0200
changeset 809 b86b8898fd52
parent 726 ae63ccc29444
child 1279 0eb9f8af479f
permissions -rwxr-xr-x
Stripped out splash screen version information
from ..toolchain_gcc import toolchain_gcc

class Xenomai_target(toolchain_gcc):
    extension = ".so"
    def getXenoConfig(self, flagsname):
        """ Get xeno-config from target parameters """
        xeno_config=self.CTRInstance.GetTarget().getcontent()["value"].getXenoConfig()
        if xeno_config:
            from util.ProcessLogger import ProcessLogger
            status, result, err_result = ProcessLogger(self.CTRInstance.logger,
                                                       xeno_config + " --skin=native --"+flagsname,
                                                       no_stdout=True).spin()
            if status:
                self.CTRInstance.logger.write_error(_("Unable to get Xenomai's %s \n")%flagsname)
            return [result.strip()]
        return []
    
    def getBuilderLDFLAGS(self):
        xeno_ldflags = self.getXenoConfig("ldflags")
        return toolchain_gcc.getBuilderLDFLAGS(self) + xeno_ldflags + ["-shared"]

    def getBuilderCFLAGS(self):
        xeno_cflags = self.getXenoConfig("cflags")
        return toolchain_gcc.getBuilderCFLAGS(self) + xeno_cflags + ["-fPIC"]