Skip to content

Instantly share code, notes, and snippets.

@PoisonousJohn
Forked from deltheil/c-ares.sh
Created January 25, 2014 22:59
Show Gist options
  • Save PoisonousJohn/8625021 to your computer and use it in GitHub Desktop.
Save PoisonousJohn/8625021 to your computer and use it in GitHub Desktop.
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