'Write out a link step. Fills out target.binary.'

def WriteLink(self, spec, config_name, config, link_deps, compile_deps):

    if ((self.flavor != 'mac') or (len(self.archs) == 1)):
        return self.WriteLinkForArch(self.ninja, spec, config_name, config, link_deps, compile_deps)
    else:
        output = self.ComputeOutput(spec)
        inputs = [self.WriteLinkForArch(self.arch_subninjas[arch], spec, config_name, config, link_deps[arch], compile_deps, arch=arch) for arch in self.archs]
        extra_bindings = []
        build_output = output
        if (not self.is_mac_bundle):
            self.AppendPostbuildVariable(extra_bindings, spec, output, output)
        if ((spec['type'] in ('shared_library', 'loadable_module')) and (not self.is_mac_bundle)):
            extra_bindings.append(('lib', output))
            self.ninja.build([output, (output + '.TOC')], 'solipo', inputs, variables=extra_bindings)
        else:
            self.ninja.build(build_output, 'lipo', inputs, variables=extra_bindings)
        return output
