]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: allow multiple toolchains in a single path
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 31 Jan 2015 23:12:44 +0000 (00:12 +0100)
committerSimon Glass <sjg@chromium.org>
Sun, 15 Feb 2015 21:34:06 +0000 (14:34 -0700)
When buildman scans a toolchain path, it stops at the
first toolchain found. However, a single path can contains
several toolchains, each with its own prefix.

This patch lets buildman scan all toolchains in the path.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
Acked-by: Simon Glass <sjg@chromium.org>
tools/buildman/toolchain.py

index d4c5d4a11eb96bbea64da6d4e1fb56eea985c4e8..537797ad53ef908e6bc5f2db05a6686e63e9ade8 100644 (file)
@@ -197,13 +197,14 @@ class Toolchains:
         Returns:
             Filename of C compiler if found, else None
         """
+        fnames = []
         for subdir in ['.', 'bin', 'usr/bin']:
             dirname = os.path.join(path, subdir)
             if verbose: print "      - looking in '%s'" % dirname
             for fname in glob.glob(dirname + '/*gcc'):
                 if verbose: print "         - found '%s'" % fname
-                return fname
-        return None
+                fnames.append(fname)
+        return fnames
 
 
     def Scan(self, verbose):
@@ -219,8 +220,8 @@ class Toolchains:
         if verbose: print 'Scanning for tool chains'
         for path in self.paths:
             if verbose: print "   - scanning path '%s'" % path
-            fname = self.ScanPath(path, verbose)
-            if fname:
+            fnames = self.ScanPath(path, verbose)
+            for fname in fnames:
                 self.Add(fname, True, verbose)
 
     def List(self):