diff --git a/README.rst b/README.rst index 648dbb61..9dc50122 100644 --- a/README.rst +++ b/README.rst @@ -350,6 +350,7 @@ assumes the following libraries have been built for cross-compile: * c-ares * openssl * expat +* zlib When building the above libraries, make sure that disable shared library and enable only static library. We are going to link those diff --git a/android-config b/android-config index 08a7f055..94de74d2 100755 --- a/android-config +++ b/android-config @@ -55,13 +55,4 @@ PATH=$TOOLCHAIN/bin:$PATH CFLAGS="-Os -g" \ CPPFLAGS="-fPIE" \ LDFLAGS="-fPIE -pie -L$PREFIX/lib" \ - 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. + PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" diff --git a/android/zlib-config b/android/zlib-config new file mode 100755 index 00000000..1203ef92 --- /dev/null +++ b/android/zlib-config @@ -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