| 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 27 matching lines...) Expand all Loading... |
| 38 # This is a unique identifier for a given build. It's used for | 38 # This is a unique identifier for a given build. It's used for |
| 39 # identifying various build artifacts corresponding to a particular build of | 39 # identifying various build artifacts corresponding to a particular build of |
| 40 # chrome (e.g. where to find archived symbols). | 40 # chrome (e.g. where to find archived symbols). |
| 41 android_chrome_build_id = "\"\"" | 41 android_chrome_build_id = "\"\"" |
| 42 } | 42 } |
| 43 | 43 |
| 44 # Host stuff ----------------------------------------------------------------- | 44 # Host stuff ----------------------------------------------------------------- |
| 45 | 45 |
| 46 # Defines the name the Android build gives to the current host CPU | 46 # Defines the name the Android build gives to the current host CPU |
| 47 # architecture, which is different than the names GN uses. | 47 # architecture, which is different than the names GN uses. |
| 48 if (build_cpu_arch == "x64") { | 48 if (host_cpu == "x64") { |
| 49 android_host_arch = "x86_64" | 49 android_host_arch = "x86_64" |
| 50 } else if (build_cpu_arch == "x86") { | 50 } else if (host_cpu == "x86") { |
| 51 android_host_arch = "x86" | 51 android_host_arch = "x86" |
| 52 } else { | 52 } else { |
| 53 assert(false, "Need Android toolchain support for your build CPU arch.") | 53 assert(false, "Need Android toolchain support for your build CPU arch.") |
| 54 } | 54 } |
| 55 | 55 |
| 56 # Defines the name the Android build gives to the current host CPU | 56 # Defines the name the Android build gives to the current host CPU |
| 57 # architecture, which is different than the names GN uses. | 57 # architecture, which is different than the names GN uses. |
| 58 if (build_os == "linux") { | 58 if (host_os == "linux") { |
| 59 android_host_os = "linux" | 59 android_host_os = "linux" |
| 60 } else { | 60 } else { |
| 61 assert(false, "Need Android toolchain support for your build OS.") | 61 assert(false, "Need Android toolchain support for your build OS.") |
| 62 } | 62 } |
| 63 | 63 |
| 64 # Directories and files ------------------------------------------------------ | 64 # Directories and files ------------------------------------------------------ |
| 65 # | 65 # |
| 66 # We define may of the dirs strings here for each output architecture (rather | 66 # We define may of the dirs strings here for each output architecture (rather |
| 67 # than just the current one) since these are needed by the Android toolchain | 67 # than just the current one) since these are needed by the Android toolchain |
| 68 # file to define toolchains for all possible targets in one pass. | 68 # file to define toolchains for all possible targets in one pass. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 97 # Toolchain root directory for each build. The actual binaries are inside | 97 # Toolchain root directory for each build. The actual binaries are inside |
| 98 # a "bin" directory inside of these. | 98 # a "bin" directory inside of these. |
| 99 _android_toolchain_version = "4.9" | 99 _android_toolchain_version = "4.9" |
| 100 x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-${_android_tool
chain_version}/prebuilt/${android_host_os}-${android_host_arch}" | 100 x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-${_android_tool
chain_version}/prebuilt/${android_host_os}-${android_host_arch}" |
| 101 arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androidea
bi-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" | 101 arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androidea
bi-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" |
| 102 mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-andro
id-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" | 102 mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-andro
id-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" |
| 103 | 103 |
| 104 # Location of libgcc. This is only needed for the current GN toolchain, so we | 104 # Location of libgcc. This is only needed for the current GN toolchain, so we |
| 105 # only need to define the current one, rather than one for every platform | 105 # only need to define the current one, rather than one for every platform |
| 106 # like the toolchain roots. | 106 # like the toolchain roots. |
| 107 if (cpu_arch == "x86") { | 107 if (current_cpu == "x86") { |
| 108 android_prebuilt_arch = "android-x86" | 108 android_prebuilt_arch = "android-x86" |
| 109 _binary_prefix = "i686-linux-android" | 109 _binary_prefix = "i686-linux-android" |
| 110 android_toolchain_root = "$x86_android_toolchain_root" | 110 android_toolchain_root = "$x86_android_toolchain_root" |
| 111 android_libgcc_file = "$android_toolchain_root/lib/gcc/i686-linux-android/${
_android_toolchain_version}/libgcc.a" | 111 android_libgcc_file = "$android_toolchain_root/lib/gcc/i686-linux-android/${
_android_toolchain_version}/libgcc.a" |
| 112 } else if (cpu_arch == "arm") { | 112 } else if (current_cpu == "arm") { |
| 113 android_prebuilt_arch = "android-arm" | 113 android_prebuilt_arch = "android-arm" |
| 114 _binary_prefix = "arm-linux-androideabi" | 114 _binary_prefix = "arm-linux-androideabi" |
| 115 android_toolchain_root = "$arm_android_toolchain_root" | 115 android_toolchain_root = "$arm_android_toolchain_root" |
| 116 android_libgcc_file = "$android_toolchain_root/lib/gcc/arm-linux-androideabi
/${_android_toolchain_version}/libgcc.a" | 116 android_libgcc_file = "$android_toolchain_root/lib/gcc/arm-linux-androideabi
/${_android_toolchain_version}/libgcc.a" |
| 117 } else if (cpu_arch == "mipsel") { | 117 } else if (current_cpu == "mipsel") { |
| 118 android_prebuilt_arch = "android-mips" | 118 android_prebuilt_arch = "android-mips" |
| 119 _binary_prefix = "mipsel-linux-android" | 119 _binary_prefix = "mipsel-linux-android" |
| 120 android_toolchain_root = "$mips_android_toolchain_root" | 120 android_toolchain_root = "$mips_android_toolchain_root" |
| 121 android_libgcc_file = "$android_toolchain_root/lib/gcc/mipsel-linux-android/
${_android_toolchain_version}/libgcc.a" | 121 android_libgcc_file = "$android_toolchain_root/lib/gcc/mipsel-linux-android/
${_android_toolchain_version}/libgcc.a" |
| 122 } else { | 122 } else { |
| 123 assert(false, "Need android libgcc support for your target arch.") | 123 assert(false, "Need android libgcc support for your target arch.") |
| 124 } | 124 } |
| 125 | 125 |
| 126 android_tool_prefix = "$android_toolchain_root/bin/$_binary_prefix-" | 126 android_tool_prefix = "$android_toolchain_root/bin/$_binary_prefix-" |
| 127 android_readelf = "${android_tool_prefix}readelf" | 127 android_readelf = "${android_tool_prefix}readelf" |
| 128 android_objcopy = "${android_tool_prefix}objcopy" | 128 android_objcopy = "${android_tool_prefix}objcopy" |
| 129 android_gdbserver = | 129 android_gdbserver = |
| 130 "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver" | 130 "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver" |
| 131 | 131 |
| 132 # ABI ------------------------------------------------------------------------ | 132 # ABI ------------------------------------------------------------------------ |
| 133 | 133 |
| 134 if (cpu_arch == "x86") { | 134 if (current_cpu == "x86") { |
| 135 android_app_abi = "x86" | 135 android_app_abi = "x86" |
| 136 } else if (cpu_arch == "arm") { | 136 } else if (current_cpu == "arm") { |
| 137 import("//build/config/arm.gni") | 137 import("//build/config/arm.gni") |
| 138 if (arm_version < 7) { | 138 if (arm_version < 7) { |
| 139 android_app_abi = "armeabi" | 139 android_app_abi = "armeabi" |
| 140 } else { | 140 } else { |
| 141 android_app_abi = "armeabi-v7a" | 141 android_app_abi = "armeabi-v7a" |
| 142 } | 142 } |
| 143 } else if (cpu_arch == "mipsel") { | 143 } else if (current_cpu == "mipsel") { |
| 144 android_app_abi = "mips" | 144 android_app_abi = "mips" |
| 145 } else { | 145 } else { |
| 146 assert(false, "Unknown Android ABI: " + cpu_arch) | 146 assert(false, "Unknown Android ABI: " + current_cpu) |
| 147 } | 147 } |
| 148 } else { | 148 } else { |
| 149 if (!defined(is_android_webview_build)) { | 149 if (!defined(is_android_webview_build)) { |
| 150 is_android_webview_build = false | 150 is_android_webview_build = false |
| 151 } | 151 } |
| 152 } | 152 } |
| OLD | NEW |