targets/Xenomai/__init__.py
author Edouard Tisserant
Thu, 05 Feb 2015 23:32:31 +0100
changeset 1439 a68cd4253259
parent 1323 a2b1af39385c
child 1511 91538d0c242c
permissions -rwxr-xr-x
Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
from ..toolchain_gcc import toolchain_gcc

class Xenomai_target(toolchain_gcc):
    dlopen_prefix = "./"
    extension = ".so"
    def getXenoConfig(self, flagsname):
        """ Get xeno-config from target parameters """
        xeno_config=self.CTRInstance.GetTarget().getcontent().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"]