Skip to content

Instantly share code, notes, and snippets.

@thkim-cochl
Forked from jhandley/build-curl-android.sh
Last active January 8, 2020 10:40
Show Gist options
  • Save thkim-cochl/98232d56a66671b1d25b33788d086b51 to your computer and use it in GitHub Desktop.
Save thkim-cochl/98232d56a66671b1d25b33788d086b51 to your computer and use it in GitHub Desktop.
#!/bin/bash
TARGET=android-26
INSTALLATION_PATH=`realpath .`/build
NDK_ROOT="/opt/android/android-ndk-r19c"
TOOLCHAIN=`pwd`/toolchains
OPENSSL_PATH="/home/brian/Projects/OpenSSL-for-Android-Prebuilt/openssl-1.1.1"
ZLIB_PATH="/opt/android/android-ndk-r19c/platforms/android-26/arch-arm/usr/lib"
$NDK_ROOT/build/tools/make-standalone-toolchain.sh --arch=arm --platform=$TARGET --install-dir=$TOOLCHAIN
export PATH=${TOOLCHAIN}/bin:$PATH
export CROSS_COMPILE="arm-linux-androideabi"
export CPPFLAGS="-I${OPENSSL_PATH}/include"
export LDFLAGS="-L${OPENSSL_PATH}/armeabi-v7a/lib -L${ZLIB_PATH}"
export AR=${CROSS_COMPILE}-ar
export AS=${CROSS_COMPILE}-as
export LD=${CROSS_COMPILE}-ld
export RANLIB=${CROSS_COMPILE}-ranlib
export CC=${CROSS_COMPILE}-gcc
export NM=${CROSS_COMPILE}-nm
export LIBS="-lssl -lcrypto"
set -x
git clone --depth=1 --branch curl-7_58_0 https://github.com/curl/curl.git
cd curl
./buildconf
./configure --host=${CROSS_COMPILE} --with-ssl --with-zlib --disable-ftp --disable-gopher --disable-file --disable-imap --disable-ldap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --without-gnutls --without-libidn --without-librtmp --disable-dict
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment