Example #1
0
    def GetPathList(self, show_warning=True):
        """Get a list of available toolchain paths

        Args:
            show_warning: True to show a warning if there are no tool chains.

        Returns:
            List of strings, each a path to a toolchain mentioned in the
            [toolchain] section of the settings file.
        """
        toolchains = bsettings.GetItems('toolchain')
        if show_warning and not toolchains:
            print ("Warning: No tool chains. Please run 'buildman "
                   "--fetch-arch all' to download all available toolchains, or "
                   "add a [toolchain] section to your buildman config file "
                   "%s. See README for details" %
                   bsettings.config_fname)

        paths = []
        for name, value in toolchains:
            if '*' in value:
                paths += glob.glob(value)
            else:
                paths.append(value)
        return paths
Example #2
0
    def __init__(self):
        self.toolchains = {}
        self.paths = []
        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)

        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'))
Example #3
0
    def GetSettings(self, show_warning=True):
        """Get toolchain settings from the settings file.

        Args:
            show_warning: True to show a warning if there are no tool chains.
        """
        self.prefixes = bsettings.GetItems('toolchain-prefix')
        self.paths += self.GetPathList(show_warning)
 def __init__(self):
     self.toolchains = {}
     self.paths = []
     for name, value in bsettings.GetItems('toolchain'):
         if '*' in value:
             self.paths += glob.glob(value)
         else:
             self.paths.append(value)
Example #5
0
    def GetWrapper(self, show_warning=True):
        """Get toolchain wrapper from the setting file.
        """
        value = ''
        for name, value in bsettings.GetItems('toolchain-wrapper'):
            if not value:
                print("Warning: Wrapper not found")
        if value:
            value = value + ' '

        return value
Example #6
0
    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" %
                bsettings.config_fname)

        for name, value in toolchains:
            if '*' in value:
                self.paths += glob.glob(value)
            else:
                self.paths.append(value)
Example #7
0
    def Select(self, arch):
        """Returns the toolchain for a given architecture

        Args:
            args: Name of architecture (e.g. 'arm', 'ppc_8xx')

        returns:
            toolchain object, or None if none found
        """
        for name, value in bsettings.GetItems('toolchain-alias'):
            if arch == name:
                arch = value

        if not arch in self.toolchains:
            raise ValueError, ("No tool chain found for arch '%s'" % arch)
        return self.toolchains[arch]
Example #8
0
    def GetPathList(self):
        """Get a list of available toolchain paths

        Returns:
            List of strings, each a path to a toolchain mentioned in the
            [toolchain] section of the settings file.
        """
        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" %
                 bsettings.config_fname)

        paths = []
        for name, value in toolchains:
            if '*' in value:
                paths += glob.glob(value)
            else:
                paths.append(value)
        return paths
Example #9
0
 def __init__(self, override_toolchain=None):
     self.toolchains = {}
     self.prefixes = {}
     self.paths = []
     self.override_toolchain = override_toolchain
     self._make_flags = dict(bsettings.GetItems('make-flags'))
Example #10
0
 def __init__(self):
     self.toolchains = {}
     self.paths = []
     self._make_flags = dict(bsettings.GetItems('make-flags'))
Example #11
0
 def GetSettings(self):
     self.prefixes = bsettings.GetItems('toolchain-prefix')
     self.paths += self.GetPathList()