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 declare_args() { | 8 declare_args() { |
9 # Absolute directory containing the Android source code. | 9 # Absolute directory containing the Android source code. |
10 android_src = "" | 10 android_src = "" |
11 | 11 |
12 # This is set when building the Android WebView inside the Android build | 12 # This is set when building the Android WebView inside the Android build |
13 # system, using the 'android' gyp backend. The WebView code is still built | 13 # system, using the 'android' gyp backend. The WebView code is still built |
14 # when this is unset, but builds using the normal chromium build system. | 14 # when this is unset, but builds using the normal chromium build system. |
15 is_android_webview_build = false | 15 is_android_webview_build = false |
16 } | 16 } |
17 | 17 |
18 if (is_android_webview_build) { | 18 if (is_android_webview_build) { |
19 assert(android_src != "", | 19 assert(android_src != "", |
20 "You must specify android_src for an Android WebView build.") | 20 "You must specify android_src for an Android WebView build.") |
21 } | 21 } |
22 | 22 |
23 # android_ndk_root ----------------------------------------------------------- | 23 # Host stuff ----------------------------------------------------------------- |
scottmg
2014/05/12 16:33:58
i have no idea about any of this file
| |
24 | 24 |
25 # Full system path to the Android NDK. | 25 # Defines the name the Android build gives to the current host CPU |
26 android_ndk_root = rebase_path("//third_party/android_tools/ndk") | 26 # architecture, which is different than the names GN uses. |
27 if (build_cpu_arch == "x64") { | |
28 android_host_arch = "x86_64" | |
awong
2014/05/12 19:23:02
ick. Is this actually a variable we wish to expose
| |
29 } else if (build_cpu_arch == "x86") { | |
30 android_host_arch = "x86" | |
31 } else { | |
32 assert(false, "Need Android toolchain support for your build CPU arch.") | |
33 } | |
34 | |
35 # Defines the name the Android build gives to the current host CPU | |
36 # architecture, which is different than the names GN uses. | |
37 if (build_os == "linux") { | |
38 android_host_os = "linux" | |
awong
2014/05/12 19:23:02
Are there other android_host_os values that we wil
brettw
2014/05/12 21:00:08
They're working on Mac.
| |
39 } else { | |
40 assert(false, "Need Android toolchain support for your build OS.") | |
41 } | |
42 | |
43 # Directories and files ------------------------------------------------------ | |
44 # | |
45 # We define may of the dirs strings here for each output architecture (rather | |
46 # than just the current one) since these are needed by the Android toolchain | |
47 # file to define toolchains for all possible targets in one pass. | |
48 | |
49 # Path to the Android NDK. | |
50 android_ndk_root = "//third_party/android_tools/ndk" | |
awong
2014/05/12 19:23:02
Not for this CL, but FYI, at some point the ndk ro
| |
51 | |
52 # Subdirectories inside android_ndk_root that contain the sysroot for the | |
53 # associated platform. | |
54 x86_android_sysroot_subdir = "platforms/android-14/arch-x86" | |
awong
2014/05/12 19:23:02
Pull 14 out int a _android_api_level variable or s
brettw
2014/05/12 21:00:08
Done.
| |
55 arm_android_sysroot_subdir = "platforms/android-14/arch-arm" | |
56 mips_android_sysroot_subdir = "platforms/android-14/arch-mips" | |
awong
2014/05/12 19:23:02
Why do we have a different variable exposed for ea
brettw
2014/05/12 21:00:08
Yes, these all need to be here since the toolchain
| |
57 | |
58 # Toolchain root directory for each build. The actual binaries are inside | |
59 # a "bin" directory inside of these. | |
60 x86_android_toolchain_root = "$android_ndk_root/toolchains/x86-4.6/prebuilt/$a ndroid_host_os-$android_host_arch" | |
awong
2014/05/12 19:23:02
Pull 4.6 out to something like _android_toolchain_
brettw
2014/05/12 21:00:08
Done.
| |
61 arm_android_toolchain_root = "$android_ndk_root/toolchains/arm-linux-androidea bi-4.6/prebuilt/$android_host_os-$android_host_arch" | |
62 mips_android_toolchain_root = "$android_ndk_root/toolchains/mipsel-linux-andro id-4.6/prebuilt/$android_host_os-$android_host_arch" | |
63 | |
64 # Location of libgcc. This is only needed for the current GN toolchain, so we | |
65 # only need to define the current one, rather than one for every platform | |
66 # like the toolchain roots. | |
awong
2014/05/12 19:23:02
Hmm...why do we actually need this? libgcc.a is pr
brettw
2014/05/12 21:00:08
I don't know, I just copied gyp:
https://code.goog
cjhopman
2014/05/12 21:04:19
AIUI, android builds use -nostdlib simply because
awong
2014/05/12 21:34:23
Hmm...let me talk with NDK team. I thought I had u
| |
67 if (cpu_arch == "x86") { | |
68 android_libgcc_file = | |
69 "$x86_android_toolchain_root/lib/gcc/i686-linux-android/4.6/libgcc.a" | |
70 } else if (cpu_arch == "arm") { | |
71 android_libgcc_file = | |
72 "$arm_android_toolchain_root/lib/gcc/arm-linux-androideabi/4.6/libgcc.a" | |
73 } else if (cpu_arch == "mips") { | |
74 android_libgcc_file = | |
75 "$mips_android_toolchain_root/lib/gcc/mipsel-linux-android/4.6/libgcc.a" | |
76 } else { | |
77 assert(false, "Need android libgcc support for your target arch.") | |
78 } | |
27 | 79 |
28 # stlport stuff -------------------------------------------------------------- | 80 # stlport stuff -------------------------------------------------------------- |
29 | 81 |
30 use_system_stlport = is_android_webview_build | 82 use_system_stlport = is_android_webview_build |
31 | 83 |
32 if (use_system_stlport) { | 84 if (use_system_stlport) { |
33 android_stlport_library = "stlport" | 85 android_stlport_library = "stlport" |
34 } else if (component_mode == "shared_library") { | 86 } else if (component_mode == "shared_library") { |
35 android_stlport_library = "stlport_shared" | 87 android_stlport_library = "stlport_shared" |
36 } else { | 88 } else { |
(...skipping 15 matching lines...) Expand all Loading... | |
52 android_app_abi = "mips" | 104 android_app_abi = "mips" |
53 } else { | 105 } else { |
54 assert(false, "Unknown Android ABI: " + cpu_arch) | 106 assert(false, "Unknown Android ABI: " + cpu_arch) |
55 } | 107 } |
56 } else { | 108 } else { |
57 if (!defined(is_android_webview_build)) { | 109 if (!defined(is_android_webview_build)) { |
58 is_android_webview_build = false | 110 is_android_webview_build = false |
59 } | 111 } |
60 use_system_stlport = false | 112 use_system_stlport = false |
61 } | 113 } |
OLD | NEW |