2016-06-07 90 views

回答

3

工作對我來說這

  1. 我創建了一個鏗鏘獨立的工具鏈https://developer.android.com/ndk/guides/standalone_toolchain.html
  2. 我我的道路設置爲PATH=/your/path/ndk/toolchain/bin
  3. 運行./bootstrap.sh --with-toolset=clang
  4. ./b2 toolset=clang cxxflags="-stdlib=libc++" threading=multi threadapi=pthread link=shared runtime-link=shared -j 6
  5. 我聯繫這aginst我的項目

我已經採取了旁觀

Compile and use boost for Android NDK R10e

http://nolimitsdesigns.com/game-design/how-to-build-boost-for-the-android-ndk-llvm/

3

構建boost_1_62_0爲Android-21 Windows64下這些頁面。

假設NDK安裝到C:\Programs\Android\sdk\ndk-bundle並提升c:\boost_1_62_0

安裝MinGW的:using msys2-x86_64 from MSYS2

安裝在mingw提示構建工具(像這樣):

$ pacman -S gcc binutils 

C:\boost_1_62_0\這樣的文本內容創建android.clang.jam文件:

import os ; 
local AndroidNDKRoot = C:/Programs/Android/sdk/ndk-bundle ; 
using clang : android 
: 
C:/Programs/Android/toolchain21/bin/clang++ 
: 
<compileflags>-fexceptions 
<compileflags>-frtti 
<compileflags>-fpic 
<compileflags>-ffunction-sections 
<compileflags>-funwind-tables 
<compileflags>-Wno-psabi 
<compileflags>-march=armv7-a 
<compileflags>-mfloat-abi=softfp 
<compileflags>-mfpu=vfpv3-d16 
<compileflags>-fomit-frame-pointer 
<compileflags>-fno-strict-aliasing 
<compileflags>-finline-limit=64 
<compileflags>-I$(AndroidNDKRoot)/platforms/android-21/arch-arm/usr/include 
<compileflags>-Wa,--noexecstack 
<compileflags>-DANDROID 
<compileflags>-D__ANDROID__ 
<compileflags>-DNDEBUG 
<compileflags>-O2 
#<compileflags>-g 
<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/include 
<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include 
<architecture>arm 
<compileflags>-fvisibility=hidden 
<compileflags>-fvisibility-inlines-hidden 
<compileflags>-fdata-sections 
<cxxflags>-D__arm__ 
<cxxflags>-D_REENTRANT 
<cxxflags>-D_GLIBCXX__PTHREADS 
; 

明暗提示的設置提升:

$ export NDK=/c/Programs/Android/sdk/ndk-bundle 
$ echo ensure msi-installed Python is on path (not msys version): 
$ export PATH=/c/Python27:$PATH 
$ $NDK/build/tools/make_standalone_toolchain.py --arch arm --api 21 --install-dir /c/Programs/Android/toolchain21 
$ ./bootstrap.sh --with-toolset=gcc 
$ ./b2 --user-config=android.clang.jam threading=multi link=static \ 
runtime-link=static toolset=clang-android target-os=linux \ 
threadapi=pthread --stagedir=android --with-chrono \ 
--with-program_options --with-system --with-thread --with-random \ 
--with-regex 
0

是的,您提到的存儲庫顯然不再被維護。作者似乎也不回答關於這個問題的任何郵件。如果你看起來你會看到在那裏支持的每個新的boost版本都需要很多工作(配置文件中有許多特殊的標誌)。這大概是爲什麼他沒有時間再維持下去。 我也嘗試使用叉子更新到1.64,但在無數錯誤消息後放棄,而是使用基於crystax腳本的不同方法。它的簡單,應該適用於幾乎任何版本。您可以在這裏找到詳細信息和腳本(簡單且無痛執行):http://silverglint.com/boost-for-android/ 適用於clang和gcc。

還包括一個示例應用程序,向您展示如何使用由此構建的增強二進制文件。