码迷,mamicode.com
首页 > 移动开发 > 详细

Ubuntu用android-ndk-r15c编译boost_1_65_1

时间:2017-10-31 13:01:21      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:modules   div   config   macosx   sha   shared   .sh   class   ict   

解压:

unzip android-ndk-r15c-linux-x86_64.zip

unzip boost_1_65_1.zip

cd boost_1_65_1/

./bootstrap.sh

vim tools/build/example/user-config.jam

import os ;  
   
if [ os.name ] = CYGWIN || [ os.name ] = NT {  
androidPlatform = windows-x86_64 ;  
}  
else if [ os.name ] = LINUX {  
androidPlatform = linux-x86_64 ;  
}  
else if [ os.name ] = MACOSX {  
androidPlatform = darwin-x86 ;  
}  
   
modules.poke : NO_BZIP2 : 1 ;  
ANDROID_NDK = /path/to/android-ndk-r15c ;
using gcc : android4.9 : $(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++ :  
<archiver>$(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ar  
<ranlib>$(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ranlib  
<compileflags>--sysroot=$(ANDROID_NDK)/platforms/android-9/arch-arm  
<compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/include  
<compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include  

<compileflags>-DNDEBUG  
<compileflags>-D__GLIBC__  
<compileflags>-DBOOST_FILESYSTEM_VERSION=3  
<compileflags>-lstdc++  
<compileflags>-lgnustl_shared  
<compileflags>-mthumb  
<compileflags>-fno-strict-aliasing  
<compileflags>-std=gnu++11  
<compileflags>-O2
;  

cp  tools/build/example/user-config.jam  tools/build/src/

./b2 --with-system --with-serialization toolset=gcc-android4.9 link=static runtime-link=static target-os=linux --stagedir=android

静态库就生成在

boost_1_65_1/android/lib文件夹下

Ubuntu用android-ndk-r15c编译boost_1_65_1

标签:modules   div   config   macosx   sha   shared   .sh   class   ict   

原文地址:http://www.cnblogs.com/bugutian/p/7760602.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!