targets/Xenomai/__init__.py
author laurent
Wed, 28 Mar 2012 00:05:35 +0200
changeset 707 6880c88e499e
parent 642 cd7ccbbbf471
child 717 1c23952dbde1
permissions -rwxr-xr-x
Fix bug in debugger when transfer without having build before and and opening debug view before running PLC
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.PluginsRootInstance.GetTarget().getcontent()["value"].getXenoConfig()
        if xeno_config:
            from wxPopen import ProcessLogger
            status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger,
                                                       xeno_config + " --skin=native --"+flagsname,
                                                       no_stdout=True).spin()
            if status:
                self.PluginsRootInstance.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"]