Skip to content

Commit e986c7d

Browse files
authored
Merge pull request #513 from mapbox/build2-0.6.2
build2 0.6.2
2 parents f3faf75 + 1ce261c commit e986c7d

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

scripts/build2/0.6.2/.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: generic
2+
3+
matrix:
4+
include:
5+
- os: osx
6+
osx_image: xcode8.3
7+
compiler: clang
8+
- os: linux
9+
sudo: false
10+
addons:
11+
apt:
12+
sources:
13+
- ubuntu-toolchain-r-test
14+
packages:
15+
- libstdc++-5-dev
16+
17+
script:
18+
- ./mason build ${MASON_NAME} ${MASON_VERSION}
19+
- ./mason publish ${MASON_NAME} ${MASON_VERSION}

scripts/build2/0.6.2/script.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
3+
MASON_NAME=build2
4+
MASON_VERSION=0.6.2
5+
MASON_LIB_FILE=bin/bpkg
6+
7+
. ${MASON_DIR}/mason.sh
8+
9+
function mason_load_source {
10+
mason_download \
11+
https://download.build2.org/${MASON_VERSION}/build2-toolchain-${MASON_VERSION}.tar.gz \
12+
081d33ae551732c3b9cf6777c1055c1e415af496
13+
14+
mason_extract_tar_gz
15+
16+
export MASON_BUILD_PATH=${MASON_ROOT}/.build/build2-toolchain-${MASON_VERSION}
17+
}
18+
19+
function mason_compile {
20+
# NOTE: build2 requires a c++17 capable compiler and it uses CXX11_ABI features in libstdc++ (so it must be build with _GLIBCXX_USE_CXX11_ABI=1)
21+
# Since we want the binaries to be portable to pre cxx11 abi machines, we statically link against libc++ instead of linking against libstdc++
22+
# note with clang 4.x will hit "header 'shared_mutex' not found and cannot be generated" because c++17 support is lacking
23+
LDFLAGS=""
24+
if [[ $(uname -s) == 'Linux' ]]; then
25+
LDFLAGS="-Wl,--start-group -lc++ -lc++abi -pthread -lrt"
26+
fi
27+
perl -i -p -e "s/pthread/pthread -stdlib=libc++ ${LDFLAGS} /g;" ./build2/bootstrap.sh
28+
perl -i -p -e "s/=static/=static config.bin.exe.lib=static config.cxx.coptions=-stdlib=libc++ config.cxx.loptions='${LDFLAGS}' /g;" ./build.sh
29+
perl -i -p -e "s/suffix=-stage /suffix=-stage config.bin.lib=static config.bin.exe.lib=static config.cxx.coptions=-stdlib=libc++ config.cxx.loptions='${LDFLAGS}' /g;" ./build.sh
30+
perl -i -p -e "s/coptions=-O3 /coptions=-O3 config.bin.lib=static config.bin.exe.lib=static config.cxx.coptions=-stdlib=libc++ config.cxx.loptions='${LDFLAGS}' /g;" ./build.sh
31+
./build.sh --install-dir ${MASON_PREFIX} --sudo "" --trust yes ${CXX:-clang++}
32+
}
33+
34+
function mason_cflags {
35+
:
36+
}
37+
38+
function mason_static_libs {
39+
:
40+
}
41+
42+
function mason_ldflags {
43+
:
44+
}
45+
46+
mason_run "$@"

0 commit comments

Comments
 (0)