-
Notifications
You must be signed in to change notification settings - Fork 5
/
prepare-cpp_stl
executable file
·43 lines (37 loc) · 1.92 KB
/
prepare-cpp_stl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh -ef
. ./config
git clone --depth 1 https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime "$CPP_STL_RUNTIME_DIR"
git -C "$CPP_STL_RUNTIME_DIR" rev-parse HEAD
# On AppVeyor/Windows, pull some prereq libraries
if [ -n "$APPVEYOR" ]; then
vcpkg install boost-test:$ARCH-windows zlib:$ARCH-windows libiconv:$ARCH-windows
fi
# On GitHub Actions for macOS, install prereqs from brew
if [ -n "$GITHUB_ACTIONS" ] && [ "$RUNNER_OS" = macOS ]; then
brew install make
# NB: since commit
# https://github.com/Homebrew/homebrew-core/commit/c67b591208748bb8d07e79806c4963bbe1a9c866 made
# on 2024-04-26, we can no longer use just `brew install boost`
# (https://formulae.brew.sh/formula/boost), because it got updated to Boost 1.85, which then
# broke our `cpp_stl_98/clang14-macos-x86_64` CI job. Boost 1.85 apparently can no longer be
# compiled with `-std=c++98` because we were suddenly getting syntax errors in
# `/usr/local/include/boost/bind/mem_fn.hpp`. This is consistent with the
# [changelog](https://www.boost.org/users/history/version_1_85_0.html):
#
# > [Bind](https://www.boost.org/libs/bind/):
# > * C++03 is no longer supported; a C++11 compiler is required. (This includes GCC 4.7 or
# > later, and MSVC 12.0 (VS 2013) or later.)
#
# In the past https://formulae.brew.sh/formula/[email protected] was available, but it was disabled on
# 2024-12-14. Therefore, we resort to building Boost.Test from source, as we already do when
# building our `cpp_stl/gcc4.8-linux-x86_64` Docker image, see
# https://github.com/kaitai-io/kaitai_struct_docker_images/blob/f1f1d11ded824918c5bd5b5e1dbb6a48d8201b94/src/cpp_stl/gcc4.8-linux-x86_64/Dockerfile#L32-L57
set -x
curl -fsSLO https://archives.boost.io/release/1.81.0/source/boost_1_81_0.tar.bz2
tar --bzip2 -xf boost_1_81_0.tar.bz2
rm -f boost_1_81_0.tar.bz2
cd boost_1_81_0
./bootstrap.sh --with-libraries=test
sudo ./b2 -d0 --with-test variant=debug link=shared install
cd ..
fi