Lines Matching +full:toolchain +full:- +full:prefix

3 # SPDX-License-Identifier:	GPL-2.0+
36 self._match = '_%s-' % arch
48 class Toolchain: class
49 """A single toolchain
54 cross: Cross compile string, e.g. 'arm-linux-'
55 arch: Architecture of toolchain as determined from the first
56 component of the filename. E.g. arm-linux-gcc becomes arm
57 priority: Toolchain priority (0=highest, 20=lowest)
61 """Create a new toolchain object.
65 test: True to run the toolchain to test it
67 priority: Priority to use for this toolchain, or PRIORITY_CALC to
73 # Find the CROSS_COMPILE prefix to use for U-Boot. For example,
74 # 'arm-linux-gnueabihf-gcc' turns into 'arm-linux-gnueabihf-'.
76 pos = basename.rfind('-')
77 self.cross = basename[:pos + 1] if pos != -1 else ''
80 pos = self.cross.find('-')
84 self.arch = self.cross[:pos] if pos != -1 else 'sandbox'
88 # As a basic sanity check, run the C compiler with --version
89 cmd = [fname, '--version']
112 """Return the priority of the toolchain.
115 filename prefix.
118 fname: Filename of toolchain
120 Priority of toolchain, PRIORITY_CALC=highest, 20=lowest.
122 priority_list = ['-elf', '-unknown-linux-gnu', '-linux',
123 '-none-linux-gnueabi', '-none-linux-gnueabihf', '-uclinux',
124 '-none-eabi', '-gentoo-linux-gnu', '-linux-gnueabi',
125 '-linux-gnueabihf', '-le-linux', '-uclinux']
132 """Get toolchain wrapper from the setting file.
135 for name, value in bsettings.GetItems('toolchain-wrapper'):
144 """Returns an environment for using the toolchain.
170 """Manage a list of toolchains for building U-Boot
172 We select one toolchain for each architecture type
175 toolchains: Dict of Toolchain objects, keyed by architecture name
177 be a full path and toolchain prefix, for example
178 {'x86', 'opt/i386-linux/bin/i386-linux-'}, or the name of
180 {'arm', 'arm-linux-gnueabihf-'}. Wildcards are not supported.
188 self._make_flags = dict(bsettings.GetItems('make-flags'))
191 """Get a list of available toolchain paths
197 List of strings, each a path to a toolchain mentioned in the
198 [toolchain] section of the settings file.
200 toolchains = bsettings.GetItems('toolchain')
203 "--fetch-arch all' to download all available toolchains, or "
204 "add a [toolchain] section to your buildman config file "
217 """Get toolchain settings from the settings file.
222 self.prefixes = bsettings.GetItems('toolchain-prefix')
227 """Add a toolchain to our list
229 We select the given toolchain as our preferred one for its
233 fname: Filename of toolchain's gcc driver
234 test: True to run the toolchain to test it
235 priority: Priority to use for this toolchain
236 arch: Toolchain architecture, or None if not known
238 toolchain = Toolchain(fname, test, verbose, priority, arch)
239 add_it = toolchain.ok
240 if toolchain.arch in self.toolchains:
241 add_it = (toolchain.priority <
242 self.toolchains[toolchain.arch].priority)
244 self.toolchains[toolchain.arch] = toolchain
246 print ("Toolchain '%s' at priority %d will be ignored because "
247 "another toolchain for arch '%s' has priority %d" %
248 (toolchain.gcc, toolchain.priority, toolchain.arch,
249 self.toolchains[toolchain.arch].priority))
252 """Scan a path for a valid toolchain
263 if verbose: print " - looking in '%s'" % dirname
265 if verbose: print " - found '%s'" % fname
290 highest priority toolchain for each arch.
297 if verbose: print " - scanning prefix '%s'" % value
309 raise ValueError, ("No tool chain found for prefix '%s'" %
312 if verbose: print " - scanning path '%s'" % path
324 print '%-10s: %s' % (key, value.gcc)
329 """Returns the toolchain for a given architecture
335 toolchain object, or None if none found
337 for tag, value in bsettings.GetItems('toolchain-alias'):
369 re_var = re.compile('(\$\{[-_a-z0-9A-Z]{1,}\})')
375 lookup = m.group(0)[2:-1]
383 The flags are in a section called 'make-flags'. Flags are named
390 [make-flags]
391 at91-boards=ENABLE_AT91_TEST=1
392 snapper9260=${at91-boards} BUILD_TAG=442
393 snapper9g45=${at91-boards} BUILD_TAG=443
418 """Find a toolchain available online
430 URL containing this toolchain, if avaialble, else None
432 arch = command.OutputOneLine('uname', '-m')
463 leaf = url.split('/')[-1]
469 size = int(meta.getheaders('Content-Length')[0])
505 stdout = command.Output('tar', 'xvfJ', fname, '-C', dest)
506 return stdout.splitlines()[0][:-1]
509 """Check if buildman will find this toolchain
520 re_arch = re.compile('[-a-z0-9.]*_([^-]*)-.*')
530 """Fetch and install a new toolchain
537 print col.Color(col.BLUE, "Downloading toolchain for arch '%s'" % arch)
540 print ("Cannot find toolchain for arch '%s' - use 'list' to list" %
544 dest = os.path.join(home, '.buildman-toolchains')
548 # Download the tar file for this toolchain and unpack it
559 # Check that the toolchain works
564 print 'Could not locate C compiler - fetch failed.'
569 toolchain = Toolchain(compiler_fname_list[0], True, True)
575 bsettings.SetItem('toolchain', 'download', '%s/*/*' % dest)