summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/config.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-04-08 15:11:00 +1000
committerChris Johns <chrisj@rtems.org>2014-04-08 15:11:00 +1000
commitf3b549010d814fa5b2404042a687053c575884ac (patch)
tree2dc7497db20e3700fcdd9939844c23c474b51a3b /source-builder/sb/config.py
parentdoc: Updated after GSoC student feedback. (diff)
downloadrtems-source-builder-f3b549010d814fa5b2404042a687053c575884ac.tar.bz2
config,sb: Qemu build updates for FreeBSD and the start of MinG32.
Hack round the FreeBSD iconv support in Freebsd 10. In 10 libc now supports iconv however iconv.h is present under /usr/local. Start to add support to build qemu for MinGW via a Cxc. This is a work in progress and contains lots of hidden traps. In config.py separate out of the canadian build status.
Diffstat (limited to 'source-builder/sb/config.py')
-rw-r--r--source-builder/sb/config.py60
1 files changed, 37 insertions, 23 deletions
diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py
index 6426352..5a90a49 100644
--- a/source-builder/sb/config.py
+++ b/source-builder/sb/config.py
@@ -287,6 +287,18 @@ class file:
return name
return '%{' + name.lower() + '}'
+ def _cross_compile(self):
+ _host = self.expand('%{_host}')
+ _build = self.expand('%{_build}')
+ return _host != _build
+
+ def _candian_cross_compile(self):
+ _host = self.expand('%{_host}')
+ _build = self.expand('%{_build}')
+ _target = self.expand('%{_target}')
+ _alloc_cxc = self.defined('%{allow_cxc}')
+ return _alloc_cxc and _host != _build and _host != _target
+
def _macro_split(self, s):
'''Split the string (s) up by macros. Only split on the
outter level. Nested levels will need to split with futher calls.'''
@@ -369,34 +381,36 @@ class file:
return line
def _pkgconfig_check(self, test):
- ts = test.split()
ok = False
- pkg = pkgconfig.package(ts[0], output = log.output)
- if len(ts) != 1 and len(ts) != 3:
- self._error('malformed check')
- else:
- op = '>='
- ver = '0'
- if len(ts) == 3:
- op = ts[1]
- ver = self.macros.expand(ts[2])
- try:
- ok = pkg.check(op, ver)
- except pkgconfig.error, pe:
- self._error('check: %s' % (pe))
- except:
- raise error.interal('pkgconfig failure')
+ if not self._cross_compile():
+ ts = test.split()
+ pkg = pkgconfig.package(ts[0], output = log.output)
+ if len(ts) != 1 and len(ts) != 3:
+ self._error('malformed check')
+ else:
+ op = '>='
+ ver = '0'
+ if len(ts) == 3:
+ op = ts[1]
+ ver = self.macros.expand(ts[2])
+ try:
+ ok = pkg.check(op, ver)
+ except pkgconfig.error, pe:
+ self._error('check: %s' % (pe))
+ except:
+ raise error.interal('pkgconfig failure')
return ok
def _pkgconfig_flags(self, package, flags):
pkg_flags = None
- pkg = pkgconfig.package(package, output = log.output)
- try:
- pkg_flags = pkg.get(flags)
- except pkgconfig.error, pe:
- self._error('flags:%s: %s' % (flags, pe))
- except:
- raise error.interal('pkgconfig failure')
+ if not self._cross_compile():
+ pkg = pkgconfig.package(package, output = log.output)
+ try:
+ pkg_flags = pkg.get(flags)
+ except pkgconfig.error, pe:
+ self._error('flags:%s: %s' % (flags, pe))
+ except:
+ raise error.interal('pkgconfig failure')
return pkg_flags
def _expand(self, s):