targets/Xenomai/__init__.py
author laurent
Thu, 08 Oct 2009 11:01:19 +0200
changeset 408 6eaa1908507d
parent 361 331d698e1118
child 411 8261c8f1e365
permissions -rwxr-xr-x
Bug on DebugVariablePanel when opening project at start fixed
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"
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     6
    def getXenoConfig(self):
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     7
        """ Get xeno-config from target parameters """
329
22e65b8e20f4 add autostart plc feature for beremiz_service
greg
parents: 321
diff changeset
     8
        return self.PluginsRootInstance.BeremizRoot.getTargetType().getcontent()["value"].getXenoConfig()
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     9
    
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    10
    def getBuilderLDFLAGS(self):
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    11
        # get xeno-config from target parameters
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    12
        xeno_config = self.getXenoConfig()
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    13
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    14
        status, result, err_result = ProcessLogger(self.logger, xeno_config + " --xeno-ldflags", no_stdout=True).spin()
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    15
        if status:
361
331d698e1118 Adding support for internationalization
laurent
parents: 329
diff changeset
    16
            self.logger.write_error(_("Unable to get Xenomai's LDFLAGS\n"))
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    17
        xeno_ldlags = result.strip()
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    18
        
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    19
        return toolchain_gcc.getBuilderLDFLAGS(self) + [xeno_ldlags, "-shared", "-lnative"]
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    20
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    21
    def getBuilderCFLAGS(self):
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    22
        # get xeno-config from target parameters
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    23
        xeno_config = self.getXenoConfig()
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    24
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    25
        status, result, err_result = ProcessLogger(self.logger, xeno_config + " --xeno-cflags", no_stdout=True).spin()
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    26
        if status:
361
331d698e1118 Adding support for internationalization
laurent
parents: 329
diff changeset
    27
            self.logger.write_error(_("Unable to get Xenomai's CFLAGS\n"))
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    28
        xeno_cflags = result.strip()
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    29
        
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    30
        return toolchain_gcc.getBuilderCFLAGS(self) + [xeno_cflags]
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    31