def bin_path(roots, host_os=None, host_flavour=None):
    """
    Generate the list of directories to be prepended to the PATH variable.
    """
    from os.path import join
    for root in roots:
        bindir = join(root, 'bin')
        if host_os:
            yield join(bindir, host_os)
        if host_flavour:
            yield join(bindir, host_flavour)
        yield bindir
