Changeset 6444d58 in rtems-source-builder for source-builder/sb/config.py


Ignore:
Timestamp:
Jul 20, 2015, 3:49:42 AM (5 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.9, 5, master
Children:
f936478
Parents:
fba2549
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/config.py

    rfba2549 r6444d58  
    237237
    238238    def __init__(self, name, opts, macros = None):
     239        log.trace('config: %s: initialising' % (name))
    239240        self.opts = opts
    240         if macros is None:
    241             self.macros = opts.defaults
    242         else:
    243             self.macros = macros
    244241        self.init_name = name
    245         log.trace('config: %s' % (name))
    246         self.disable_macro_reassign = False
    247         self.configpath = []
    248242        self.wss = re.compile(r'\s+')
    249243        self.tags = re.compile(r':+')
    250244        self.sf = re.compile(r'%\([^\)]+\)')
    251         for arg in self.opts.args:
    252             if arg.startswith('--with-') or arg.startswith('--without-'):
    253                 if '=' in arg:
    254                     label, value = arg.split('=', 1)
    255                 else:
    256                     label = arg
    257                     value = None
    258                 label = label[2:].lower().replace('-', '_')
    259                 if value:
    260                     self.macros.define(label, value)
    261                 else:
    262                     self.macros.define(label)
    263         self._includes = []
    264         self.load_depth = 0
    265         self.pkgconfig_prefix = None
    266         self.pkgconfig_crosscompile = False
    267         self.pkgconfig_filter_flags = False
     245        self.set_macros(macros)
     246        self._reset(name)
    268247        self.load(name)
    269248
     
    286265            s += str(self._packages[_package])
    287266        return s
     267
     268    def _reset(self, name):
     269        self.name = name
     270        self.load_depth = 0
     271        self.configpath = []
     272        self._includes = []
     273        self._packages = {}
     274        self.in_error = False
     275        self.lc = 0
     276        self.conditionals = {}
     277        self._packages = {}
     278        self.package = 'main'
     279        self.disable_macro_reassign = False
     280        self.pkgconfig_prefix = None
     281        self.pkgconfig_crosscompile = False
     282        self.pkgconfig_filter_flags = False
     283        for arg in self.opts.args:
     284            if arg.startswith('--with-') or arg.startswith('--without-'):
     285                if '=' in arg:
     286                    label, value = arg.split('=', 1)
     287                else:
     288                    label = arg
     289                    value = None
     290                label = label[2:].lower().replace('-', '_')
     291                if value:
     292                    self.macros.define(label, value)
     293                else:
     294                    self.macros.define(label)
    288295
    289296    def _relative_path(self, p):
     
    10541061        self._packages[self.package].info_append(info, data)
    10551062
     1063    def set_macros(self, macros):
     1064        if macros is None:
     1065            self.macros = opts.defaults
     1066        else:
     1067            self.macros = macros
     1068
    10561069    def load(self, name):
    10571070
     
    10671080
    10681081        if self.load_depth == 0:
    1069             self.in_error = False
    1070             self.lc = 0
    1071             self.name = name
    1072             self.conditionals = {}
    1073             self._packages = {}
    1074             self.package = 'main'
     1082            self._reset(name)
    10751083            self._packages[self.package] = package(self.package,
    10761084                                                   self.define('%{_arch}'),
Note: See TracChangeset for help on using the changeset viewer.