targets/Xenomai/__init__.py
author Edouard Tisserant
Wed, 16 Nov 2011 17:12:16 +0100
changeset 634 5b925a1d8fed
parent 633 70c84e6ff92c
child 635 fcdb60cacb2c
permissions -rwxr-xr-x
fixed redondant ldflag and a typo in xenomai build
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     1
from .. import toolchain_gcc
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     2
from wxPopen import ProcessLogger
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     3
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     4
class Xenomai_target(toolchain_gcc):
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     5
    extension = ".so"
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
     6
    def getXenoConfig(self, flagsname):
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     7
        """ Get xeno-config from target parameters """
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
     8
        xeno_config=self.PluginsRootInstance.GetTarget().getcontent()["value"].getXenoConfig()
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
     9
        if xeno_config:
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    10
            status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger,
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    11
                                                       xeno_config + " --skin=native --"+flagsname,
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    12
                                                       no_stdout=True).spin()
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    13
            if status:
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    14
                self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's %s \n")%flagsname)
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    15
            return [result.strip()]
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    16
        return []
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    17
    
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    18
    def getBuilderLDFLAGS(self):
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    19
        xeno_ldflags = self.getXenoConfig("ldflags")
634
5b925a1d8fed fixed redondant ldflag and a typo in xenomai build
Edouard Tisserant
parents: 633
diff changeset
    20
        return toolchain_gcc.getBuilderLDFLAGS(self) + xeno_ldflags + ["-shared"]
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    21
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    22
    def getBuilderCFLAGS(self):
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    23
        xeno_cflags = self.getXenoConfig("cflags")
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    24
        return toolchain_gcc.getBuilderCFLAGS(self) + xeno_cflags
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    25