summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/options.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2015-07-20 13:49:42 +1000
committerChris Johns <chrisj@rtems.org>2015-07-20 13:49:42 +1000
commit6444d5806dbdd66dd23a18df824872eb84fbe248 (patch)
tree02c78ffb40d0ec8ff12a217482e290367eceb0ce /source-builder/sb/options.py
parentrtems4.11: OpenMP support for ARM, PowerPC, SPARC (diff)
downloadrtems-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/options.py')
-rw-r--r--source-builder/sb/options.py35
1 files changed, 30 insertions, 5 deletions
diff --git a/source-builder/sb/options.py b/source-builder/sb/options.py
index e4964f0..c611dfe 100644
--- a/source-builder/sb/options.py
+++ b/source-builder/sb/options.py
@@ -221,6 +221,9 @@ class command_line:
print '--libstdcxxflags flags : List of C++ flags to build the target libstdc++ code'
print '--with-<label> : Add the --with-<label> to the build'
print '--without-<label> : Add the --without-<label> to the build'
+ print '--rtems-tools path : Path to an install RTEMS tool set'
+ print '--rtems-bsp arc/bsp : Standard RTEMS architecure and BSP specifier'
+ print '--rtems-version ver : The RTEMS major/minor version string'
if self.optargs:
for a in self.optargs:
print '%-22s : %s' % (a, self.optargs[a])
@@ -297,10 +300,6 @@ class command_line:
rsb_macros = path.join(os.environ['HOME'], '.rsb_macros')
if path.exists(rsb_macros):
self.defaults.load(rsb_macros)
- # If a Cxc build disable installing.
- if self.canadian_cross():
- self.opts['no-install'] = '1'
- self.defaults['_no_install'] = '1'
def sb_git(self):
repo = git.repo(self.defaults.expand('%{_sbdir}'), self)
@@ -450,7 +449,7 @@ class command_line:
def get_arg(self, arg):
if self.optargs is None or arg not in self.optargs:
- raise error.internal('bad arg: %s' % (arg))
+ return None
return self.parse_args(arg)
def with_arg(self, label):
@@ -516,6 +515,9 @@ class command_line:
def download_disabled(self):
return self.opts['no-download'] != '0'
+ def disable_install(self):
+ self.opts['no-install'] = '1'
+
def info(self):
s = ' Command Line: %s%s' % (' '.join(self.argv), os.linesep)
s += ' Python: %s' % (sys.version.replace('\n', ''))
@@ -524,6 +526,28 @@ class command_line:
def log_info(self):
log.output(self.info())
+ def rtems_options(self):
+ # Check for RTEMS specific helper options.
+ rtems_tools = self.parse_args('--rtems-tools')
+ if rtems_tools is not None:
+ if self.get_arg('--with-tools') is not None:
+ raise error.general('--rtems-tools and --with-tools cannot be used together')
+ self.args.append('--with-tools=%s' % (rtems_tools[1]))
+ rtems_arch_bsp = self.parse_args('--rtems-bsp')
+ if rtems_arch_bsp is not None:
+ if self.get_arg('--target') is not None:
+ raise error.general('--rtems-bsp and --target cannot be used together')
+ ab = rtems_arch_bsp[1].split('/')
+ if len(ab) != 2:
+ raise error.general('invalid --rtems-bsp option')
+ rtems_version = self.parse_args('--rtems-version')
+ if rtems_version is None:
+ rtems_version = '%d.%d' % (version.major, version.minor)
+ else:
+ rtems_version = rtems_version[1]
+ self.args.append('--target=%s-rtems%s' % (ab[0], rtems_version))
+ self.args.append('--with-rtems-bsp=%s' % (ab[1]))
+
def load(args, optargs = None, defaults = '%{_sbdir}/defaults.mc'):
"""
Copy the defaults, get the host specific values and merge them overriding
@@ -590,6 +614,7 @@ def load(args, optargs = None, defaults = '%{_sbdir}/defaults.mc'):
o.defaults[k] = overrides[k]
o.sb_git()
+ o.rtems_options()
o.process()
o.post_process()