]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - tools/buildman/toolchain.py
buildman: Add gcc 4.9.0 with Microblaze toolchain
[karo-tx-uboot.git] / tools / buildman / toolchain.py
index d4c5d4a11eb96bbea64da6d4e1fb56eea985c4e8..e33e10532ee9171897426f8e817bb112396083dc 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):
@@ -338,7 +339,7 @@ class Toolchains:
         """
         arch = command.OutputOneLine('uname', '-m')
         base = 'https://www.kernel.org/pub/tools/crosstool/files/bin'
-        versions = ['4.6.3', '4.6.2', '4.5.1', '4.2.4']
+        versions = ['4.9.0', '4.6.3', '4.6.2', '4.5.1', '4.2.4']
         links = []
         for version in versions:
             url = '%s/%s/%s/' % (base, arch, version)
@@ -464,11 +465,15 @@ class Toolchains:
         # Check that the toolchain works
         print 'Testing'
         dirpath = os.path.join(dest, path)
-        compiler_fname = self.ScanPath(dirpath, True)
-        if not compiler_fname:
+        compiler_fname_list = self.ScanPath(dirpath, True)
+        if not compiler_fname_list:
             print 'Could not locate C compiler - fetch failed.'
             return 1
-        toolchain = Toolchain(compiler_fname, True, True)
+        if len(compiler_fname_list) != 1:
+            print ('Internal error, ambiguous toolchains: %s' %
+                   (', '.join(compiler_fname)))
+            return 1
+        toolchain = Toolchain(compiler_fname_list[0], True, True)
 
         # Make sure that it will be found by buildman
         if not self.TestSettingsHasPath(dirpath):