diff options
author | Chris Johns <chrisj@rtems.org> | 2015-07-20 13:49:42 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2015-07-20 13:49:42 +1000 |
commit | 6444d5806dbdd66dd23a18df824872eb84fbe248 (patch) | |
tree | 02c78ffb40d0ec8ff12a217482e290367eceb0ce /source-builder/sb/config.py | |
parent | rtems4.11: OpenMP support for ARM, PowerPC, SPARC (diff) | |
download | rtems-source-builder-6444d5806dbdd66dd23a18df824872eb84fbe248.tar.bz2 |
Canandian Cross Compiling and RTEMS 3rd party package building Fixes.
The change fixes installing for RTEMS 3rd Party packages where the
RSB considered them Canadian Cross Compiling (Cxc). Fixing the
Cxc issue broke real Cxc builds. The change corrects the issue of
macros being changed in the Cxc and the prep data not being udpated.
The configuration is loaded again after the updated macros. The
macros are also copied and restored to ensure a clean stable base.
The change also introduces --rtems-tools and --rtems-bsp to align
the command line with the waf configure process or RTEMS application.
Diffstat (limited to 'source-builder/sb/config.py')
-rw-r--r-- | source-builder/sb/config.py | 68 |
1 files changed, 38 insertions, 30 deletions
diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py index 1687d06..127112b 100644 --- a/source-builder/sb/config.py +++ b/source-builder/sb/config.py @@ -236,35 +236,14 @@ class file: re.compile('%disable') ] def __init__(self, name, opts, macros = None): + log.trace('config: %s: initialising' % (name)) self.opts = opts - if macros is None: - self.macros = opts.defaults - else: - self.macros = macros self.init_name = name - log.trace('config: %s' % (name)) - self.disable_macro_reassign = False - self.configpath = [] self.wss = re.compile(r'\s+') self.tags = re.compile(r':+') self.sf = re.compile(r'%\([^\)]+\)') - for arg in self.opts.args: - if arg.startswith('--with-') or arg.startswith('--without-'): - if '=' in arg: - label, value = arg.split('=', 1) - else: - label = arg - value = None - label = label[2:].lower().replace('-', '_') - if value: - self.macros.define(label, value) - else: - self.macros.define(label) - self._includes = [] - self.load_depth = 0 - self.pkgconfig_prefix = None - self.pkgconfig_crosscompile = False - self.pkgconfig_filter_flags = False + self.set_macros(macros) + self._reset(name) self.load(name) def __str__(self): @@ -286,6 +265,34 @@ class file: s += str(self._packages[_package]) return s + def _reset(self, name): + self.name = name + self.load_depth = 0 + self.configpath = [] + self._includes = [] + self._packages = {} + self.in_error = False + self.lc = 0 + self.conditionals = {} + self._packages = {} + self.package = 'main' + self.disable_macro_reassign = False + self.pkgconfig_prefix = None + self.pkgconfig_crosscompile = False + self.pkgconfig_filter_flags = False + for arg in self.opts.args: + if arg.startswith('--with-') or arg.startswith('--without-'): + if '=' in arg: + label, value = arg.split('=', 1) + else: + label = arg + value = None + label = label[2:].lower().replace('-', '_') + if value: + self.macros.define(label, value) + else: + self.macros.define(label) + def _relative_path(self, p): sbdir = None if '_sbdir' in self.macros: @@ -1053,6 +1060,12 @@ class file: def _info_append(self, info, data): self._packages[self.package].info_append(info, data) + def set_macros(self, macros): + if macros is None: + self.macros = opts.defaults + else: + self.macros = macros + def load(self, name): def common_end(left, right): @@ -1066,12 +1079,7 @@ class file: return end if self.load_depth == 0: - self.in_error = False - self.lc = 0 - self.name = name - self.conditionals = {} - self._packages = {} - self.package = 'main' + self._reset(name) self._packages[self.package] = package(self.package, self.define('%{_arch}'), self) |