Here's how to create it as a static library for ARMv7 with a standalone NDK toolchain :
export NDK=/tmp/android-ndk-r8b # Create the standalone toolchain $NDK/build/tools/make-standalone-toolchain.sh \ --platform=android-9 \ --install-dir=/tmp/my-android-toolchain export PATH=/tmp/my-android-toolchain/bin:$PATH export SYSROOT=/tmp/my-android-toolchain/sysroot export CC="arm-linux-androideabi-gcc --sysroot $SYSROOT" # Download the latest release curl -O http:
What is it. The static library is deployed under build/lib/libcares.a .
If you are targeting other arches (e.g. armeabi , x86 ), repeat configure with the correct -march value and rebuild the library for each arch. Also feel free to:
- adapt the target platform to your needs (here Android 2.3, aka API level 9),
- use
configure parameters that suit your needs (for example, you might want to create a dynamic library, enable / disable some functions, etc.).
source share