使用以下脚本
#!/bin/sh
DST=/opt/ndk_standalone
TOOLCHAIN=$DST/NDKr8e
SYSROOT=$TOOLCHAIN/sysroot/
export ANDROID_NDK=/home/zhangbin/android/android-ndk-r8e
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$TOOLCHAIN --ndk-dir=$ANDROID_NDK
===============================
会有报错:
root@Ubuntu64:/home/zhangbin/android/tools_chain# source get*sh
mkdir: missing operand
Try `mkdir --help' for more information.
Auto-config: --toolchain=arm-linux-androideabi-4.6
Host system 'linux-x86' is not supported by the source NDK!
Try --system=<name> with one of: linux-x86_64
改成# Create 32-bit host toolchain by default
SYSTEM=$HOST_TAG32 为 SYSTEM=$HOST_TAG
register_var_option "--system=<name>" SYSTEM "Specify host system"
root@Ubuntu64:/home/zhangbin/android/tools_chain# ls
getAndroidNDKToolschain.sh getAndroidNDKToolschain.sh~
root@Ubuntu64:/home/zhangbin/android/tools_chain# source get*sh
mkdir: missing operand
Try `mkdir --help' for more information.
Auto-config: --toolchain=arm-linux-androideabi-4.6
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying libstdc++ headers and libraries...
Copying files to: /opt/ndk_standalone/NDKr8e
Cleaning up...
Done.
root@Ubuntu64:/home/zhangbin/android/tools_chain# ls /opt/ndk_standalone/NDKr8e
arm-linux-androideabi COPYING include lib32 libexec sysroot
bin COPYING.LIB lib lib64 SOURCES
root@Ubuntu64:/home/zhangbin/android/tools_chain#