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/

本文介绍如何从源代码构建Android NDK工具链。首先下载最新版本的Android NDK,然后安装必要的库文件,最后使用提供的脚本重建库。文中提供了两个示例命令来构建不同GCC和GDB版本的工具链。

被折叠的 条评论
为什么被折叠?



