diff options
author | Chris Johns <chrisj@rtems.org> | 2012-10-31 12:09:38 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2012-10-31 12:09:38 +1100 |
commit | 52604491d35d6d6df76f0cec5607455abf2b39b8 (patch) | |
tree | 04590d7d213db26aa24e83623e6789c935355c61 /tb/config.py | |
parent | Create the sources path if not present and the user has forced. (diff) | |
download | rtems-source-builder-52604491d35d6d6df76f0cec5607455abf2b39b8.tar.bz2 |
Support modules other than bintuls and gcc.
Added support to build autoconf and automake plus other packages
such as libusb and the stlink project. This includes support to
build a specific github version downloaded from github.
Diffstat (limited to 'tb/config.py')
-rw-r--r-- | tb/config.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tb/config.py b/tb/config.py index 75a91aa..05da300 100644 --- a/tb/config.py +++ b/tb/config.py @@ -213,16 +213,20 @@ class file: s += str(self._packages[_package]) return s + def _name_line_msg(self, msg): + return '%s:%d: %s' % (os.path.basename(self.name), self.lc, msg) + def _output(self, text): if not self.opts.quiet(): log.output(text) def _warning(self, msg): - self._output('warning: ' + self.name + ':' + str(self.lc) + ': ' + msg) + self._output('warning: %s' % (self._name_line_msg(msg))) def _error(self, msg): - print >> sys.stderr, \ - 'error: ' + self.name + ':' + str(self.lc) + ': ' + msg + err = 'error: %s' % (self._name_line_msg(msg)) + print >> sys.stderr, err + self._output(err) self.in_error = True if not self.opts.dry_run(): print >> sys.stderr, 'warning: switched to dry run due to errors' @@ -597,7 +601,10 @@ class file: return ('package', name) elif ls[0] == '%error': if isvalid: - return ('data', ['%%error %s:%d: %s' % (self.name, self.lc, l[7:])]) + return ('data', ['%%error %s' % (self._name_line_msg(l[7:]))]) + elif ls[0] == '%warning': + if isvalid: + return ('data', ['%%warning %s' % (self._name_line_msg(l[9:]))]) elif ls[0] == '%define' or ls[0] == '%global': if isvalid: self._define(config, ls) @@ -773,6 +780,9 @@ class file: l = self._expand(l) if l.startswith('%error'): raise error.general('config error: %s' % (l[7:])) + elif l.startswith('%warning'): + print >> sys.stderr, 'warning: %s' % (l[9:]) + self._warning(l[9:]) if not dir: ls = self.tags.split(l, 1) if self.opts.trace(): @@ -816,6 +826,9 @@ class file: raise error.general('macro "' + name + '" not found') return self._expand(d) + def set_define(self, name, value): + self.defines[name.lower()] = value + def expand(self, line): return self._expand(line) |