| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Dart Authors. All rights reserved. | 3 # Copyright (c) 2012 The Dart Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ | 7 """ |
| 8 This script performs the final link step for Android NDK executables. | 8 This script performs the final link step for Android NDK executables. |
| 9 Usage: | 9 Usage: |
| 10 ./android_link {arm,ia32} {executable,library,shared_library} {host,target} | 10 ./android_link {arm,ia32} {executable,library,shared_library} {host,target} |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 CheckDirExists(THIRD_PARTY_ROOT, 'third party tools'); | 72 CheckDirExists(THIRD_PARTY_ROOT, 'third party tools'); |
| 73 android_tools = os.path.join(THIRD_PARTY_ROOT, 'android_tools') | 73 android_tools = os.path.join(THIRD_PARTY_ROOT, 'android_tools') |
| 74 CheckDirExists(android_tools, 'Android tools') | 74 CheckDirExists(android_tools, 'Android tools') |
| 75 android_ndk_root = os.path.join(android_tools, 'ndk') | 75 android_ndk_root = os.path.join(android_tools, 'ndk') |
| 76 CheckDirExists(android_ndk_root, 'Android NDK') | 76 CheckDirExists(android_ndk_root, 'Android NDK') |
| 77 | 77 |
| 78 # Set up the directory of the Android NDK cross-compiler toolchain. | 78 # Set up the directory of the Android NDK cross-compiler toolchain. |
| 79 toolchain_arch = 'arm-linux-androideabi-4.6' | 79 toolchain_arch = 'arm-linux-androideabi-4.6' |
| 80 if target_arch == 'ia32': | 80 if target_arch == 'ia32': |
| 81 toolchain_arch = 'x86-4.6' | 81 toolchain_arch = 'x86-4.6' |
| 82 toolchain_dir = 'linux-x86' | 82 toolchain_dir = 'linux-x86_64' |
| 83 android_toolchain = os.path.join(android_ndk_root, | 83 android_toolchain = os.path.join(android_ndk_root, |
| 84 'toolchains', toolchain_arch, | 84 'toolchains', toolchain_arch, |
| 85 'prebuilt', toolchain_dir, 'bin') | 85 'prebuilt', toolchain_dir, 'bin') |
| 86 CheckDirExists(android_toolchain, 'Android toolchain') | 86 CheckDirExists(android_toolchain, 'Android toolchain') |
| 87 | 87 |
| 88 # Set up the path to the linker executable. | 88 # Set up the path to the linker executable. |
| 89 android_linker = os.path.join(android_toolchain, 'arm-linux-androideabi-g++') | 89 android_linker = os.path.join(android_toolchain, 'arm-linux-androideabi-g++') |
| 90 if target_arch == 'ia32': | 90 if target_arch == 'ia32': |
| 91 android_linker = os.path.join(android_toolchain, 'i686-linux-android-g++') | 91 android_linker = os.path.join(android_toolchain, 'i686-linux-android-g++') |
| 92 | 92 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 link_args.insert(0, android_linker) | 127 link_args.insert(0, android_linker) |
| 128 else: | 128 else: |
| 129 link_args.extend(['-ldl', '-lrt']) | 129 link_args.extend(['-ldl', '-lrt']) |
| 130 link_args.insert(0, 'g++') | 130 link_args.insert(0, 'g++') |
| 131 | 131 |
| 132 sys.exit(execute(link_args)) | 132 sys.exit(execute(link_args)) |
| 133 | 133 |
| 134 if __name__ == '__main__': | 134 if __name__ == '__main__': |
| 135 main() | 135 main() |
| OLD | NEW |