Build Android NDK Toolchain From Source Code

Android NDK comes with a few toolchains under the toolchain directory. We can also build our own toolchain from the source code.

0. Download Latest Android NDK (r8c at the time of writing) from Android NDK website at http://developer.android.com/tools/sdk/ndk/index.html. Extract the downloaded archive.

$ tar xvf android-ndk-r8c-linux-x86.tar.bz2

1. Get into the ndk directory. Download the Android NDK source code to the src directory.

$ cd android-ndk-r8c/
$ ./build/tools/download-toolchain-sources.sh src

2. Install the following libraries

sudo apt-get install libncurses5-dev
sudo apt-get install texinfo
sudo apt-get install bison
sudo apt-get install flex

3. Rebuild the library is just one command. Below are two commands build two different toolchains with different versions of GCC and GDB.

./build/tools/build-gcc.sh –verbose –gdb-version=6.6 $(pwd)/src $(pwd) arm-linux-androideabi-4.6

./build/tools/build-gcc.sh –verbose –gdb-version=7.3.x $(pwd)/src $(pwd) arm-linux-androideabi-4.7

The toolchain built can be found under toolchains directory of the Android NDK folder.


原文http://www.roman10.net/2012/11/19/build-android-ndk-toolchain-from-source-code/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值