def main(args): arches = build_support.ALL_ARCHITECTURES if args.arch is not None: arches = [args.arch] abis = [] for arch in arches: abis.extend(build_support.arch_to_abis(arch)) print('Building stlport for ABIs: {}'.format(' '.join(abis))) abis_arg = '--abis={}'.format(','.join(abis)) ndk_dir_arg = '--ndk-dir={}'.format(build_support.ndk_path()) script = build_support.ndk_path('build/tools/build-cxx-stl.sh') build_cmd = [ 'bash', script, '--stl=stlport', abis_arg, ndk_dir_arg, build_support.jobs_arg(), build_support.toolchain_path(), '--with-debug-info', '--llvm-version=3.6', ] build_support.build(build_cmd, args)
def main(args): arches = build_support.ALL_ARCHITECTURES if args.arch is not None: arches = [args.arch] abis = [] for arch in arches: abis.extend(build_support.arch_to_abis(arch)) build_dir = os.path.join(args.out_dir, 'gnustl') print('Building libstdc++ for ABIs: {}'.format(' '.join(abis))) abis_arg = '--abis={}'.format(','.join(abis)) ndk_dir_arg = '--ndk-dir={}'.format(build_support.ndk_path()) build_cmd = [ 'bash', 'build-gnu-libstdc++.sh', abis_arg, ndk_dir_arg, build_support.jobs_arg(), build_support.toolchain_path(), '--with-debug-info', '--build-dir={}'.format(build_dir), ] build_support.build(build_cmd, args)
def main(args): GCC_VERSION = '4.9' toolchains = build_support.ALL_TOOLCHAINS if args.toolchain is not None: toolchains = [args.toolchain] print(f'Building {args.host.value} toolchains: {" ".join(toolchains)}') for toolchain in toolchains: toolchain_name = '-'.join([toolchain, GCC_VERSION]) sysroot_arg = '--sysroot={}'.format( build_support.sysroot_path(toolchain)) build_cmd = [ 'bash', 'build-gcc.sh', build_support.toolchain_path(), build_support.ndk_path(), toolchain_name, build_support.jobs_arg(), sysroot_arg, '--try-64', ] if args.host.is_windows: build_cmd.append('--mingw') build_support.build(build_cmd, args)
def main(args): GCC_VERSION = '4.9' toolchains = build_support.ALL_TOOLCHAINS if args.toolchain is not None: toolchains = [args.toolchain] print('Building {} toolchains: {}'.format(args.host, ' '.join(toolchains))) for toolchain in toolchains: toolchain_name = '-'.join([toolchain, GCC_VERSION]) sysroot_arg = '--sysroot={}'.format( build_support.sysroot_path(toolchain)) build_cmd = [ 'bash', 'build-gcc.sh', build_support.toolchain_path(), build_support.ndk_path(), toolchain_name, build_support.jobs_arg(), sysroot_arg, ] if args.host in ('windows', 'windows64'): build_cmd.append('--mingw') if args.host != 'windows': build_cmd.append('--try-64') build_support.build(build_cmd, args)
def main(args): GCC_VERSION = "4.9" toolchains = build_support.ALL_TOOLCHAINS if args.toolchain is not None: toolchains = [args.toolchain] print("Building {} toolchains: {}".format(args.host, " ".join(toolchains))) for toolchain in toolchains: toolchain_name = "-".join([toolchain, GCC_VERSION]) sysroot_arg = "--sysroot={}".format(build_support.sysroot_path(toolchain)) build_cmd = [ "bash", "build-gcc.sh", build_support.toolchain_path(), build_support.ndk_path(), toolchain_name, build_support.jobs_arg(), sysroot_arg, ] if args.host in ("windows", "windows64"): build_cmd.append("--mingw") if args.host != "windows": build_cmd.append("--try-64") build_support.build(build_cmd, args)
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)
def main(args): GCC_VERSION = '4.9' arches = build_support.ALL_ARCHITECTURES if args.arch is not None: arches = [args.arch] print('Building gdbservers: {}'.format(' '.join(arches))) for arch in arches: toolchain = build_support.arch_to_toolchain(arch) toolchain_name = '-'.join([toolchain, GCC_VERSION]) build_cmd = [ 'bash', 'build-gdbserver.sh', build_support.toolchain_path(), build_support.ndk_path(), toolchain_name, build_support.jobs_arg(), ] build_support.build(build_cmd, args)
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: 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_support.jobs_arg(), ] build_support.build(build_cmd, args)
def main(args): arches = build_support.ALL_ARCHITECTURES if args.arch is not None: arches = [args.arch] abis = [] for arch in arches: abis.extend(build_support.arch_to_abis(arch)) print('Building libc++ for ABIs: {}'.format(' '.join(abis))) abis_arg = '--abis={}'.format(','.join(abis)) ndk_dir_arg = '--ndk-dir={}'.format(build_support.ndk_path()) script = build_support.ndk_path('build/tools/build-cxx-stl.sh') build_cmd = [ 'bash', script, '--stl=libc++-libc++abi', abis_arg, ndk_dir_arg, build_support.jobs_arg(), build_support.toolchain_path(), '--with-debug-info', '--llvm-version=3.6', ] build_support.build(build_cmd, args)
def main(args): arches = build_support.ALL_ARCHITECTURES if args.arch is not None: arches = [args.arch] abis = [] for arch in arches: abis.extend(build_support.arch_to_abis(arch)) print("Building libstdc++ for ABIs: {}".format(" ".join(abis))) abis_arg = "--abis={}".format(",".join(abis)) ndk_dir_arg = "--ndk-dir={}".format(build_support.ndk_path()) build_cmd = [ "bash", "build-gnu-libstdc++.sh", abis_arg, ndk_dir_arg, build_support.jobs_arg(), build_support.toolchain_path(), "--with-debug-info", ] build_support.build(build_cmd, args)
def main(args): arches = build_support.ALL_ARCHITECTURES if args.arch is not None: arches = [args.arch] abis = [] for arch in arches: abis.extend(build_support.arch_to_abis(arch)) ndk_build = build_support.ndk_path('build/ndk-build') prebuilt_ndk = build_support.android_path('prebuilts/ndk/current') platforms_root = os.path.join(prebuilt_ndk, 'platforms') toolchains_root = os.path.join(prebuilt_ndk, 'toolchains') libcxx_path = build_support.android_path('external/libcxx') obj_out = os.path.join(args.out_dir, 'libcxx/obj') # TODO(danalbert): Stop building to the source directory. # This is historical, and simplifies packaging a bit. We need to pack up # all the source as well as the libraries. If build_support.make_package # were to change to allow a list of directories instead of one directory, # we could make this unnecessary. Will be a follow up CL. lib_out = os.path.join(libcxx_path, 'libs') build_cmd = [ 'bash', ndk_build, '-C', THIS_DIR, build_support.jobs_arg(), 'V=1', 'APP_ABI=' + ' '.join(abis), # Use the prebuilt platforms and toolchains. 'NDK_PLATFORMS_ROOT=' + platforms_root, 'NDK_TOOLCHAINS_ROOT=' + toolchains_root, 'NDK_NEW_TOOLCHAINS_LAYOUT=true', # Tell ndk-build where all of our makefiles are and where outputs # should go. The defaults in ndk-build are only valid if we have a # typical ndk-build layout with a jni/{Android,Application}.mk. 'NDK_PROJECT_PATH=null', 'APP_BUILD_SCRIPT=' + os.path.join(libcxx_path, 'Android.mk'), 'NDK_APPLICATION_MK=' + os.path.join(libcxx_path, 'Application.mk'), 'NDK_OUT=' + obj_out, 'NDK_LIBS_OUT=' + lib_out, # Make sure we don't pick up a cached copy. 'LIBCXX_FORCE_REBUILD=true', ] print('Building libc++ for ABIs: {}'.format(', '.join(abis))) print('Running: ' + ' '.join(build_cmd)) subprocess.check_call(build_cmd) # The static libraries are installed to NDK_OUT, not NDK_LIB_OUT, so we # need to install them to our package directory. for abi in abis: static_lib_dir = os.path.join(obj_out, 'local', abi) install_dir = os.path.join(lib_out, abi) is_arm = abi.startswith('armeabi') if is_arm: shutil.copy2(os.path.join(static_lib_dir, 'libunwind.a'), install_dir) shutil.copy2(os.path.join(static_lib_dir, 'libc++abi.a'), install_dir) shutil.copy2(os.path.join(static_lib_dir, 'libandroid_support.a'), install_dir) shutil.copy2(os.path.join(static_lib_dir, 'libc++_static.a'), install_dir) # Create linker scripts for the libraries we use so that we link things # properly even when we're not using ndk-build. The linker will read # the script in place of the library so that we link the unwinder and # other support libraries appropriately. static_libs = ['-lc++_static', '-lc++abi', '-landroid_support'] if is_arm: static_libs.extend(['-lunwind', '-latomic']) make_linker_script(os.path.join(install_dir, 'libc++.a'), static_libs) shared_libs = ['-landroid_support'] if is_arm: shared_libs.extend(['-lunwind', '-latomic']) shared_libs.append('-lc++_shared') make_linker_script(os.path.join(install_dir, 'libc++.so'), shared_libs) build_support.make_package('libc++', libcxx_path, args.dist_dir)
def main(args): arches = build_support.ALL_ARCHITECTURES if args.arch is not None: arches = [args.arch] abis = [] for arch in arches: abis.extend(build_support.arch_to_abis(arch)) ndk_build = build_support.ndk_path('build/ndk-build') prebuilt_ndk = build_support.android_path('prebuilts/ndk/current') platforms_root = os.path.join(prebuilt_ndk, 'platforms') toolchains_root = os.path.join(prebuilt_ndk, 'toolchains') libcxx_path = build_support.ndk_path('sources/cxx-stl/llvm-libc++') obj_out = os.path.join(args.out_dir, 'libcxx/obj') # TODO(danalbert): Stop building to the source directory. # This is historical, and simplifies packaging a bit. We need to pack up # all the source as well as the libraries. If build_support.make_package # were to change to allow a list of directories instead of one directory, # we could make this unnecessary. Will be a follow up CL. lib_out = os.path.join(libcxx_path, 'libs') build_cmd = [ 'bash', ndk_build, '-C', THIS_DIR, build_support.jobs_arg(), 'V=1', 'APP_ABI=' + ' '.join(abis), # Use the prebuilt platforms and toolchains. 'NDK_PLATFORMS_ROOT=' + platforms_root, 'NDK_TOOLCHAINS_ROOT=' + toolchains_root, 'NDK_NEW_TOOLCHAINS_LAYOUT=true', # Tell ndk-build where all of our makefiles are and where outputs # should go. The defaults in ndk-build are only valid if we have a # typical ndk-build layout with a jni/{Android,Application}.mk. 'NDK_PROJECT_PATH=null', 'APP_BUILD_SCRIPT=' + os.path.join(THIS_DIR, 'Android.mk'), 'NDK_APPLICATION_MK=' + os.path.join(THIS_DIR, 'Application.mk'), 'NDK_OUT=' + obj_out, 'NDK_LIBS_OUT=' + lib_out, # Make sure we don't pick up a cached copy. 'LIBCXX_FORCE_REBUILD=true', # Put armeabi-v7a-hard in its own directory. '_NDK_TESTING_ALL_=yes', ] print('Building libc++ for ABIs: {}'.format(', '.join(abis))) subprocess.check_call(build_cmd) # The static libraries are installed to NDK_OUT, not NDK_LIB_OUT, so we # need to install them to our package directory. for abi in abis: static_lib_dir = os.path.join(obj_out, 'local', abi) install_dir = os.path.join(lib_out, abi) is_arm = abi.startswith('armeabi') if is_arm: shutil.copy2( os.path.join(static_lib_dir, 'libunwind.a'), install_dir) shutil.copy2(os.path.join(static_lib_dir, 'libc++abi.a'), install_dir) shutil.copy2( os.path.join(static_lib_dir, 'libandroid_support.a'), install_dir) shutil.copy2( os.path.join(static_lib_dir, 'libc++_static.a'), install_dir) build_support.make_package('libcxx', libcxx_path, args.dist_dir)