# HG changeset patch # User Edouard Tisserant # Date 1321444216 -3600 # Node ID 70c84e6ff92c405475d8b9b5b3d4307f6a07f839 # Parent 3c9fbe483124ee2f717b1405e5420cab62117c78 Xenomai build now ignores xeno-config if not set diff -r 3c9fbe483124 -r 70c84e6ff92c targets/Xenomai/__init__.py --- a/targets/Xenomai/__init__.py Tue Nov 08 22:39:44 2011 +0100 +++ b/targets/Xenomai/__init__.py Wed Nov 16 12:50:16 2011 +0100 @@ -3,29 +3,23 @@ class Xenomai_target(toolchain_gcc): extension = ".so" - def getXenoConfig(self): + def getXenoConfig(self, flagsname): """ Get xeno-config from target parameters """ - return self.PluginsRootInstance.GetTarget().getcontent()["value"].getXenoConfig() + xeno_config=self.PluginsRootInstance.GetTarget().getcontent()["value"].getXenoConfig() + if xeno_config: + status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger, + xeno_config + " --skin=native --"+flagsname, + no_stdout=True).spin() + if status: + self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's %s \n")%flagsname) + return [result.strip()] + return [] def getBuilderLDFLAGS(self): - # get xeno-config from target parameters - xeno_config = self.getXenoConfig() - - status, result, err_result = ProcessLogger(self.PluginsRootInstance.logger, xeno_config + " --skin=native --ldflags", no_stdout=True).spin() - if status: - self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's LDFLAGS\n")) - xeno_ldlags = result.strip() - - return toolchain_gcc.getBuilderLDFLAGS(self) + [xeno_ldlags, "-shared", "-lnative"] + xeno_ldflags = self.getXenoConfig("ldflags") + 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.PluginsRootInstance.logger, xeno_config + " --skin=native --cflags", no_stdout=True).spin() - if status: - self.PluginsRootInstance.logger.write_error(_("Unable to get Xenomai's CFLAGS\n")) - xeno_cflags = result.strip() + xeno_cflags = self.getXenoConfig("cflags") + return toolchain_gcc.getBuilderCFLAGS(self) + xeno_cflags - return toolchain_gcc.getBuilderCFLAGS(self) + [xeno_cflags] -