1 from .. import toolchain_gcc |
1 from .. import toolchain_gcc |
2 from wxPopen import ProcessLogger |
2 from wxPopen import ProcessLogger |
3 |
3 |
4 class Xenomai_target(toolchain_gcc): |
4 class Xenomai_target(toolchain_gcc): |
5 extension = ".so" |
5 extension = ".so" |
6 def getXenoConfig(self): |
6 def getXenoConfig(self, flagsname): |
7 """ Get xeno-config from target parameters """ |
7 """ Get xeno-config from target parameters """ |
8 return self.PluginsRootInstance.GetTarget().getcontent()["value"].getXenoConfig() |
8 xeno_config=self.PluginsRootInstance.GetTarget().getcontent()["value"].getXenoConfig() |
|
9 if xeno_config: |
|
10 status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger, |
|
11 xeno_config + " --skin=native --"+flagsname, |
|
12 no_stdout=True).spin() |
|
13 if status: |
|
14 self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's %s \n")%flagsname) |
|
15 return [result.strip()] |
|
16 return [] |
9 |
17 |
10 def getBuilderLDFLAGS(self): |
18 def getBuilderLDFLAGS(self): |
11 # get xeno-config from target parameters |
19 xeno_ldflags = self.getXenoConfig("ldflags") |
12 xeno_config = self.getXenoConfig() |
20 return toolchain_gcc.getBuilderLDFLAGS(self) + xeno_ldlags + ["-shared", "-lnative"] |
13 |
|
14 status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger, xeno_config + " --skin=native --ldflags", no_stdout=True).spin() |
|
15 if status: |
|
16 self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's LDFLAGS\n")) |
|
17 xeno_ldlags = result.strip() |
|
18 |
|
19 return toolchain_gcc.getBuilderLDFLAGS(self) + [xeno_ldlags, "-shared", "-lnative"] |
|
20 |
21 |
21 def getBuilderCFLAGS(self): |
22 def getBuilderCFLAGS(self): |
22 # get xeno-config from target parameters |
23 xeno_cflags = self.getXenoConfig("cflags") |
23 xeno_config = self.getXenoConfig() |
24 return toolchain_gcc.getBuilderCFLAGS(self) + xeno_cflags |
24 |
|
25 status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger, xeno_config + " --skin=native --cflags", no_stdout=True).spin() |
|
26 if status: |
|
27 self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's CFLAGS\n")) |
|
28 xeno_cflags = result.strip() |
|
29 |
25 |
30 return toolchain_gcc.getBuilderCFLAGS(self) + [xeno_cflags] |
|
31 |
|