• Home
  • Raw
  • Download

Lines Matching +full:android +full:- +full:ndk

1 Building Android binary
4 In this article, we briefly describe how to build Android binary using
5 `Android NDK <https://developer.android.com/ndk/index.html>`_
6 cross-compiler on Debian Linux.
8 The easiest way to build android binary is use Dockerfile.android.
9 See Dockerfile.android for more details. If you cannot use
10 Dockerfile.android for whatever reason, continue to read the rest of
13 We offer ``android-config`` and ``android-make`` scripts to make the
14 build easier. To make these script work, NDK toolchain must be
19 ``$ANDROID_HOME/toolchain``, do this in the the directory where NDK is
22 .. code-block:: text
25 --arch arm --api 16 --stl gnustl \
26 --install-dir $ANDROID_HOME/toolchain
28 The API level (``--api``) is not important here because we don't use
29 Android specific C/C++ API.
31 The dependent libraries, such as OpenSSL, libev, and c-ares should be
37 Although zlib comes with Android NDK, it seems not to be a part of
41 Before running ``android-config`` and ``android-make``,
45 .. code-block:: text
51 .. code-block:: sh
55 if [ -z "$ANDROID_HOME" ]; then
63 export CROSS_COMPILE=$TOOLCHAIN/bin/arm-linux-androideabi-
64 ./Configure --prefix=$PREFIX android
70 <https://gist.github.com/tatsuhiro-t/48c45f08950f587180ed>`_ before
71 configuring libev. This patch is for libev-4.19. After applying the
74 .. code-block:: sh
78 if [ -z "$ANDROID_HOME" ]; then
87 --host=arm-linux-androideabi \
88 --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
89 --prefix=$PREFIX \
90 --disable-shared \
91 --enable-static \
92 CPPFLAGS=-I$PREFIX/include \
93 LDFLAGS=-L$PREFIX/lib
97 To configure c-ares, use the following script:
99 .. code-block:: sh
101 #!/bin/sh -e
103 if [ -z "$ANDROID_HOME" ]; then
112 --host=arm-linux-androideabi \
113 --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
114 --prefix=$PREFIX \
115 --disable-shared
119 .. code-block:: sh
121 #!/bin/sh -e
123 if [ -z "$ANDROID_HOME" ]; then
131 HOST=arm-linux-androideabi
133 CC=$HOST-gcc \
134 AR=$HOST-ar \
135 LD=$HOST-ld \
136 RANLIB=$HOST-ranlib \
137 STRIP=$HOST-strip \
139 --prefix=$PREFIX \
140 --libdir=$PREFIX/lib \
141 --includedir=$PREFIX/include \
142 --static
146 After prerequisite libraries are prepared, run ``android-config`` and
147 then ``android-make`` to compile nghttp2 source files.
153 .. code-block:: text
155 $ arm-linux-androideabi-strip src/nghttpx