targets/Xenomai/__init__.py
author Edouard Tisserant
Tue, 24 May 2011 00:36:08 +0200
changeset 606 780bd150ebba
parent 510 8038c08b9874
child 615 72bc3e53a1fa
permissions -rwxr-xr-x
Fixed runtime with twisted but without Wx (-x 0 -t 1), made non-Zeroconf a default option, i.e when -n not specified
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 + " --xeno-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 + " --xeno-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]