ubuntu16.04编译boost for Android
2017-08-06 15:07
369 查看
下载boost源码
在官网下载指定版本的源码http://www.boost.org/users/history/
编译boost源码
1.进入源码目录执行./bootstrap.sh生成编译工具2.编辑project-config.jam文件,替换如下内容
# define platform name of ndk 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 ; } # replace with your own path ANDROID_NDK = "/home/gavinandre/Android/Sdk/ndk-bundle" ; # compile with gcc, you can change compiler to clang or others 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>-I$(ANDROID_NDK)/platforms/android-19/arch-arm/usr/include <compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/include <compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward <compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include <compileflags>-fexceptions <compileflags>-frtti <compileflags>-fpic <compileflags>-ffunction-sections <compileflags>-funwind-tables <compileflags>-D__ARM_ARCH_5__ <compileflags>-D__ARM_ARCH_5T__ <compileflags>-D__ARM_ARCH_5E__ <compileflags>-D__ARM_ARCH_5TE__ <compileflags>-D__ARM_ARCH_7__ <compileflags>-D__ARM_ARCH_7A__ <compileflags>-Wno-psabi <compileflags>-march=armv7-a <compileflags>-mtune=xscale <compileflags>-mfloat-abi=softfp <compileflags>-marm <compileflags>-mthumb <compileflags>-Os <compileflags>-std=gnu++11 <compileflags>-fomit-frame-pointer <compileflags>-fno-strict-aliasing <compileflags>-finline-limit=64 <compileflags>-Wa,--noexecstack <compileflags>-DANDROID <compileflags>-D__ANDROID__ <compileflags>-D__ARM_EABI__ <compileflags>-DNDEBUG <compileflags>-O2 <compileflags>-g ; # project default compiler project : default-build <toolset>gcc-android4.9 ; # replace with libraries you wanna to build libraries = --with-container --with-coroutine --with-coroutine2 --with-fiber --with-graph --with-graph_parallel --with-log --with-metaparse --with-python --with-test --with-type_erasure --with-atomic --with-date_time --with-program_options --with-chrono --with-context --with-iostreams --with-locale --with-mpi --with-serialization --with-signals --with-timer --with-wave --with-math --with-random --with-exception --with-filesystem --with-thread --with-system --with-regex --with-program_options ;
3.执行如下命令
./b2 toolset=gcc-android4.9 link=static threading=multi target-os=linux --stagedir=android_build
toolset表示指定编译工具,link表示编译成静态库,threading表示使用多线程编译,–stagedir表示指定编译文件生成目录名
4.之后等待编译完成即可
编译完成后可以在android_build目录下找到编译完的库文件
boost库在:android_build/lib下
参考:https://github.com/teamarkstudio/boost_for_android
相关文章推荐
- ubuntu16.04编译opencv for Android
- boost在Android平台的编译ubuntu16.04 ndk-r15
- ubuntu16.04编译dlib for Android
- sdl2 for android ubuntu开发环境搭建记录,编译SDL2 on ubuntu 16.04 x64
- Ubuntu 16.04 LTS 成功编译 Android 6.0 源码教程
- Ubuntu 16.04 64bit 编译 Android 4.4 源码
- win10+virtualbox+ubuntu16.04+anroid6.0源码编译android 系统,出现蓝屏
- Ubuntu下Chromium for Android 源码的编译
- 在ubuntu16.04上编译android源码【转】
- android 4.2 在12.4 for ubuntu 64bit 编译问题。
- Ubuntu14.04下编译busybox for android
- Ubuntu环境下编译WebRTC(for android)
- 【转】ubuntu 16.04 android 6.0 编译依赖
- Ubuntu14.04 vlc-for-android 编译过程
- ubuntu16.04 编译android 源码出现的错误
- ubuntu16.04编译android6_r1源码绕坑贴
- NanoPi K2 (Amlogic S905) Ubuntu 16.04 编译Android 5.1系统源码
- android源码编译(Ubuntu16.04 + Android 6.0)