forked from nanocurrency/nano-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-gitlab.sh
executable file
·83 lines (72 loc) · 1.84 KB
/
build-gitlab.sh
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
set -o xtrace
DISTRO_CFG=""
if [[ "$OSTYPE" == "linux-gnu" ]]; then
CPACK_TYPE="TBZ2"
distro=$(lsb_release -i -c -s|tr '\n' '_')
DISTRO_CFG="-DRAIBLOCKS_DISTRO_NAME=${distro}"
elif [[ "$OSTYPE" == "darwin"* ]]; then
CPACK_TYPE="DragNDrop"
elif [[ "$OSTYPE" == "cygwin" ]]; then
CPACK_TYPE="TBZ2"
elif [[ "$OSTYPE" == "msys" ]]; then
CPACK_TYPE="NSIS" #?
elif [[ "$OSTYPE" == "win32" ]]; then
CPACK_TYPE="NSIS"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
CPACK_TYPE="TBZ2"
DISTRO_CFG="-DRAIBLOCKS_DISTRO_NAME='freebsd'"
else
CPACK_TYPE="TBZ2"
fi
if [[ ${SIMD} -eq 1 ]]; then
SIMD_CFG="-DRAIBLOCKS_SIMD_OPTIMIZATIONS=ON"
CRYPTOPP_CFG=""
echo SIMD and other optimizations enabled
echo local CPU:
cat /proc/cpuinfo # TBD for macOS
else
SIMD_CFG=""
CRYPTOPP_CFG="-DCRYPTOPP_CUSTOM=ON"
fi
if [[ ${ASAN_INT} -eq 1 ]]; then
SANITIZERS="-DRAIBLOCKS_ASAN_INT=ON"
elif [[ ${ASAN} -eq 1 ]]; then
SANITIZERS="-DRAIBLOCKS_ASAN=ON"
elif [[ ${TSAN} -eq 1 ]]; then
SANITIZERS="-DRAIBLOCKS_TSAN=ON"
else
SANITIZERS=""
fi
if [[ "${BOOST_ROOT}" -ne "" ]]; then
BOOST_CFG="-DBOOST_ROOT='${BOOST_ROOT}'"
else
BOOST_CFG=""
fi
BUSYBOX_BASH=${BUSYBOX_BASH-0}
if [[ ${FLAVOR-_} == "_" ]]; then
FLAVOR=""
fi
set -o nounset
run_build() {
build_dir=build_${FLAVOR}
mkdir ${build_dir}
cd ${build_dir}
cmake -GNinja \
-DRAIBLOCKS_GUI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX="../install" \
${CRYPTOPP_CFG} \
${DISTRO_CFG} \
${SIMD_CFG} \
-DBOOST_ROOT=/usr/local/boost \
${BOOST_CFG} \
${SANITIZERS} \
..
cmake --build ${PWD} -- -v
cmake --build ${PWD} -- install -v
cpack -G ${CPACK_TYPE} ${PWD}
sha1sum *.tar* > SHA1SUMS
}
run_build