Files
SOMEIP/build_boost.sh

41 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2026-06-09 20:16:47 +08:00
#!/bin/sh
BASE_DIR=`pwd`
BOOST=boost_1_75_0
SOURCE_DIR=${BASE_DIR}/source/
INSTALL_DIR=${BASE_DIR}/install/
#检测source_code
cd ${SOURCE_DIR}
if [ ! -d ${SOURCE_DIR}/${BOOST} ];then
tar xvf boost_1_75_0.tar.gz
fi
rm -rf ${INSTALL_DIR}/${BOOST}
mkdir -p ${INSTALL_DIR}/${BOOST}
# 3.配置
echo "--- config start ---"
cd ${SOURCE_DIR}/${BOOST}
if [ ${BUILD_HOST} != ${TARGET_HOST} ];then
echo "--- config cross build ----"
./bootstrap.sh \
--with-libraries=system,thread,log \
--prefix=${INSTALL_DIR}/${BOOST}
#sed -r -i "s#using gcc ;#using gcc : arm : ${MY_CC} ;#" project-config.jam
sed -i "/using gcc/c using gcc : : ${MY_CC} ; " project-config.jam
else
./bootstrap.sh \
--with-libraries=system,thread,log
fi
# 4.编译
echo "--- make start ---"
if [ ${BUILD_HOST} != ${TARGET_HOST} ];then
./b2 --prefix=${INSTALL_DIR}/${BOOST} link=shared -j4 install #2>&1 | tee ./build.log
else
./b2 link=shared -j4 install #2>&1 | tee ./build.log
fi
echo "--- make end ---"
rm -rf ${SOURCE_DIR}/${BOOST}
echo "--- cleaned build folder ---"