]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
doc: update instructions for Android
authorVincent Bernat <vincent@bernat.ch>
Wed, 27 Jan 2021 18:19:15 +0000 (19:19 +0100)
committerVincent Bernat <vincent@bernat.ch>
Wed, 27 Jan 2021 18:33:15 +0000 (19:33 +0100)
Android NDK is a less and less capable toolchain. The standalone
toolchain is deprecated and the new way require you to override a
bunch of variables. Documentation also contains mistakes.

README.md

index 32ba4e0ba500eb45775f4452a2395d1c956b05c2..8d856e31ec0f8d23f524df94e33bda09daafb6ac 100644 (file)
--- a/README.md
+++ b/README.md
@@ -114,27 +114,35 @@ user/group `_lldpd`. Have a look at how this is done in
 Installation (Android)
 ----------------------
 
-You need to download [Android NDK][]. Once unpacked, you can generate
-a toolchain using the following command (for ARM64):
+You need to download [Android NDK][]. Once unpacked, go inside the
+unpacked directory and select a toolchain, a target, and an API level:
 
-    ./build/tools/make-standalone-toolchain.sh \
-        --platform=android-24 \
-        --arch=arm64 \
-        --install-dir=../android-toolchain
-    export TOOLCHAIN=$PWD/../android-toolchain
+    export TOOLCHAIN=$PWD/toolchains/llvm/prebuilt/linux-x86_64
+    export TARGET=aarch64-linux-android
+    export API=24
+
+You need to export a bunch of variables:
+
+    export AR=$TOOLCHAIN/bin/llvm-ar
+    export CC=$TOOLCHAIN/bin/$TARGET$API-clang
+    export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++
+    export LD=$TOOLCHAIN/bin/ld
+    export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
+    export STRIP=$TOOLCHAIN/bin/llvm-strip
+    export AS=$CC
 
 Then, you can build `lldpd` with the following commands:
 
     mkdir build && cd build
-    export PATH=$PATH:$TOOLCHAIN/bin
     ../configure \
-        --host=arm64-linux-androideabi \
+        --host=$TARGET \
         --with-sysroot=$TOOLCHAIN/sysroot \
         --prefix=/system \
         --sbindir=/system/bin \
         --runstatedir=/data/data/lldpd \
         --with-privsep-user=root \
-        --with-privsep-group=root
+        --with-privsep-group=root \
+        PKG_CONFIG=/bin/false
     make
     make install DESTDIR=$PWD/install
 
@@ -142,7 +150,7 @@ Then, copy `install/system/bin/*` to `/system/bin` on the target
 system and `install/system/lib/*.so*` to `/system/lib` on the target
 system. You may need to create `/data/data/lldpd` as well.
 
-[Android NDK]: http://developer.android.com/tools/sdk/ndk/index.html
+[Android NDK]: https://developer.android.com/ndk
 
 Usage
 -----