Exemplo n.º 1
0
    # TODO(danalbert): Fix 64-bit Windows LLVM.
    # This wrongly packages 32-bit Windows LLVM for 64-bit as well, but the
    # real bug here is that we don't have a 64-bit Windows LLVM.
    # http://b/22414702
    os_name = host
    if os_name == 'windows64':
        os_name = 'windows'
    prebuilt_path = get_llvm_prebuilt_path(os_name + '-x86')

    if host == 'darwin':
        host = 'darwin-x86_64'
    elif host == 'linux':
        host = 'linux-x86_64'
    elif host == 'windows':
        host = 'windows'
    elif host == 'windows64':
        host = 'windows-x86_64'

    package_name = 'llvm-{}.zip'.format(host)
    package_path = os.path.join(package_dir, package_name)
    if os.path.exists(package_path):
        os.unlink(package_path)
    os.chdir(prebuilt_path)
    args = ['zip', '-9qr', package_path, LLVM_VERSION]
    if not host.startswith('windows'):
        args.append('--symlinks')
    subprocess.check_call(args)

if __name__ == '__main__':
    build_support.run(main)
Exemplo n.º 2
0
            help='Architectures to build. Builds all if not present.')
        # pylint: enable=no-member


def main(args):
    arches = build_support.ALL_ARCHITECTURES
    if args.arch is not None:
        arches = [args.arch]

    print('Building gdbservers: {}'.format(' '.join(arches)))
    for arch in arches:
        build_dir = os.path.join(args.out_dir, 'gdbserver', arch)
        target_triple = dict(
            zip(build_support.ALL_ARCHITECTURES, GDBSERVER_TARGETS))[arch]
        build_cmd = [
            'bash',
            'build-gdbserver.sh',
            arch,
            target_triple,
            build_support.toolchain_path(),
            build_support.ndk_path(),
            '--build-out={}'.format(build_dir),
            build_support.jobs_arg(),
        ]

        build_support.build(build_cmd, args)


if __name__ == '__main__':
    build_support.run(main, ArgParser)

class ArgParser(build_support.ArgParser):
    def __init__(self):
        super(ArgParser, self).__init__()

        self.add_argument(
            '--arch', choices=build_support.ALL_ARCHITECTURES,
            help='Architectures to build. Builds all if not present.')


def main(args):
    arches = build_support.ALL_ARCHITECTURES
    if args.arch is not None:
        arches = [args.arch]

    print('Building plaforms: {}'.format(' '.join(arches)))
    arch_arg = '--arch={}'.format(','.join(arches))
    ndk_dir_arg = '--ndk-dir={}'.format(build_support.ndk_path())
    build_cmd = [
        'bash', 'gen-platforms.sh', '--fast-copy', arch_arg, ndk_dir_arg,
    ]

    if args.host != 'linux':
        build_cmd.append('--case-insensitive')

    build_support.build(build_cmd, args)

if __name__ == '__main__':
    build_support.run(main, ArgParser)