Changeset 6444d58 in rtems-source-builder for source-builder/sb/options.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/options.py

    rfba2549 r6444d58  
    222222        print '--with-<label>         : Add the --with-<label> to the build'
    223223        print '--without-<label>      : Add the --without-<label> to the build'
     224        print '--rtems-tools path     : Path to an install RTEMS tool set'
     225        print '--rtems-bsp arc/bsp    : Standard RTEMS architecure and BSP specifier'
     226        print '--rtems-version ver    : The RTEMS major/minor version string'
    224227        if self.optargs:
    225228            for a in self.optargs:
     
    298301            if path.exists(rsb_macros):
    299302                self.defaults.load(rsb_macros)
    300         # If a Cxc build disable installing.
    301         if self.canadian_cross():
    302             self.opts['no-install'] = '1'
    303             self.defaults['_no_install'] = '1'
    304303
    305304    def sb_git(self):
     
    451450    def get_arg(self, arg):
    452451        if self.optargs is None or arg not in self.optargs:
    453             raise error.internal('bad arg: %s' % (arg))
     452            return None
    454453        return self.parse_args(arg)
    455454
     
    517516        return self.opts['no-download'] != '0'
    518517
     518    def disable_install(self):
     519        self.opts['no-install'] = '1'
     520
    519521    def info(self):
    520522        s = ' Command Line: %s%s' % (' '.join(self.argv), os.linesep)
     
    524526    def log_info(self):
    525527        log.output(self.info())
     528
     529    def rtems_options(self):
     530        # Check for RTEMS specific helper options.
     531        rtems_tools = self.parse_args('--rtems-tools')
     532        if rtems_tools is not None:
     533            if self.get_arg('--with-tools') is not None:
     534                raise error.general('--rtems-tools and --with-tools cannot be used together')
     535            self.args.append('--with-tools=%s' % (rtems_tools[1]))
     536        rtems_arch_bsp = self.parse_args('--rtems-bsp')
     537        if rtems_arch_bsp is not None:
     538            if self.get_arg('--target') is not None:
     539                raise error.general('--rtems-bsp and --target cannot be used together')
     540            ab = rtems_arch_bsp[1].split('/')
     541            if len(ab) != 2:
     542                raise error.general('invalid --rtems-bsp option')
     543            rtems_version = self.parse_args('--rtems-version')
     544            if rtems_version is None:
     545                rtems_version = '%d.%d' % (version.major, version.minor)
     546            else:
     547                rtems_version = rtems_version[1]
     548            self.args.append('--target=%s-rtems%s' % (ab[0], rtems_version))
     549            self.args.append('--with-rtems-bsp=%s' % (ab[1]))
    526550
    527551def load(args, optargs = None, defaults = '%{_sbdir}/defaults.mc'):
     
    591615
    592616    o.sb_git()
     617    o.rtems_options()
    593618    o.process()
    594619    o.post_process()
Note: See TracChangeset for help on using the changeset viewer.