欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

交叉编译secp256k1 android版本so库

程序员文章站 2022-08-12 10:56:37
编译脚本,根据android架构进行修改#!/usr/bin/env bashset -eexport ANDROID_NDK=/root/zol/zolsvn/projects/kernelmodule/zollimit/android-ndk-r14bexport ARCH=arm64-v8aexport TOOLCHAIN=/root/zol/zolsvn/projects/kernelmodule/zollimit/android-ndk-r14b/toolchainsexpor...

编译脚本,根据android架构进行修改

#!/usr/bin/env bash
set -e

export ANDROID_NDK=/root/zol/zolsvn/projects/kernelmodule/zollimit/android-ndk-r14b
export TOOLCHAIN=$ANDROID_NDK/toolchains
export TOOLTARGET=aarch64-linux-android
export ARCH=arm64-v8a

export CC=$TOOLCHAIN/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/$TOOLTARGET-gcc
export LD=$TOOLCHAIN/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/$TOOLTARGET-ld
export AR=$TOOLCHAIN/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/$TOOLTARGET-ar
export AS=$TOOLCHAIN/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/$TOOLTARGET-as
export RANLIB=$TOOLCHAIN/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/$TOOLTARGET-ranlib
export STRIP=$TOOLCHAIN/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/$TOOLTARGET-strip
export ANDROID_SYSROOT=$ANDROID_NDK/platforms/android-21/arch-arm64
export CPPFLAGS="--sysroot=$ANDROID_SYSROOT"
export CFLAGS="--sysroot=$ANDROID_SYSROOT"
export CXXFLAGS="--sysroot=$ANDROID_SYSROOT"

./autogen.sh

./configure CFLAGS=-fpic --host=$TARGET --enable-experimental=no --enable-module_ecdh=no --enable-module-recovery=no --enable-benchmark=no --enable-shared=yes --enable-exhaustive-tests=no --enable-tests=no

make clean

make

 

本文地址:https://blog.csdn.net/weixin_28927079/article/details/112568905