Build curl for Android ARM
- Build openssl:
123456789101112131415161718192021222324252627282930313233export ANDROID_HOME=/mnt/data/androidexport TOOLCHAIN=$ANDROID_HOME/toolchainexport CROSS_SYSROOT=$TOOLCHAIN/sysrootexport PATH=$TOOLCHAIN/bin:$PATHexport TOOL=arm-linux-androideabiexport CC=$TOOLCHAIN/bin/${TOOL}-gccexport CXX=$TOOLCHAIN/bin/${TOOL}-g++export LINK=${CXX}export LD=$TOOLCHAIN/bin/${TOOL}-ldexport AR=$TOOLCHAIN/bin/${TOOL}-arexport RANLIB=$TOOLCHAIN/bin/${TOOL}-ranlibexport STRIP=$TOOLCHAIN/bin/${TOOL}-stripexport ARCH_FLAGS="-mthumb"export ARCH_LINK=export CFLAGS="${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64"export CXXFLAGS="${CFLAGS} -frtti -fexceptions"export LDFLAGS="${ARCH_LINK}"export ARCH_FLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"export CFLAGS="${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64"export ARCH_LINK="-march=armv7-a -Wl,--fix-cortex-a8"export LDFLAGS="${ARCH_LINK}"./Configure android \--prefix=$TOOLCHAIN/sysroot/usr/local \--with-zlib-include=$TOOLCHAIN/sysroot/usr/include \--with-zlib-lib=$TOOLCHAIN/sysroot/usr/lib \zlib \no-asm \no-shared \no-unit-testmakemake install
- Build nghttp2
12345678910111213export CPPFLAGS="-fPIE -I$TOOLCHAIN/sysroot/usr/include"export LDFLAGS="-fPIE -pie -I$TOOLCHAIN/sysroot/usr/lib"export PKG_CONFIG_LIBDIR=$TOOLCHAIN/lib/pkgconfigcd nghttp2autoreconf -i./configure --enable-lib-only \--host=arm-linux-androideabi \--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \--disable-shared \--prefix="$TOOLCHAIN/sysroot/usr/local"makemake install
- Build curl: You should add LOCAL_CFLAGS += -fPIE to Android.mk
1234567891011121314151617181920./configure --prefix=$TOOLCHAIN/sysroot/usr/local \--with-sysroot=$TOOLCHAIN/sysroot \--host=arm-linux-androideabi \--with-ssl=$TOOLCHAIN/sysroot/usr/local \--with-nghttp2=$TOOLCHAIN/sysroot/usr/local \--enable-ipv6 \--enable-static \--enable-threaded-resolver \--disable-dict \--disable-gopher \--disable-ldap --disable-ldaps \--disable-manual \--disable-pop3 --disable-smtp --disable-imap \--disable-rtsp \--disable-shared \--disable-smb \--disable-telnet \--disable-verbosemake install