diff --git a/Dockerfile.android b/Dockerfile.android index c53c7079..5fd2409a 100644 --- a/Dockerfile.android +++ b/Dockerfile.android @@ -65,9 +65,11 @@ RUN export CROSS_COMPILE=$TOOLCHAIN/bin/arm-linux-androideabi- && \ make && make install_sw WORKDIR /root/build -RUN curl -L -O https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz -RUN tar xf libevent-2.0.21-stable.tar.gz -WORKDIR /root/build/libevent-2.0.21-stable +RUN curl -L -O http://dist.schmorp.de/libev/libev-4.19.tar.gz +RUN curl -L -O https://gist.github.com/tatsuhiro-t/48c45f08950f587180ed/raw/80a8f003b5d1091eae497c5995bbaa68096e739b/libev-4.19-android.patch +RUN tar xf libev-4.19.tar.gz +WORKDIR /root/build/libev-4.19 +RUN patch -p1 < ../libev-4.19-android.patch RUN ./configure \ --host=arm-linux-androideabi \ --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \ @@ -94,6 +96,7 @@ RUN autoreconf -i && \ LIBSPDYLAY_CFLAGS=-I$PREFIX/usr/local/include \ LIBSPDYLAY_LIBS="-L$PREFIX/usr/local/lib -lspdylay" \ CPPFLAGS="-I$PREFIX/include" \ + CXXFLAGS="-fno-strict-aliasing" \ PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" \ LDFLAGS="-L$PREFIX/lib" && \ make && \ diff --git a/doc/sources/building-android-binary.rst b/doc/sources/building-android-binary.rst index 96981dcb..92160fb7 100644 --- a/doc/sources/building-android-binary.rst +++ b/doc/sources/building-android-binary.rst @@ -29,7 +29,7 @@ are using x86_64 system. The platform level is not important here because we don't use Android specific C/C++ API. -The dependent libraries, such as OpenSSL and libevent should be built +The dependent libraries, such as OpenSSL and libev should be built with the toolchain and installed under ``$ANDROID_HOME/usr/local``. We recommend to build these libraries as static library to make the deployment easier. libxml2 support is currently disabled. @@ -65,7 +65,10 @@ To configure OpenSSL, use the following script: And run ``make install`` to build and install. -To configure libevent, use the following script: +We cannot compile libev without modification. Apply `this patch +`_ before +configuring libev. This patch is for libev-4.19. After applying the +patch, to configure libev, use the following script: .. code-block:: sh