zoukankan      html  css  js  c++  java
  • Ubuntu用android-ndk-r15c编译boost_1_65_1

    方法一(最简单的):

    下载:android-ndk-r16-beta1

    然后下载Boost-for-Android:https://github.com/moritz-wundke/Boost-for-Android 

    然后到Boost-for-Android的目录执行:

    ./build-android.sh /path/to/android-ndk-r16-beta1

    方法二(较复杂):

    解压:

    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文件夹下

  • 相关阅读:
    [引]Windows Server 2003 : 服务器群集
    周国平:(爱情)永远未完成
    企业管理常用缩写术语之中英文对照表(含解释)
    微软相关中文网站
    陈安之:NAC神经链调正术
    学会不要再争吵
    Oracle基础学习四:字符串 数字 日期 等 相关函数
    贪多嚼不烂
    frameset 框架传值点滴
    陈安之成功的十个关键
  • 原文地址:https://www.cnblogs.com/bugutian/p/7760602.html
Copyright © 2011-2022 走看看