summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/config.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2013-02-13 11:30:47 +1100
committerChris Johns <chrisj@rtems.org>2013-02-13 11:35:36 +1100
commitd963553b51d452b36a560c8de953c890f02184ec (patch)
tree1e123f30e2622743d3697f77959acae6b7d077bb /source-builder/sb/config.py
parentFixes to the NIOS2 build on FreeBSD. (diff)
downloadrtems-source-builder-d963553b51d452b36a560c8de953c890f02184ec.tar.bz2
Restructure RTEMS Config Files
Add arch build files. This allows archs to have different versions and patches for specific tools. Break the RTEMS config directory up into separate directories to make long term maintenance easier. This required a change to config.py to handle the config files being in subdirs of the config directory. The defaults have been updated to include the install SB root so packages built before a package are available. Add makeinfo to the required tools. GDB (and others) need it to build without error.
Diffstat (limited to 'source-builder/sb/config.py')
-rw-r--r--source-builder/sb/config.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py
index a9724dc..b18a646 100644
--- a/source-builder/sb/config.py
+++ b/source-builder/sb/config.py
@@ -687,6 +687,16 @@ class file:
def load(self, name):
+ def common_end(left, right):
+ end = ''
+ while len(left) and len(right):
+ if left[-1] != right[-1]:
+ return end
+ end = left[-1] + end
+ left = left[:-1]
+ right = right[:-1]
+ return end
+
if self.load_depth == 0:
self.in_error = False
self.lc = 0
@@ -707,7 +717,7 @@ class file:
self.lc = 0
#
- # Locate the config file. Expand any macors then Add the
+ # Locate the config file. Expand any macros then add the
# extension. Check if the file exists, therefore directly
# referenced. If not see if the file contains ':' or the path
# separator. If it does split the path else use the standard config dir
@@ -716,12 +726,19 @@ class file:
exname = self.expand(name)
+ #
+ # Macro could add an extension.
+ #
if exname.endswith('.cfg'):
configname = exname
else:
configname = '%s.cfg' % (exname)
+ name = '%s.cfg' % (name)
- cfgname = path.basename(configname)
+ if ':' in configname:
+ cfgname = path.basename(configname)
+ else:
+ cfgname = common_end(configname, name)
if not path.exists(configname):
if ':' in configname:
@@ -730,6 +747,7 @@ class file:
configdirs = self.define('_configdir').split(':')
for cp in configdirs:
configname = path.join(path.abspath(cp), cfgname)
+ print configname
if path.exists(configname):
break
configname = None