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

android交叉编译

程序员文章站 2022-07-03 16:57:31
export NDK_PATH_PREFIX=/home/xx/android-ndk-r10export PATH=$NDK_PATH_PREFIX/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin:$PATHexport LDFLAGS="-nostdlib -L$NDK_PATH_PREFIX/platforms/android-9/arch-arm/usr/lib/ -L$NDK_PATH_PREFIX/sources/c...

export NDK_PATH_PREFIX=/home/xx/android-ndk-r10

export PATH=$NDK_PATH_PREFIX/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin:$PATH

export LDFLAGS="-L$NDK_PATH_PREFIX/platforms/android-9/arch-arm/usr/lib/ -L$NDK_PATH_PREFIX/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/"
export LIBS="$NDK_PATH_PREFIX/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/libsupc++.a"
export LIBS="$NDK_PATH_PREFIX/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/libgnustl_static.a -lc -lm"

export CPPFLAGS="-I$NDK_PATH_PREFIX/platforms/android-9/arch-arm/usr/include"
export CPPFLAGS="$CPPFLAGS -I$NDK_PATH_PREFIX/sources/cxx-stl/gnu-libstdc++/4.8/include" 
export CPPFLAGS="$CPPFLAGS -I$NDK_PATH_PREFIX/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include"
export CPPFLAGS="$CPPFLAGS --sysroot=$NDK_PATH_PREFIX/platforms/android-9/arch-arm"
export CFLAGS=--sysroot=$NDK_PATH_PREFIX/platforms/android-9/arch-arm
export CXXFLAGS=--sysroot=$NDK_PATH_PREFIX/platforms/android-9/arch-arm

./configure --prefix=$PWD/_install_android --host=arm-linux-androideabi

make clean

make && make install

本文地址:https://blog.csdn.net/d_l_u_f/article/details/109376510