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

  1. #!/bin/bash
  2. # 接收参数
  3. TARGET=$1
  4. CONFIGOPTS=$2
  5. echo -e "\n正在编译和安装 C++语言标准库扩展程序库(boost)……\n"
  6. ${SHELLROOT}/utils/begin_stage boost boost*.tar.gz
  7. cd ${SHELLROOT}/tempDIR/`echo boost*.tar.gz | sed 's/\*.*//'`*
  8. echo " * 正在修补Boost 以支持Python"
  9. patch libs/python/src/exec.cpp ${SHELLROOT}/distfiles/boost.python-1.72.0.patch
  10. PYVER=`${PYTHON_CMD} --version 2>&1 | cut -d' ' -f2 | cut -d '.' -f'1 2'`
  11. TOOLSET=`if [[ $CLANG ]] ; then echo clang ; else echo gcc ; fi`
  12. echo " * 正在编译安装 支持 python 的 C++语言标准库扩展程序库(boost)插件-${PYVER}"
  13. sleep 2
  14. 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
  15. echo -e "\n !!! 支持 python 的 C++语言标准库扩展程序库(boost)插件,编译和安装失败\n"
  16. exit 1
  17. fi
  18. # b2 debug options --debug-configuration -d0
  19. if ./b2 $MAKEOPTS --debug-configuration -d0 -aq --toolset=$TOOLSET cflags="$CFLAGS" cxxflags="$CXXFLAGS" $CONFIGOPTS --prefix=$TARGET --layout=system --with-date_time --with-filesystem \
  20. --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
  21. # Fix boost python lib names
  22. mv -f $TARGET/lib/libboost_python*.a $TARGET/lib/libboost_python.a
  23. mv -f $TARGET/lib/libboost_numpy*.a $TARGET/lib/libboost_numpy.a
  24. echo -e "\n * C++语言标准库扩展程序库(boost),编译和安装成功\n"
  25. else
  26. echo -e "\n !!! C++语言标准库扩展程序库(boost),编译和安装失败\n"
  27. exit 1
  28. fi
  29. exit 0