Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- version=1.58.0
- echo "Building boost $version..."
- set -eu
- toolchain=$PWD/toolchain
- if [ ! -d "$toolchain" ]; then
- echo "Building toolchain..."
- $ANDROID_NDK_ROOT/build/tools/make-standalone-toolchain.sh \
- --arch=armeabi-v7a --platform=android-17 \
- --install-dir="$toolchain" \
- --toolchain=arm-linux-androideabi-clang \
- --use-llvm --stl=libc++
- else
- echo "Toolchain already built"
- fi
- dir_name=boost_$(sed 's#\.#_#g' <<< $version)
- archive=${dir_name}.tar.bz2
- if [ ! -f "$archive" ]; then
- wget -O $archive "http://downloads.sourceforge.net/project/boost/boost/$version/$archive?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F$version%2F&ts=1463606893&use_mirror=jaist"
- else
- echo "Archive $archive already downloaded"
- fi
- echo "Extracting..."
- if [ ! -d "$dir_name" ]; then
- # rm -rf $dir_name
- tar xf $archive
- else
- echo "Archive $archive already unpacked into $dir_name"
- fi
- cd $dir_name
- echo "Generating config..."
- user_config=tools/build/src/user-config.jam
- rm -f $user_config
- cat <<EOF > $user_config
- import os ;
- using clang : android
- :
- "$toolchain/bin/clang++"
- :
- <archiver>$toolchain/bin/arm-linux-androideabi-ar
- <ranlib>$toolchain/bin/arm-linux-androideabi-ranlib
- ;
- EOF
- echo "Bootstrapping..."
- ./bootstrap.sh
- # --with-coroutine \
- # --with-coroutine2 \
- echo "Building..."
- ./b2 -j16 \
- --with-atomic \
- --with-chrono \
- --with-date_time \
- --with-exception \
- --with-filesystem \
- --with-system \
- --with-test \
- --with-regex \
- --with-signals \
- --with-program_options \
- --with-thread \
- toolset=clang-android \
- architecture=arm \
- variant=release \
- --layout=versioned \
- target-os=android \
- threading=multi \
- threadapi=pthread \
- link=static \
- runtime-link=static \
- echo "Running ranlib on libraries..."
- libs=$(find "bin.v2/libs/" -name '*.so')
- for lib in $libs; do
- "$toolchain/bin/arm-linux-androideabi-ranlib" "$lib"
- done
- echo "Done!"
- # boost_regex
- # boost_filesystem
- # boost_unit_test_framework
- # boost_program_options
- # boost_system
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement