targets/Xenomai/__init__.py
author laurent
Fri, 30 Sep 2011 17:12:27 +0200
changeset 619 8584ddae9385
parent 615 72bc3e53a1fa
child 633 70c84e6ff92c
permissions -rwxr-xr-x
Fixes after moving xmlclass and docutils into plcopeneditor
from .. import toolchain_gcc
from wxPopen import ProcessLogger

class Xenomai_target(toolchain_gcc):
    extension = ".so"
    def getXenoConfig(self):
        """ Get xeno-config from target parameters """
        return self.PluginsRootInstance.GetTarget().getcontent()["value"].getXenoConfig()
    
    def getBuilderLDFLAGS(self):
        # get xeno-config from target parameters
        xeno_config = self.getXenoConfig()

        status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger, xeno_config + " --skin=native --ldflags", no_stdout=True).spin()
        if status:
            self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's LDFLAGS\n"))
        xeno_ldlags = result.strip()
        
        return toolchain_gcc.getBuilderLDFLAGS(self) + [xeno_ldlags, "-shared", "-lnative"]

    def getBuilderCFLAGS(self):
        # get xeno-config from target parameters
        xeno_config = self.getXenoConfig()

        status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger, xeno_config + " --skin=native --cflags", no_stdout=True).spin()
        if status:
            self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's CFLAGS\n"))
        xeno_cflags = result.strip()
        
        return toolchain_gcc.getBuilderCFLAGS(self) + [xeno_cflags]