-
Notifications
You must be signed in to change notification settings - Fork 734
Expand file tree
/
Copy pathinstall-boost.sh
More file actions
executable file
·68 lines (59 loc) · 1.88 KB
/
Copy pathinstall-boost.sh
File metadata and controls
executable file
·68 lines (59 loc) · 1.88 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -ex
RIME_ROOT="$(cd "$(dirname "$0")"; pwd)"
. "${RIME_ROOT}/action-versions.sh"
BOOST_ROOT="${BOOST_ROOT=${RIME_ROOT}/deps/boost}"
boost_tarball="boost_${boost_version//./_}.tar.gz"
download_url="https://archives.boost.io/release/${boost_version}/source/${boost_tarball}"
boost_tarball_sha256sum="${boost_tarball_sha256sum} ${boost_tarball}"
download_boost_source() {
cd "${RIME_ROOT}/deps"
if ! [[ -f "${boost_tarball}" ]]; then
curl -LO "${download_url}"
fi
echo "${boost_tarball_sha256sum}" | shasum -a 256 -c
tar -xzf "${boost_tarball}"
mv "boost_${boost_version//./_}" "boost"
[[ -f "${BOOST_ROOT}/bootstrap.sh" ]]
}
boost_cxxflags='-arch arm64 -arch x86_64'
build_boost_macos() {
cd "${BOOST_ROOT}"
./bootstrap.sh --with-toolset=clang --with-libraries="${boost_libs}"
./b2 -q -a link=static architecture=arm cxxflags="${boost_cxxflags}" stage
for lib in stage/lib/*.a; do
lipo $lib -info
done
}
build_boost_linux() {
local boost_toolset=
if [[ "${CXX:-}" =~ clang ]]; then
boost_toolset=clang
elif [[ "${CXX:-}" =~ g\+\+|gcc ]]; then
boost_toolset=gcc
fi
cd "${BOOST_ROOT}"
if [[ -n "${boost_toolset}" ]]; then
./bootstrap.sh --with-toolset="${boost_toolset}" --with-libraries="${boost_libs}"
else
./bootstrap.sh --with-libraries="${boost_libs}"
fi
./b2 -q -a link=shared stage
}
if [[ $# -eq 0 || " $* " =~ ' --download ' ]]; then
if [[ ! -f "${BOOST_ROOT}/bootstrap.sh" ]]; then
download_boost_source
else
echo "found boost at ${BOOST_ROOT}"
fi
cd "${BOOST_ROOT}"
./bootstrap.sh
./b2 headers
fi
if [[ ($# -eq 0 || " $* " =~ ' --build ') && -n "${boost_libs}" ]]; then
if [[ "$OSTYPE" =~ 'darwin' ]]; then
build_boost_macos
elif [[ "$OSTYPE" =~ 'linux' ]]; then
build_boost_linux
fi
fi