]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/buildman/toolchain.py
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / tools / buildman / toolchain.py
index a292338b6d0894bd4cd5ca78154bd3c4c9b77b66..27dc31889b8021c64d0af0d9bdf2898253e0b993 100644 (file)
@@ -39,7 +39,8 @@ class Toolchain:
         # As a basic sanity check, run the C compiler with --version
         cmd = [fname, '--version']
         if test:
-            result = command.RunPipe([cmd], capture=True, env=env)
+            result = command.RunPipe([cmd], capture=True, env=env,
+                                     raise_on_error=False)
             self.ok = result.return_code == 0
             if verbose:
                 print 'Tool chain test: ',
@@ -65,7 +66,7 @@ class Toolchain:
         Returns:
             Priority of toolchain, 0=highest, 20=lowest.
         """
-        priority_list = ['-elf', '-unknown-linux-gnu', '-linux', '-elf',
+        priority_list = ['-elf', '-unknown-linux-gnu', '-linux',
             '-none-linux-gnueabi', '-uclinux', '-none-eabi',
             '-gentoo-linux-gnu', '-linux-gnueabi', '-le-linux', '-uclinux']
         for prio in range(len(priority_list)):
@@ -98,18 +99,20 @@ class Toolchains:
     def __init__(self):
         self.toolchains = {}
         self.paths = []
+        self._make_flags = dict(bsettings.GetItems('make-flags'))
+
+    def GetSettings(self):
         toolchains = bsettings.GetItems('toolchain')
         if not toolchains:
             print ("Warning: No tool chains - please add a [toolchain] section"
                  " to your buildman config file %s. See README for details" %
-                 config_fname)
+                 bsettings.config_fname)
 
         for name, value in toolchains:
             if '*' in value:
                 self.paths += glob.glob(value)
             else:
                 self.paths.append(value)
-        self._make_flags = dict(bsettings.GetItems('make-flags'))
 
     def Add(self, fname, test=True, verbose=False):
         """Add a toolchain to our list
@@ -197,7 +200,7 @@ class Toolchains:
         >>> tcs.ResolveReferences(var_dict, 'this=${oblique}_set${first}nd')
         'this=OBLIQUE_setfi2ndrstnd'
         """
-        re_var = re.compile('(\$\{[a-z0-9A-Z]{1,}\})')
+        re_var = re.compile('(\$\{[-_a-z0-9A-Z]{1,}\})')
 
         while True:
             m = re_var.search(args)