本文是在配置armv7a的openssl的基础上进行的,armv7a的配置方法请参考下面的文章。
为arm64-v8a编译时首先需要替换的就是setenv这个设置环境变量的文件,具体的修改主要为:
使用的编译工具链需要修改为ndk中aarch64-linux-android-4.9目录里面的编译工具,
编译工具的目录的也要改为aarch64-linux-android-4.9。
修改好的setenv配置环境的文件请去下面的地址下载
https://download.csdn.net/download/hnlylyb/10489052
然后在配置OpenSSL时需要这么运行
./Configure no-shared no-ssl2 no-ssl3 no-comp no-hw no-engine android64-aarch64 --openssldir=/mnt/d/openssl-output/arm64-v8a/$ANDROID_API --prefix=/mnt/d/openssl-output/
arm64-v8a/$ANDROID_API
最后,调用openssl的v8a的so需要在build.gradle中编译部分要这么写
externalNativeBuild { cmake { cppFlags "-std=c++11 -frtti -fexceptions" arguments "-DANDROID_ABI=arm64-v8a" } }