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.
 

38 lines
1.7 KiB

if [ -f "${LIB_DIR}/libboost_regex.a" ]; then
echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
exit 0
fi
BOOST_DIR="${TMP_DIR}/boost"
if [ ! -d "${BOOST_DIR}" ]; then
git clone -b boost-1.73.0 --recursive https://github.com/boostorg/boost.git
fi
pushd "${BOOST_DIR}"
rm -rf "stage"
./bootstrap.sh --with-toolset=clang-darwin macosx-version-min=${MACOSX_DEPLOYMENT_TARGET} cxxflags="-arch ${ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" cflags="-arch ${ARCH} -isysroot ${SDK_PATH}" linkflags="-arch ${ARCH}"
BOOST_TOOLSET="toolset=clang-darwin"
BOOST_TARGET="target-os=darwin"
USED_BOOST_LIBS_ARGS="--with-regex --with-filesystem --with-program_options --with-thread --with-system"
if [ ${ARCH} = "x86_64" ]; then
./b2 clean
./b2 ${BOOST_TOOLSET} ${BOOST_TARGET} architecture=x86 -std=c++11 cxxflags="-arch ${ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" cflags="-arch ${ARCH}" linkflags="-arch ${ARCH} " ${USED_BOOST_LIBS_ARGS} stage
./b2 install
elif [ ${ARCH} = "arm64" ]; then
./b2 clean
./b2 ${BOOST_TOOLSET} ${BOOST_TARGET} architecture=arm -std=c++11 abi=aapcs cxxflags="-arch ${ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" cflags="-arch ${ARCH}" linkflags="-arch ${ARCH}" ${USED_BOOST_LIBS_ARGS} stage
./b2 install
else
echo "unhandled ARCH"
exit 1
fi
# Copy *.a files
TARGET_DIR="${CURRENT_LIB_DIR}/lib"
mkdir -p "${TARGET_DIR}"
cp stage/lib/*.a "${TARGET_DIR}"
# Copy Headers
TARGET_DIR="${CURRENT_LIB_DIR}/include/"
#cp -r boost "${TARGET_DIR}"
rsync -rL boost "${TARGET_DIR}"
popd