반응형
<출처> http://www.crystax.net/android/ndk-r4.php
Improved Android NDK r4
Description
Here are customized distribution of Android NDK r4b 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: New bug-fix release android-ndk-r4-crystax-2 ready! List of problems fixed:
- Snow Leopard ndk-gdb bug: ameabi instead of armeabi
- Snow Leopard ndk-gdb call gensub function not available in BSD awk
- ndk-gdb fail if both emulator and device attached
- Compiler error when including asm/byteorder.h
- ndk-build fails in case of parallel build
- Ability to download toolchain sources over http
- gdbserver binary incompatibility
- Build gcc with threads enabled
- ndk-build: problems with parameters containing spaces
Update 2: New bug-fix release android-ndk-r4-crystax-3 ready! one important fix included:
Update 3: New bug-fix release android-ndk-r4-crystax-4 ready! List of problems fixed:
- Install Failed
- Could not package toolchain source archive ?. See
- Build failed on Windows 7 with UAC enabled
- Mac OS X: Build failed if there is no gawk installed
Download
- android-ndk-r4-windows-crystax-4.zip
- android-ndk-r4-darwin-x86-crystax-4.tar.bz2
- android-ndk-r4-linux-x86-crystax-4.tar.bz2
How to build
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
Instructions
- Download my patch and store it somewhere
- Download android-ndk-r4b for your platform from android web site
- Unpack downloaded file and go to directory android-ndk-r4b
- For Windows 7 and Vista users: fix permissions of the just unpacked folder. Type in terminal:
cmd /c "icacls . /grant Everyone:(F) /T"
- Apply my patch:
patch -p1 <path-to-my-patch
- Point environment variable ANDROID_NDK_ROOT to the current directory:
export ANDROID_NDK_ROOT=`pwd`
- For Windows users: point environment variable CC to the GCC 3:
export CC=gcc-3
- For Mac users: if you're planned to run built package on earlier versions of Mac OS X (say, you build it on Snow Leopard but want to run it also on Leopard), environment variables CC and LDFLAGS should be specified. If this is not case, just ignore this point. Otherwise, type in terminal:
CC="gcc -isystem /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" export CC LDFLAGS
This will result in binaries which could run on Tiger and later versions; change SDK to another if minimal target is not Tiger. - Download android toolchain sources:
./build/tools/download-toolchain-sources.sh --release=myrelease --package --over-http --verbose --for-date=2010-07-15
It 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/rebuild-all-prebuilt.sh --verbose --package --toolchain-src-pkg=/tmp/android-ndk-toolchain-myrelease.tar.bz2
It 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-20100716-linux-x86.tar.bz2, actual name will depend on current date). Run the commands:
rm -Rf ./build/prebuilt tar xjvf /tmp/android-ndk-prebuilt-20100716-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
- Enjoy!
반응형
'Mobile APP' 카테고리의 다른 글
안드로이드 화면 크기 구하기 (0) | 2017.03.03 |
---|---|
모바일 UI 디자인 패턴 참고 사이트 (0) | 2016.06.08 |
스마트폰 IMEI 값 구하기 (0) | 2012.05.10 |
[스크랩] 이클립스를 사용해 아이폰 웹 애플리케이션 개발하기 (한글) (0) | 2012.02.17 |
Windows Phone7 망고에서 추가 및 더 나아진 기능 (0) | 2011.07.30 |