OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 # This file contains common system config stuff for the Android build. | 5 # This file contains common system config stuff for the Android build. |
6 | 6 |
7 if (is_android) { | 7 if (is_android) { |
8 has_chrome_android_internal = | 8 has_chrome_android_internal = |
9 exec_script("//build/dir_exists.py", | 9 exec_script("//build/dir_exists.py", |
10 [ rebase_path("//clank", root_build_dir) ], | 10 [ rebase_path("//clank", root_build_dir) ], |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 # This is a unique identifier for a given build. It's used for | 43 # This is a unique identifier for a given build. It's used for |
44 # identifying various build artifacts corresponding to a particular build of | 44 # identifying various build artifacts corresponding to a particular build of |
45 # chrome (e.g. where to find archived symbols). | 45 # chrome (e.g. where to find archived symbols). |
46 android_chrome_build_id = "\"\"" | 46 android_chrome_build_id = "\"\"" |
47 } | 47 } |
48 | 48 |
49 # Host stuff ----------------------------------------------------------------- | 49 # Host stuff ----------------------------------------------------------------- |
50 | 50 |
51 # Defines the name the Android build gives to the current host CPU | 51 # Defines the name the Android build gives to the current host CPU |
52 # architecture, which is different than the names GN uses. | 52 # architecture, which is different than the names GN uses. |
53 if (host_cpu == "x64") { | 53 if (build_cpu_arch == "x64") { |
54 android_host_arch = "x86_64" | 54 android_host_arch = "x86_64" |
55 } else if (host_cpu == "x86") { | 55 } else if (build_cpu_arch == "x86") { |
56 android_host_arch = "x86" | 56 android_host_arch = "x86" |
57 } else { | 57 } else { |
58 assert(false, "Need Android toolchain support for your build CPU arch.") | 58 assert(false, "Need Android toolchain support for your build CPU arch.") |
59 } | 59 } |
60 | 60 |
61 # Defines the name the Android build gives to the current host CPU | 61 # Defines the name the Android build gives to the current host CPU |
62 # architecture, which is different than the names GN uses. | 62 # architecture, which is different than the names GN uses. |
63 if (host_os == "linux") { | 63 if (build_os == "linux") { |
64 android_host_os = "linux" | 64 android_host_os = "linux" |
65 } else { | 65 } else { |
66 assert(false, "Need Android toolchain support for your build OS.") | 66 assert(false, "Need Android toolchain support for your build OS.") |
67 } | 67 } |
68 | 68 |
69 # Directories and files ------------------------------------------------------ | 69 # Directories and files ------------------------------------------------------ |
70 # | 70 # |
71 # We define may of the dirs strings here for each output architecture (rather | 71 # We define may of the dirs strings here for each output architecture (rather |
72 # than just the current one) since these are needed by the Android toolchain | 72 # than just the current one) since these are needed by the Android toolchain |
73 # file to define toolchains for all possible targets in one pass. | 73 # file to define toolchains for all possible targets in one pass. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-${_android_tool
chain_version}/prebuilt/${android_host_os}-${android_host_arch}" | 112 x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-${_android_tool
chain_version}/prebuilt/${android_host_os}-${android_host_arch}" |
113 arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androidea
bi-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" | 113 arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androidea
bi-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" |
114 mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-andro
id-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" | 114 mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-andro
id-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" |
115 x86_64_android_toolchain_root = "$android_ndk_root/toolchains/x86_64-${_androi
d_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}" | 115 x86_64_android_toolchain_root = "$android_ndk_root/toolchains/x86_64-${_androi
d_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}" |
116 arm64_android_toolchain_root = "$android_ndk_root/toolchains/aarch64-${_androi
d_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}" | 116 arm64_android_toolchain_root = "$android_ndk_root/toolchains/aarch64-${_androi
d_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}" |
117 mips64_android_toolchain_root = "$android_ndk_root/toolchains/mips64el-${_andr
oid_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}" | 117 mips64_android_toolchain_root = "$android_ndk_root/toolchains/mips64el-${_andr
oid_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch}" |
118 | 118 |
119 # Location of libgcc. This is only needed for the current GN toolchain, so we | 119 # Location of libgcc. This is only needed for the current GN toolchain, so we |
120 # only need to define the current one, rather than one for every platform | 120 # only need to define the current one, rather than one for every platform |
121 # like the toolchain roots. | 121 # like the toolchain roots. |
122 if (current_cpu == "x86") { | 122 if (cpu_arch == "x86") { |
123 android_prebuilt_arch = "android-x86" | 123 android_prebuilt_arch = "android-x86" |
124 _binary_prefix = "i686-linux-android" | 124 _binary_prefix = "i686-linux-android" |
125 android_toolchain_root = "$x86_android_toolchain_root" | 125 android_toolchain_root = "$x86_android_toolchain_root" |
126 android_libgcc_file = "$android_toolchain_root/lib/gcc/i686-linux-android/${
_android_toolchain_version}/libgcc.a" | 126 android_libgcc_file = "$android_toolchain_root/lib/gcc/i686-linux-android/${
_android_toolchain_version}/libgcc.a" |
127 } else if (current_cpu == "arm") { | 127 } else if (cpu_arch == "arm") { |
128 android_prebuilt_arch = "android-arm" | 128 android_prebuilt_arch = "android-arm" |
129 _binary_prefix = "arm-linux-androideabi" | 129 _binary_prefix = "arm-linux-androideabi" |
130 android_toolchain_root = "$arm_android_toolchain_root" | 130 android_toolchain_root = "$arm_android_toolchain_root" |
131 android_libgcc_file = "$android_toolchain_root/lib/gcc/arm-linux-androideabi
/${_android_toolchain_version}/libgcc.a" | 131 android_libgcc_file = "$android_toolchain_root/lib/gcc/arm-linux-androideabi
/${_android_toolchain_version}/libgcc.a" |
132 } else if (current_cpu == "mipsel") { | 132 } else if (cpu_arch == "mipsel") { |
133 android_prebuilt_arch = "android-mips" | 133 android_prebuilt_arch = "android-mips" |
134 _binary_prefix = "mipsel-linux-android" | 134 _binary_prefix = "mipsel-linux-android" |
135 android_toolchain_root = "$mips_android_toolchain_root" | 135 android_toolchain_root = "$mips_android_toolchain_root" |
136 android_libgcc_file = "$android_toolchain_root/lib/gcc/mipsel-linux-android/
${_android_toolchain_version}/libgcc.a" | 136 android_libgcc_file = "$android_toolchain_root/lib/gcc/mipsel-linux-android/
${_android_toolchain_version}/libgcc.a" |
137 } else if (current_cpu == "x64") { | 137 } else if (cpu_arch == "x64") { |
138 android_prebuilt_arch = "android-x86_64" | 138 android_prebuilt_arch = "android-x86_64" |
139 _binary_prefix = "x86_64-linux-android" | 139 _binary_prefix = "x86_64-linux-android" |
140 android_toolchain_root = "$x86_64_android_toolchain_root" | 140 android_toolchain_root = "$x86_64_android_toolchain_root" |
141 android_libgcc_file = "$android_toolchain_root/lib/gcc/x86_64-linux-android/
${_android_toolchain_version}/libgcc.a" | 141 android_libgcc_file = "$android_toolchain_root/lib/gcc/x86_64-linux-android/
${_android_toolchain_version}/libgcc.a" |
142 } else if (current_cpu == "arm64") { | 142 } else if (cpu_arch == "arm64") { |
143 android_prebuilt_arch = "android-arm64" | 143 android_prebuilt_arch = "android-arm64" |
144 _binary_prefix = "aarch64-linux-android" | 144 _binary_prefix = "aarch64-linux-android" |
145 android_toolchain_root = "$arm64_android_toolchain_root" | 145 android_toolchain_root = "$arm64_android_toolchain_root" |
146 android_libgcc_file = "$android_toolchain_root/lib/gcc/aarch64-linux-android
/${_android_toolchain_version}/libgcc.a" | 146 android_libgcc_file = "$android_toolchain_root/lib/gcc/aarch64-linux-android
/${_android_toolchain_version}/libgcc.a" |
147 } else if (current_cpu == "mips64el") { | 147 } else if (cpu_arch == "mips64el") { |
148 android_prebuilt_arch = "android-mips64" | 148 android_prebuilt_arch = "android-mips64" |
149 _binary_prefix = "mips64el-linux-android" | 149 _binary_prefix = "mips64el-linux-android" |
150 android_toolchain_root = "$mips64_android_toolchain_root" | 150 android_toolchain_root = "$mips64_android_toolchain_root" |
151 android_libgcc_file = "$android_toolchain_root/lib/gcc/mips64el-linux-androi
d/${_android_toolchain_version}/libgcc.a" | 151 android_libgcc_file = "$android_toolchain_root/lib/gcc/mips64el-linux-androi
d/${_android_toolchain_version}/libgcc.a" |
152 } else { | 152 } else { |
153 assert(false, "Need android libgcc support for your target arch.") | 153 assert(false, "Need android libgcc support for your target arch.") |
154 } | 154 } |
155 | 155 |
156 android_tool_prefix = "$android_toolchain_root/bin/$_binary_prefix-" | 156 android_tool_prefix = "$android_toolchain_root/bin/$_binary_prefix-" |
157 android_readelf = "${android_tool_prefix}readelf" | 157 android_readelf = "${android_tool_prefix}readelf" |
158 android_objcopy = "${android_tool_prefix}objcopy" | 158 android_objcopy = "${android_tool_prefix}objcopy" |
159 android_gdbserver = | 159 android_gdbserver = |
160 "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver" | 160 "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver" |
161 | 161 |
162 # stlport stuff -------------------------------------------------------------- | 162 # stlport stuff -------------------------------------------------------------- |
163 | 163 |
164 if (component_mode == "shared_library") { | 164 if (component_mode == "shared_library") { |
165 android_stlport_library = "stlport_shared" | 165 android_stlport_library = "stlport_shared" |
166 } else { | 166 } else { |
167 android_stlport_library = "stlport_static" | 167 android_stlport_library = "stlport_static" |
168 } | 168 } |
169 | 169 |
170 # ABI ------------------------------------------------------------------------ | 170 # ABI ------------------------------------------------------------------------ |
171 | 171 |
172 if (current_cpu == "x86") { | 172 if (cpu_arch == "x86") { |
173 android_app_abi = "x86" | 173 android_app_abi = "x86" |
174 } else if (current_cpu == "arm") { | 174 } else if (cpu_arch == "arm") { |
175 import("//build/config/arm.gni") | 175 import("//build/config/arm.gni") |
176 if (arm_version < 7) { | 176 if (arm_version < 7) { |
177 android_app_abi = "armeabi" | 177 android_app_abi = "armeabi" |
178 } else { | 178 } else { |
179 android_app_abi = "armeabi-v7a" | 179 android_app_abi = "armeabi-v7a" |
180 } | 180 } |
181 } else if (current_cpu == "mipsel") { | 181 } else if (cpu_arch == "mipsel") { |
182 android_app_abi = "mips" | 182 android_app_abi = "mips" |
183 } else if (current_cpu == "x64") { | 183 } else if (cpu_arch == "x64") { |
184 android_app_abi = "x86_64" | 184 android_app_abi = "x86_64" |
185 } else if (current_cpu == "arm64") { | 185 } else if (cpu_arch == "arm64") { |
186 android_app_abi = "arm64-v8a" | 186 android_app_abi = "arm64-v8a" |
187 } else if (current_cpu == "mips64el") { | 187 } else if (cpu_arch == "mips64el") { |
188 android_app_abi = "mips64" | 188 android_app_abi = "mips64" |
189 } else { | 189 } else { |
190 assert(false, "Unknown Android ABI: " + current_cpu) | 190 assert(false, "Unknown Android ABI: " + cpu_arch) |
191 } | 191 } |
192 } else { | 192 } else { |
193 if (!defined(is_android_webview_build)) { | 193 if (!defined(is_android_webview_build)) { |
194 is_android_webview_build = false | 194 is_android_webview_build = false |
195 } | 195 } |
196 } | 196 } |
OLD | NEW |