Skip to content

Instantly share code, notes, and snippets.

@deltheil
Created December 12, 2012 22:32
Show Gist options
  • Save deltheil/4272266 to your computer and use it in GitHub Desktop.
Save deltheil/4272266 to your computer and use it in GitHub Desktop.
Android NDK: build c-ares w/ the Standalone 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://c-ares.haxx.se/download/c-ares-1.9.1.tar.gz
tar xvfz c-ares-1.9.1.tar.gz
# Configure
cd c-ares-1.9.1 && mkdir build
./configure --prefix=$(pwd)/build \
--host=arm-linux-androideabi \
--disable-shared \
CFLAGS="-march=armv7-a"
# Build and install
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment