forked from MrCyjaneK/monero_c
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_single.sh
More file actions
executable file
·112 lines (100 loc) · 3.48 KB
/
build_single.sh
File metadata and controls
executable file
·112 lines (100 loc) · 3.48 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
cd "$(realpath $(dirname $0))"
proccount=1
if [[ "x$(uname)" == "xDarwin" ]];
then
proccount=$(sysctl -n hw.physicalcpu)
elif [[ "x$(uname)" == "xLinux" ]];
then
proccount=$(nproc)
fi
function verbose_copy() {
echo "==> cp $1 $2"
cp $1 $2
}
set -e
repo=$1
if [[ "x$repo" == "x" ]];
then
echo "Usage: $0 monero/wownero/zano/beldex $(gcc -dumpmachine) -j$proccount"
exit 1
fi
if [[ "x$repo" != "xwownero" && "x$repo" != "xmonero" && "x$repo" != "xzano" && "x$repo" != "xbeldex" ]];
then
echo "Usage: $0 monero/wownero/zano/beldex $(gcc -dumpmachine) -j$proccount"
echo "Invalid target given"
exit 1
fi
if [[ ! -d "$repo" ]]
then
echo "no '$repo' directory found. clone with --recursive or run:"
echo '$ git submodule init && git submodule update --force';
exit 1
fi
HOST_ABI="$2"
if [[ "x$HOST_ABI" == "x" ]];
then
echo "Usage: $0 monero/wownero/beldex $(gcc -dumpmachine) -j$proccount"
exit 1
fi
NPROC="$3"
if [[ "x$NPROC" == "x" ]];
then
echo "Usage: $0 monero/wownero/beldex $(gcc -dumpmachine) -j$proccount"
exit 1
fi
cd $(dirname $0)
WDIR=$PWD
pushd contrib/depends
sbs_BOOST_VERSION=1_90_0
if [[ "x$repo" == "xzano" ]];
then
sbs_BOOST_VERSION=1_83_0
fi
if [[ "x$repo" == "xbeldex" ]];
then
sbs_BOOST_VERSION=1_83_0
sbs_SQLITE3_VERSION=3510100
if [[ "${HOST_ABI}" == "host-apple-ios" || "${HOST_ABI}" == "aarch64-apple-ios" || "${HOST_ABI}" == "aarch64-apple-iossimulator" ]];
then
sbs_SQLITE3_VERSION=3350500
fi
env PATH="$PATH" make "$NPROC" HOST="$HOST_ABI" BOOST_VERSION="${sbs_BOOST_VERSION}" SQLITE3_VERSION="${sbs_SQLITE3_VERSION}"
fi
if [[ "x$repo" != "xbeldex" ]];
then
env PATH="$PATH" make "$NPROC" HOST="$HOST_ABI" BOOST_VERSION="${sbs_BOOST_VERSION}"
fi
popd
# source contrib/depends/_native/_source_me
source contrib/depends/$HOST_ABI/_source_me
export PATH="$(pwd)/contrib/depends/_native/bin/:$(pwd)/contrib/depends/$HOST_ABI/native/bin:$PATH"
buildType=Release
for OUTPUT_MODE in SHARED;
do
pushd ${repo}_libwallet2_api_c
rm -rf build/${HOST_ABI}_${OUTPUT_MODE} || true
mkdir -p build/${HOST_ABI}_${OUTPUT_MODE}
if [[ "$repo" == "zano" ]];
then
EXTRA_CMAKE_FLAGS="-DCAKEWALLET=ON"
fi
if [[ "$repo" == "beldex" ]];
then
EXTRA_CMAKE_FLAGS="-DCAKEWALLET=ON"
if [[ "${HOST_ABI}" == "x86_64-apple-darwin11" || "${HOST_ABI}" == "aarch64-apple-darwin11" || "${HOST_ABI}" == "host-apple-darwin" || "${HOST_ABI}" == "x86_64-host-apple-darwin" || "${HOST_ABI}" == "aarch64-apple-darwin" || "${HOST_ABI}" == "x86_64-apple-darwin" || "${HOST_ABI}" == "host-apple-ios" || "${HOST_ABI}" == "aarch64-apple-ios" || "${HOST_ABI}" == "aarch64-apple-iossimulator" ]];
then
EXTRA_CMAKE_FLAGS="-DRANDOMX_ENABLE_JIT=OFF -DUSE_LTO=OFF"
fi
fi
pushd build/${HOST_ABI}_${OUTPUT_MODE}
cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../../contrib/depends/${HOST_ABI}/share/toolchain.cmake $EXTRA_CMAKE_FLAGS -DUSE_DEVICE_TREZOR=OFF -DMONERO_FLAVOR=$repo -DCMAKE_BUILD_TYPE=Debug -DHOST_ABI=${HOST_ABI} -DOUTPUT_MODE=${OUTPUT_MODE} ../..
make $NPROC
popd
popd
done
mkdir -p release/$(git describe --tags)/${HOST_ABI} 2>/dev/null || true
pushd release/$(git describe --tags)/${HOST_ABI}
pwd
mv ../../../${repo}_libwallet2_api_c/build/${HOST_ABI}_*/lib*_wallet2_api_c.* .
popd