mirror of https://github.com/aria2/aria2
android: Build and link with zlib
Previously, we linked with zlib shipped with NDK, but it seems this is not part of NDK API, and thus could break our app.pull/391/head
parent
eb9dafc247
commit
fb720b3077
|
@ -350,6 +350,7 @@ assumes the following libraries have been built for cross-compile:
|
||||||
* c-ares
|
* c-ares
|
||||||
* openssl
|
* openssl
|
||||||
* expat
|
* expat
|
||||||
|
* zlib
|
||||||
|
|
||||||
When building the above libraries, make sure that disable shared
|
When building the above libraries, make sure that disable shared
|
||||||
library and enable only static library. We are going to link those
|
library and enable only static library. We are going to link those
|
||||||
|
|
|
@ -55,13 +55,4 @@ PATH=$TOOLCHAIN/bin:$PATH
|
||||||
CFLAGS="-Os -g" \
|
CFLAGS="-Os -g" \
|
||||||
CPPFLAGS="-fPIE" \
|
CPPFLAGS="-fPIE" \
|
||||||
LDFLAGS="-fPIE -pie -L$PREFIX/lib" \
|
LDFLAGS="-fPIE -pie -L$PREFIX/lib" \
|
||||||
PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" \
|
PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig"
|
||||||
ZLIB_LIBS="-lz" \
|
|
||||||
ZLIB_CFLAGS="-I$TOOLCHAIN/sysroot/usr/include" \
|
|
||||||
LIBSSH2_LIBS="-lssh2" \
|
|
||||||
LIBSSH2_CFLAGS="-I$TOOLCHAIN/sysroot/usr/include"
|
|
||||||
|
|
||||||
# ZLIB_LIBS and ZLIB_CFLAGS are needed because aria2 configure script
|
|
||||||
# checks zlib availability using pkg-config, but android toochain does
|
|
||||||
# not provide pkg-config file. We need to specify these variables
|
|
||||||
# manually.
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
if [ -z "$ANDROID_HOME" ]; then
|
||||||
|
echo 'No $ANDROID_HOME specified.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
PREFIX=$ANDROID_HOME/usr/local
|
||||||
|
TOOLCHAIN=$ANDROID_HOME/toolchain
|
||||||
|
PATH=$TOOLCHAIN/bin:$PATH
|
||||||
|
|
||||||
|
HOST=arm-linux-androideabi
|
||||||
|
|
||||||
|
CC=$HOST-gcc \
|
||||||
|
AR=$HOST-ar \
|
||||||
|
LD=$HOST-ld \
|
||||||
|
RANLIB=$HOST-ranlib \
|
||||||
|
STRIP=$HOST-strip \
|
||||||
|
./configure \
|
||||||
|
--prefix=$PREFIX \
|
||||||
|
--libdir=$PREFIX/lib \
|
||||||
|
--includedir=$PREFIX/include \
|
||||||
|
--static
|
Loading…
Reference in New Issue