新版本CrystaX NDK 10.3.2已发布, 提供了很多新功能和改进; 请尽量使用最新版本.
Here are customized distribution of Android NDK r3 which I have rebuilt from official sources. Support of C++ exceptions, RTTI and Standard C++ Library added. There was no many modifications, you can see them in my patch
Update: Application built using this version could be potentially broken when using
on the next Android versions. Nevertheless, they should work fine on current versions
(up to Android 2.1). As soon as I'll fix that, updated distribution will be released.
For details about potential problem with future versions, see my discussion with
David Turner (system architect of Android)
Update 2: The problem was fixed in latest distribution (android-ndk-r3-crystax-2) so no
more such potential problems. It is not more in 'experimental' state and application binaries built
using my custom Android NDK distribution will not differ by ABI (Application Binary Interface)
requirement from that built by official distribution.
See detailed explanation of problem and how it was solved in my
message to Android NDK group.
Update 3: New bug-fix release android-ndk-r3-crystax-3 ready! List of problems fixed:
- Crash on attempt to write float value to stream
- Link error when using user defined .so libraries in command line
CrystaX NDK包含若干开源许可证. 详见每个模块的版权声明文件.
请注意CrystaX NDK发布包中也包括编译器,链接器,文档等的预编译二进制文件. 工具链的源码在GitHub (你可以使用编译脚本自动下载它).
预编译的GCC和其他二进制文件(GDB, binutils 等等)基于the GNU General Public License (GPL) 或 the GNU Lesser General Public License (LGPL). 详见COPYING和COPYING.LIB,位于 $NDK/toolchains/$tc/prebuilt/$system.
预编译的LLVM/Clang工具链基于 LLVM "BSD" license.
基本上, 授权规则等同于Google's Android NDK - 例如, 允许商业&非商业用途. 唯一区别是CrystaX部分, 基于 BSD 2-clause license.
You can also build your own distribution if you don't want to use my prebuilt versions. To do it, follow instructions below.
Required development tools:
- For Windows, a recent release of Cygwin is required
- GNU Make 3.81 or later
- GNU Makeinfo (most recent version)
- GIT (for downloading toolchain sources)
- Most recent GNU Libtool packages (automake, autoconf etc)
- GNU C/C++ 3.x or later (for Windows, it should be exactly 3.x, not 4.x)
- ncurses library (for Cygwin, it should be ncurses-devel package)
- GNU flex (most recent version)
- patch utility. Most likely, it is already installed if you are using Linux or Mac OS X; however, in Cygwin it should be installed explicitly
- Download my patch and store it somewhere
- Download android-ndk-r3 for your platform from android web site
- Unpack downloaded file and go to directory android-ndk-r3
- Apply my patch:
patch -p1 <path-to-my-patch
- Point environment variable ANDROID_NDK_ROOT to the current directory:
- For Windows, point environment variable CC to the GCC 3:
- Download android toolchain sources:
./build/tools/download-toolchain-sources.sh --release=myreleaseIt will take some time depending on you network connectivity. Finally, it will download sources and pack them to the package /tmp/android-ndk-toolchain-myrelease.tar.bz2
- Run build script:
./build/tools/build-toolchain.sh --package=/tmp/android-ndk-toolchain-myrelease.tar.bz2It will unpack android toolchain sources (including binutils, gcc and gdb), patch and compile them. It could take lot of time depending on your configuration so be patient.
- Finally, when build script finished, it will print name of the compiled toolchain (something like
/tmp/android-ndk-prebuilt-20100309-linux-x86.tar.bz2, actual name will depend on current date).
Run the commands:
rm -Rf ./build/prebuilt tar xjvf /tmp/android-ndk-prebuilt-20100309-linux-x86.tar.bz2
- Now you are ready to test it. Try to compile application hello-jni (I've modified it, so there are STL and exceptions in the code) using instructions from Android team
Thank you for downloading CrystaX NDK!
CrystaX NDK is a fully open source project, free to use in any open-source and commercial environment. We provide it free for use and don't ask our users to pay in exchange. However, we appreciate your support, through sending us pull requests, spreading the news about CrystaX NDK over the world, or just donating:
Who we are
We're a small team of developers who want to make development for Android easier. Our goal is to create a comprehensive toolkit for native development for Android on C, C++, Objective-C, and, potentially, in other programming languages already working on modern POSIX systems (Swift, D, Haskell, Ocaml, Python, Ruby - you name it).
We've already done a lot (as you can see on our main project page), but we want to do even more. We have a long way to go, but we know how to do it and can clearly see the steps required to make it happen. You can read more about us here.
Why we need your support
Since we started working on CrystaX NDK, we have funded ourselves without any sponsorship. That has led us to make money in other ways (such as working as contractors and doing consulting jobs on other projects) and invest our earnings in the CrystaX NDK project. Because of this we have only been able to work on NDK part-time, which means it is not as powerful as it could be.
Having support from the community, we could pay more attention to CrystaX NDK development, without the distraction on paid contracts. This will speed up CrystaX NDK development as well as bug fixing and support.
Optionally, sponsors (those who send us $200/month or more) get in exchange a number of perks - they get priority for consulting or training needs, they can be listed on the front page of the CrystaX website and mentioned in the project README, etc. Please read here for more details about sponsoring options.
When the download is finished, please check that the downloaded file is not corrupted!
The SHA-256 hash must be .
Here is an example of how to check it using OpenSSL:
$ CHECKSUM= && \ FILE= && \ diff <(openssl sha256 $FILE) <(echo "SHA256($FILE)= $CHECKSUM") \ && echo 'OK' || echo '*** CORRUPTED!!!'