You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
1.7 KiB

#!/bin/bash
# 接收参数
TARGET=$1
CONFIGOPTS=$2
echo -e "\n正在编译和安装 C++语言标准库扩展程序库(boost)……\n"
${SHELLROOT}/utils/begin_stage boost boost*.tar.gz
cd ${SHELLROOT}/tempDIR/`echo boost*.tar.gz | sed 's/\*.*//'`*
echo " * 正在修补Boost 以支持Python"
patch libs/python/src/exec.cpp ${SHELLROOT}/distfiles/boost.python-1.72.0.patch
PYVER=`${PYTHON_CMD} --version 2>&1 | cut -d' ' -f2 | cut -d '.' -f'1 2'`
TOOLSET=`if [[ $CLANG ]] ; then echo clang ; else echo gcc ; fi`
echo " * 正在编译安装 支持 python 的 C++语言标准库扩展程序库(boost)插件-${PYVER}"
sleep 2
if ! ./bootstrap.sh --with-toolset=$TOOLSET --without-icu --prefix=$TARGET/boost --with-python=/usr/bin/python${PYVER} --with-python-root=`python${PYVER} -c "import sys; print(sys.prefix)"` ; then
echo -e "\n !!! 支持 python 的 C++语言标准库扩展程序库(boost)插件,编译和安装失败\n"
exit 1
fi
# b2 debug options --debug-configuration -d0
if ./b2 $MAKEOPTS --debug-configuration -d0 -aq --toolset=$TOOLSET cflags="$CFLAGS" cxxflags="$CXXFLAGS" $CONFIGOPTS --prefix=$TARGET --layout=system --with-date_time --with-filesystem \
--with-iostreams --with-locale --with-program_options --with-python --with-regex --with-serialization --with-system --with-thread --with-chrono threading=multi link=static release install ; then
# Fix boost python lib names
mv -f $TARGET/lib/libboost_python*.a $TARGET/lib/libboost_python.a
mv -f $TARGET/lib/libboost_numpy*.a $TARGET/lib/libboost_numpy.a
echo -e "\n * C++语言标准库扩展程序库(boost),编译和安装成功\n"
else
echo -e "\n !!! C++语言标准库扩展程序库(boost),编译和安装失败\n"
exit 1
fi
exit 0