|
| 1 | +#!/bin/bash |
| 2 | +# This recipe only downloads Boost and builds Boost.Build |
| 3 | +# Since Boost by default uses version numbers in the library names, it makes linking to them harder (as Android does not accept version numbers) |
| 4 | +# This is used in the libtorrent recipe and Boost.Build is used to (recursivly) compile Boost from the source here |
| 5 | +VERSION_boost=${VERSION_boost:-1.58.0} |
| 6 | +DEPS_boost=(python) |
| 7 | +URL_boost=http://downloads.sourceforge.net/project/boost/boost/${VERSION_boost}/boost_1_58_0.tar.gz # Don't forget to change the URL when changing the version |
| 8 | +MD5_boost=5a5d5614d9a07672e1ab2a250b5defc5 |
| 9 | +BUILD_boost=$BUILD_PATH/boost/$(get_directory $URL_boost) |
| 10 | +RECIPE_boost=$RECIPES_PATH/boost |
| 11 | + |
| 12 | +function prebuild_boost() { |
| 13 | + cd $BUILD_boost |
| 14 | + |
| 15 | + # Boost config locations |
| 16 | + RECIPECONFIG=${RECIPE_boost}/user-config.jam |
| 17 | + BOOSTCONFIG=${BUILD_boost}/tools/build/src/user-config.jam |
| 18 | + |
| 19 | + # Make Boost.Build |
| 20 | + ./bootstrap.sh --with-python=$HOSTPYTHON --with-python-root=$BUILD_PATH/python-install --with-python-version=2.7 |
| 21 | + |
| 22 | + # Place our own user-config in Boost.Build and set the PYTHON_INSTALL variable, delete any previous copy first, so that is can be modified when the build directory still exists |
| 23 | + if [ -e ${BOOSTCONFIG} ]; then |
| 24 | + try rm ${BOOSTCONFIG} |
| 25 | + fi |
| 26 | + try cp ${RECIPECONFIG} ${BOOSTCONFIG} |
| 27 | + |
| 28 | + # Replace the generated project-config with our own |
| 29 | + try rm $BUILD_boost/project-config.jam* |
| 30 | + try cp $RECIPE_boost/project-config.jam $BUILD_boost |
| 31 | + |
| 32 | + # Create Android case for library linking when building Boost.Python |
| 33 | + #FIXME: Not idempotent |
| 34 | + try sed -i "622i\ \ \ \ \ \ \ \ case * : return ;" tools/build/src/tools/python.jam |
| 35 | +} |
| 36 | + |
| 37 | +function build_boost() { |
| 38 | + cd $BUILD_boost |
| 39 | + |
| 40 | + # Export the Boost location to other recipes that want to know where to find Boost |
| 41 | + export BOOST_ROOT=$BUILD_boost |
| 42 | + # Export PYTHON_INSTALL as it is used in user-config |
| 43 | + export PYTHON_INSTALL="$BUILD_PATH/python-install" |
| 44 | + |
| 45 | + # Also copy libgnustl |
| 46 | + try cp $ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION/libs/$ARCH/libgnustl_shared.so $LIBS_PATH |
| 47 | + |
| 48 | + pop_arm |
| 49 | +} |
| 50 | + |
| 51 | +function postbuild_boost() { |
| 52 | + unset BOOST_ROOT |
| 53 | + unset PYTHONINSTALL |
| 54 | +} |
0 commit comments