Bootstrap

DLNA库Platinum新增安卓64位so编译方法

下载代码(该仓库我已经修改相关编译错误和支持安卓 64 位 so 编译)

git clone https://github.com/wesley666/Platinum -b master

下载Neptune

git submodule update --init

下载 ndk15:

https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip

建议安装 conda 环境来进行编译

https://www.anaconda.com/download/success

conda create -n dlna  python=2.7

pip install scons

conda activate dlna

编译

#以你的路径为准,如果出现路径错误,可以改成绝对路径
#export ANDROID_NDK_ROOT=/home/wesley/ndk/android-ndk-r15c/ 
export ANDROID_NDK_ROOT=~/ndk/android-ndk-r15c/ 
scons -c target=arm-android-linux build_config=Release
scons target=arm-android-linux build_config=Release
scons -c target=arm64-android-linux build_config=Release
scons target=arm64-android-linux build_config=Release
cd Source/Platform/Android/module/platinum
~/ndk/android-ndk-r15c/ndk-build clean
~/ndk/android-ndk-r15c/ndk-build NDK_DEBUG=0

(dlna) wesley@Wesley:~/Project/Platinum/Source/Platform/Android/module/platinum$ ~/ndk/android-ndk-r15c/ndk-build
Android NDK: Found platform level in ./project.properties. Setting APP_PLATFORM to android-14.
jni/Android.mk:5: “TARGET_ARCH_ABI:armeabi”
jni/Android.mk:5: “TARGET_ARCH_ABI:armeabi-v7a”
jni/Android.mk:5: “TARGET_ARCH_ABI:arm64-v8a”
jni/Android.mk:15: “build arm64”
[armeabi] Compile++ thumb: platinum-jni <= platinum-jni.cpp
[armeabi] StaticLibrary : libstdc++.a
[armeabi] SharedLibrary : libplatinum-jni.so
[armeabi] Install : libplatinum-jni.so => libs/armeabi/libplatinum-jni.so
[armeabi-v7a] Compile++ thumb: platinum-jni <= platinum-jni.cpp
[armeabi-v7a] StaticLibrary : libstdc++.a
[armeabi-v7a] SharedLibrary : libplatinum-jni.so
[armeabi-v7a] Install : libplatinum-jni.so => libs/armeabi-v7a/libplatinum-jni.so
[arm64-v8a] Compile++ : platinum-jni <= platinum-jni.cpp
[arm64-v8a] StaticLibrary : libstdc++.a
[arm64-v8a] SharedLibrary : libplatinum-jni.so
[arm64-v8a] Install : libplatinum-jni.so => libs/arm64-v8a/libplatinum-jni.so

obj和 libs目录区别:一个用于追溯和调试,一个用于正式版发布。

(dlna) wesley@Wesley:~/Project/Platinum/Source/Platform/Android/module/platinum$ file libs/arm64-v8a/libplatinum-jni.so
libs/arm64-v8a/libplatinum-jni.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=a8cdaa3a1288bd98c13556fbd4a1499e31005091, stripped

(dlna) wesley@Wesley:~/Project/Platinum/Source/Platform/Android/module/platinum$ file obj/local/arm64-v8a/libplatinum-jni.so
obj/local/arm64-v8a/libplatinum-jni.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=a8cdaa3a1288bd98c13556fbd4a1499e31005091, with debug_info, not stripped

;