OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/sysroot.gni") # Imports android/config.gni. | 5 import("//build/config/sysroot.gni") # Imports android/config.gni. |
6 import("//build/toolchain/clang.gni") | 6 import("//build/toolchain/clang.gni") |
7 import("//build/toolchain/goma.gni") | 7 import("//build/toolchain/goma.gni") |
8 import("//build/toolchain/gcc_toolchain.gni") | 8 import("//build/toolchain/gcc_toolchain.gni") |
9 | 9 |
10 # The Android GCC toolchains share most of the same parameters, so we have this | 10 # The Android GCC toolchains share most of the same parameters, so we have this |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 toolchain_cpu_arch = invoker.toolchain_cpu_arch | 50 toolchain_cpu_arch = invoker.toolchain_cpu_arch |
51 | 51 |
52 # We make the assumption that the gcc_toolchain will produce a soname with | 52 # We make the assumption that the gcc_toolchain will produce a soname with |
53 # the following definition. | 53 # the following definition. |
54 soname = "{{target_output_name}}{{output_extension}}" | 54 soname = "{{target_output_name}}{{output_extension}}" |
55 | 55 |
56 stripped_soname = "lib.stripped/${soname}" | 56 stripped_soname = "lib.stripped/${soname}" |
57 temp_stripped_soname = "${stripped_soname}.tmp" | 57 temp_stripped_soname = "${stripped_soname}.tmp" |
58 | 58 |
59 android_strip = "${tool_prefix}strip" | 59 android_strip = "${tool_prefix}strip" |
| 60 |
60 mkdir_command = "mkdir -p lib.stripped" | 61 mkdir_command = "mkdir -p lib.stripped" |
61 strip_command = "$android_strip --strip-unneeded -o $temp_stripped_soname $s
oname" | 62 strip_command = "$android_strip --strip-unneeded -o $temp_stripped_soname $s
oname" |
62 replace_command = "if ! cmp -s $temp_stripped_soname $stripped_soname; then
mv $temp_stripped_soname $stripped_soname; fi" | 63 replace_command = "if ! cmp -s $temp_stripped_soname $stripped_soname; then
mv $temp_stripped_soname $stripped_soname; fi" |
63 postsolink = "$mkdir_command && $strip_command && $replace_command" | 64 postsolink = "$mkdir_command && $strip_command && $replace_command" |
| 65 solink_outputs = [ stripped_soname ] |
| 66 |
| 67 # We make the assumption that the gcc_toolchain will produce an exe with |
| 68 # the following definition. |
| 69 exe = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" |
| 70 stripped_exe = "exe.stripped/$exe" |
| 71 mkdir_command = "mkdir -p exe.stripped" |
| 72 strip_command = "$android_strip --strip-unneeded -o $stripped_exe $exe" |
| 73 postlink = "$mkdir_command && $strip_command" |
| 74 link_outputs = [ stripped_exe ] |
64 } | 75 } |
65 } | 76 } |
66 | 77 |
67 android_gcc_toolchain("x86") { | 78 android_gcc_toolchain("x86") { |
68 android_ndk_sysroot = "$android_ndk_root/$x86_android_sysroot_subdir" | 79 android_ndk_sysroot = "$android_ndk_root/$x86_android_sysroot_subdir" |
69 android_ndk_lib_dir = "usr/lib" | 80 android_ndk_lib_dir = "usr/lib" |
70 | 81 |
71 tool_prefix = "$x86_android_toolchain_root/bin/i686-linux-android-" | 82 tool_prefix = "$x86_android_toolchain_root/bin/i686-linux-android-" |
72 toolchain_cpu_arch = "x86" | 83 toolchain_cpu_arch = "x86" |
73 } | 84 } |
74 | 85 |
75 android_gcc_toolchain("arm") { | 86 android_gcc_toolchain("arm") { |
76 android_ndk_sysroot = "$android_ndk_root/$arm_android_sysroot_subdir" | 87 android_ndk_sysroot = "$android_ndk_root/$arm_android_sysroot_subdir" |
77 android_ndk_lib_dir = "usr/lib" | 88 android_ndk_lib_dir = "usr/lib" |
78 | 89 |
79 tool_prefix = "$arm_android_toolchain_root/bin/arm-linux-androideabi-" | 90 tool_prefix = "$arm_android_toolchain_root/bin/arm-linux-androideabi-" |
80 toolchain_cpu_arch = "arm" | 91 toolchain_cpu_arch = "arm" |
81 } | 92 } |
82 | 93 |
83 android_gcc_toolchain("mipsel") { | 94 android_gcc_toolchain("mipsel") { |
84 android_ndk_sysroot = "$android_ndk_root/$mips_android_sysroot_subdir" | 95 android_ndk_sysroot = "$android_ndk_root/$mips_android_sysroot_subdir" |
85 android_ndk_lib_dir = "usr/lib" | 96 android_ndk_lib_dir = "usr/lib" |
86 | 97 |
87 tool_prefix = "$mips_android_toolchain_root/bin/mipsel-linux-android-" | 98 tool_prefix = "$mips_android_toolchain_root/bin/mipsel-linux-android-" |
88 toolchain_cpu_arch = "mipsel" | 99 toolchain_cpu_arch = "mipsel" |
89 } | 100 } |
OLD | NEW |