Android NDK交叉编译sysstat工具

Android NDK交叉编译sysstat工具,第1张

Android NDK交叉编译sysstat工具 1. 下载 sysstat

    镜像下载路径:https://gitcode.net/mirrors/sysstat/sysstat/-/tree/v12.5.5

2. 下载ndk

    镜像下载路径:https://developer.android.google.cn/ndk/downloads?hl=zh-cn

    

3. 写编译脚本build.sh

脚本如下:

#!/bin/bash
###################################
#### build script for sysstat_v12.5.5
#### url:https://gitcode.net/mirrors/sysstat/sysstat/-/tree/v12.5.5
#### Date: 2021-12-28
#### Author: Tim
###################################

# ndk for linux https://developer.android.google.cn/ndk/downloads?hl=zh-cn
NDKROOT_PATH=/home/xxxx/workspace/tools/android-ndk-r23b

# current dir
CUR_PATH=$(pwd)

# only choose one of these, depending on your build machine...
export TOOLCHAIN=$NDKROOT_PATH/toolchains/llvm/prebuilt/linux-x86_64
# only choose one of these, depending on your device...
export TARGET=aarch64-linux-android
#export TARGET=armv7a-linux-androideabi
# Set this to your minSdkVersion.
export API=28
# Configure and build.
export AR=$TOOLCHAIN/bin/llvm-ar
export CC=$TOOLCHAIN/bin/$TARGET$API-clang
export AS=$CC
export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++
export LD=$TOOLCHAIN/bin/ld
export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
export STRIP=$TOOLCHAIN/bin/llvm-strip

# make install output dir.
if [ ! -d $CUR_PATH/out ]; then
mkdir -p $CUR_PATH/out
fi

./configure --host $TARGET --cache-file=$CUR_PATH/cache_file_0 --prefix=$CUR_PATH/out --exec-prefix=$CUR_PATH/out
make
make install

编译:# sudo ./build.sh 

4. 拷贝编译后的文件

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5684961.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存