targets/Xenomai/__init__.py
author lbessard
Mon, 23 Mar 2009 16:26:13 +0100
changeset 323 9f07f0d429df
parent 321 5a4e6278a18b
child 329 22e65b8e20f4
permissions -rwxr-xr-x
Fix bug preventing library to re-compiled when dependant files changed.
Fix bug preventing to re-compile a file without changes even when file miscompiled.
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.PuginsRootInstance.BeremizRoot.getTargetType().getcontent()["value"].getXenoConfig()
    
    def getBuilderLDFLAGS(self):
        # get xeno-config from target parameters
        xeno_config = self.getXenoConfig()

        status, result, err_result = ProcessLogger(self.logger, xeno_config + " --xeno-ldflags", no_stdout=True).spin()
        if status:
            self.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.logger, xeno_config + " --xeno-cflags", no_stdout=True).spin()
        if status:
            self.logger.write_error("Unable to get Xenomai's CFLAGS\n")
        xeno_cflags = result.strip()
        
        return toolchain_gcc.getBuilderCFLAGS(self) + [xeno_cflags]