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 = exec_script("//build/dir_exists.py", | 8 has_chrome_android_internal = |
9 [ rebase_path("//clank", root_build_dir) ], | 9 exec_script("//build/dir_exists.py", |
10 "string") == "True" | 10 [ rebase_path("//clank", root_build_dir) ], |
| 11 "string") == "True" |
11 | 12 |
12 if (has_chrome_android_internal) { | 13 if (has_chrome_android_internal) { |
13 import("//clank/config.gni") | 14 import("//clank/config.gni") |
14 } else { | 15 } else { |
15 default_android_sdk_root = "//third_party/android_tools/sdk" | 16 default_android_sdk_root = "//third_party/android_tools/sdk" |
16 default_android_sdk_version = "21" | 17 default_android_sdk_version = "21" |
17 default_android_sdk_build_tools_version = "21.0.1" | 18 default_android_sdk_build_tools_version = "21.0.1" |
18 } | 19 } |
19 | 20 |
20 declare_args() { | 21 declare_args() { |
21 android_sdk_root = default_android_sdk_root | 22 android_sdk_root = default_android_sdk_root |
22 android_sdk_version = default_android_sdk_version | 23 android_sdk_version = default_android_sdk_version |
23 android_sdk_build_tools_version = default_android_sdk_build_tools_version | 24 android_sdk_build_tools_version = default_android_sdk_build_tools_version |
24 | 25 |
25 # This is set when building the Android WebView inside the Android build | 26 # This is set when building the Android WebView inside the Android build |
26 # system, using the 'android' gyp backend. The WebView code is still built | 27 # system, using the 'android' gyp backend. The WebView code is still built |
27 # when this is unset, but builds using the normal chromium build system. | 28 # when this is unset, but builds using the normal chromium build system. |
28 is_android_webview_build = false | 29 is_android_webview_build = false |
29 | 30 |
30 android_default_keystore_path = "//build/android/ant/chromium-debug.keystore
" | 31 android_default_keystore_path = |
| 32 "//build/android/ant/chromium-debug.keystore" |
31 android_default_keystore_name = "chromiumdebugkey" | 33 android_default_keystore_name = "chromiumdebugkey" |
32 android_default_keystore_password = "chromium" | 34 android_default_keystore_password = "chromium" |
33 | 35 |
34 # This is a unique identifier for a given build. It's used for | 36 # This is a unique identifier for a given build. It's used for |
35 # identifying various build artifacts corresponding to a particular build of | 37 # identifying various build artifacts corresponding to a particular build of |
36 # chrome (e.g. where to find archived symbols). | 38 # chrome (e.g. where to find archived symbols). |
37 android_chrome_build_id = "\"\"" | 39 android_chrome_build_id = "\"\"" |
38 } | 40 } |
39 | 41 |
40 # ABI ------------------------------------------------------------------------ | |
41 | |
42 if (cpu_arch == "x86") { | |
43 android_app_abi = "x86" | |
44 } else if (cpu_arch == "arm") { | |
45 import("//build/config/arm.gni") | |
46 if (arm_version < 7) { | |
47 android_app_abi = "armeabi" | |
48 } else { | |
49 android_app_abi = "armeabi-v7a" | |
50 } | |
51 } else if (cpu_arch == "mipsel") { | |
52 android_app_abi = "mips" | |
53 } else { | |
54 assert(false, "Unknown Android ABI: " + cpu_arch) | |
55 } | |
56 | |
57 # Host stuff ----------------------------------------------------------------- | 42 # Host stuff ----------------------------------------------------------------- |
58 | 43 |
59 # Defines the name the Android build gives to the current host CPU | 44 # Defines the name the Android build gives to the current host CPU |
60 # architecture, which is different than the names GN uses. | 45 # architecture, which is different than the names GN uses. |
61 if (build_cpu_arch == "x64") { | 46 if (build_cpu_arch == "x64") { |
62 android_host_arch = "x86_64" | 47 android_host_arch = "x86_64" |
63 } else if (build_cpu_arch == "x86") { | 48 } else if (build_cpu_arch == "x86") { |
64 android_host_arch = "x86" | 49 android_host_arch = "x86" |
65 } else { | 50 } else { |
66 assert(false, "Need Android toolchain support for your build CPU arch.") | 51 assert(false, "Need Android toolchain support for your build CPU arch.") |
(...skipping 15 matching lines...) Expand all Loading... |
82 | 67 |
83 android_sdk = "${android_sdk_root}/platforms/android-${android_sdk_version}" | 68 android_sdk = "${android_sdk_root}/platforms/android-${android_sdk_version}" |
84 | 69 |
85 # Path to the Android NDK and SDK. | 70 # Path to the Android NDK and SDK. |
86 android_ndk_root = "//third_party/android_tools/ndk" | 71 android_ndk_root = "//third_party/android_tools/ndk" |
87 android_ndk_include_dir = "$android_ndk_root/usr/include" | 72 android_ndk_include_dir = "$android_ndk_root/usr/include" |
88 | 73 |
89 android_sdk = "${android_sdk_root}/platforms/android-${android_sdk_version}" | 74 android_sdk = "${android_sdk_root}/platforms/android-${android_sdk_version}" |
90 | 75 |
91 android_sdk_tools = "${android_sdk_root}/tools" | 76 android_sdk_tools = "${android_sdk_root}/tools" |
92 android_sdk_build_tools = "${android_sdk_root}/build-tools/$android_sdk_build_
tools_version" | 77 android_sdk_build_tools = |
| 78 "${android_sdk_root}/build-tools/$android_sdk_build_tools_version" |
93 | 79 |
94 # Path to the SDK's android.jar | 80 # Path to the SDK's android.jar |
95 android_sdk_jar = "$android_sdk/android.jar" | 81 android_sdk_jar = "$android_sdk/android.jar" |
96 | 82 |
97 zipalign_path = "$android_sdk_build_tools/zipalign" | 83 zipalign_path = "$android_sdk_build_tools/zipalign" |
98 | 84 |
99 # Subdirectories inside android_ndk_root that contain the sysroot for the | 85 # Subdirectories inside android_ndk_root that contain the sysroot for the |
100 # associated platform. | 86 # associated platform. |
101 _android_api_level = 14 | 87 _android_api_level = 14 |
102 x86_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-x86
" | 88 x86_android_sysroot_subdir = |
103 arm_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-arm
" | 89 "platforms/android-${_android_api_level}/arch-x86" |
104 mips_android_sysroot_subdir = "platforms/android-${_android_api_level}/arch-mi
ps" | 90 arm_android_sysroot_subdir = |
| 91 "platforms/android-${_android_api_level}/arch-arm" |
| 92 mips_android_sysroot_subdir = |
| 93 "platforms/android-${_android_api_level}/arch-mips" |
105 | 94 |
106 # Toolchain root directory for each build. The actual binaries are inside | 95 # Toolchain root directory for each build. The actual binaries are inside |
107 # a "bin" directory inside of these. | 96 # a "bin" directory inside of these. |
108 _android_toolchain_version = "4.9" | 97 _android_toolchain_version = "4.9" |
109 x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-${_android_tool
chain_version}/prebuilt/${android_host_os}-${android_host_arch}" | 98 x86_android_toolchain_root = |
110 arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androidea
bi-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" | 99 "$android_ndk_root/toolchains/x86-${_android_toolchain_version}/prebuilt/$
{android_host_os}-${android_host_arch}" |
111 mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-andro
id-${_android_toolchain_version}/prebuilt/${android_host_os}-${android_host_arch
}" | 100 arm_android_toolchain_root = |
| 101 "$android_ndk_root/toolchains/arm-linux-androideabi-${_android_toolchain_v
ersion}/prebuilt/${android_host_os}-${android_host_arch}" |
| 102 mips_android_toolchain_root = |
| 103 "$android_ndk_root/toolchains/mipsel-linux-android-${_android_toolchain_ve
rsion}/prebuilt/${android_host_os}-${android_host_arch}" |
112 | 104 |
113 # Location of libgcc. This is only needed for the current GN toolchain, so we | 105 # Location of libgcc. This is only needed for the current GN toolchain, so we |
114 # only need to define the current one, rather than one for every platform | 106 # only need to define the current one, rather than one for every platform |
115 # like the toolchain roots. | 107 # like the toolchain roots. |
116 if (cpu_arch == "x86") { | 108 if (cpu_arch == "x86") { |
117 android_prebuilt_arch = "android-x86" | 109 android_prebuilt_arch = "android-x86" |
118 _binary_prefix = "i686-linux-android" | 110 _binary_prefix = "i686-linux-android" |
119 android_toolchain_root = "$x86_android_toolchain_root" | 111 android_toolchain_root = "$x86_android_toolchain_root" |
120 android_libgcc_file = | 112 android_libgcc_file = |
121 "$android_toolchain_root/lib/gcc/i686-linux-android/${_android_toolchain_v
ersion}/libgcc.a" | 113 "$android_toolchain_root/lib/gcc/i686-linux-android/${_android_toolchain
_version}/libgcc.a" |
122 } else if (cpu_arch == "arm") { | 114 } else if (cpu_arch == "arm") { |
123 android_prebuilt_arch = "android-arm" | 115 android_prebuilt_arch = "android-arm" |
124 _binary_prefix = "arm-linux-androideabi" | 116 _binary_prefix = "arm-linux-androideabi" |
125 android_toolchain_root = "$arm_android_toolchain_root" | 117 android_toolchain_root = "$arm_android_toolchain_root" |
126 if (arm_use_thumb) { | 118 android_libgcc_file = |
127 android_libgcc_file = | |
128 "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolch
ain_version}/thumb/libgcc.a" | |
129 } else { | |
130 android_libgcc_file = | |
131 "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolch
ain_version}/libgcc.a" | 119 "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolch
ain_version}/libgcc.a" |
132 } | |
133 } else if (cpu_arch == "mipsel") { | 120 } else if (cpu_arch == "mipsel") { |
134 android_prebuilt_arch = "android-mips" | 121 android_prebuilt_arch = "android-mips" |
135 _binary_prefix = "mipsel-linux-android" | 122 _binary_prefix = "mipsel-linux-android" |
136 android_toolchain_root = "$mips_android_toolchain_root" | 123 android_toolchain_root = "$mips_android_toolchain_root" |
137 android_libgcc_file = | 124 android_libgcc_file = |
138 "$android_toolchain_root/lib/gcc/mipsel-linux-android/${_android_toolchain
_version}/libgcc.a" | 125 "$android_toolchain_root/lib/gcc/mipsel-linux-android/${_android_toolcha
in_version}/libgcc.a" |
139 } else { | 126 } else { |
140 assert(false, "Need android libgcc support for your target arch.") | 127 assert(false, "Need android libgcc support for your target arch.") |
141 } | 128 } |
142 | 129 |
143 android_tool_prefix = "$android_toolchain_root/bin/$_binary_prefix-" | 130 android_tool_prefix = "$android_toolchain_root/bin/$_binary_prefix-" |
144 android_readelf = "${android_tool_prefix}readelf" | 131 android_readelf = "${android_tool_prefix}readelf" |
145 android_objcopy = "${android_tool_prefix}objcopy" | 132 android_objcopy = "${android_tool_prefix}objcopy" |
146 android_gdbserver = "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserv
er/gdbserver" | 133 android_gdbserver = |
| 134 "$android_ndk_root/prebuilt/$android_prebuilt_arch/gdbserver/gdbserver" |
147 | 135 |
148 # stlport stuff -------------------------------------------------------------- | 136 # stlport stuff -------------------------------------------------------------- |
149 | 137 |
150 if (component_mode == "shared_library") { | 138 if (component_mode == "shared_library") { |
151 android_stlport_library = "stlport_shared" | 139 android_stlport_library = "stlport_shared" |
152 } else { | 140 } else { |
153 android_stlport_library = "stlport_static" | 141 android_stlport_library = "stlport_static" |
154 } | 142 } |
| 143 |
| 144 # ABI ------------------------------------------------------------------------ |
| 145 |
| 146 if (cpu_arch == "x86") { |
| 147 android_app_abi = "x86" |
| 148 } else if (cpu_arch == "arm") { |
| 149 import("//build/config/arm.gni") |
| 150 if (arm_version < 7) { |
| 151 android_app_abi = "armeabi" |
| 152 } else { |
| 153 android_app_abi = "armeabi-v7a" |
| 154 } |
| 155 } else if (cpu_arch == "mipsel") { |
| 156 android_app_abi = "mips" |
| 157 } else { |
| 158 assert(false, "Unknown Android ABI: " + cpu_arch) |
| 159 } |
155 } else { | 160 } else { |
156 if (!defined(is_android_webview_build)) { | 161 if (!defined(is_android_webview_build)) { |
157 is_android_webview_build = false | 162 is_android_webview_build = false |
158 } | 163 } |
159 } | 164 } |
OLD | NEW |