Android提供了NDK工具用以编译能够Android设备上运行的C/C++程序,本质上就是交叉编译,下面给出几篇关于NDK相关的文章。
教程
生成设备专用的toolchain
在 ${NDKROOT}/build/tools
下有两个脚本:make_standalone_toolchain.py 和 make-standalone-toolchain.sh,这两个脚本的功能相似,下面是脚本的使用方式(–help):
usage: make_standalone_toolchain.py [-h] --arch
{arm,arm64,mips,mips64,x86,x86_64}
[--api API]
[--stl {gnustl,libc++,stlport}]
[--unified-headers] [--force] [-v]
[--package-dir PACKAGE_DIR | --install-dir INSTALL_DIR]
Creates a toolchain installation for a given Android target. The output of
this tool is a more typical cross-compiling toolchain. It is indended to be
used with existing build systems such as autotools.
optional arguments:
-h, --hel