forked from decenomy/SAPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_linux.sh
executable file
·56 lines (48 loc) · 2.17 KB
/
build_linux.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
#!/bin/bash
echo -e "\033[0;32mHow many CPU cores do you want to be used in compiling process? (Default is 1. Press enter for default.)\033[0m"
read -e CPU_CORES
if [ -z "$CPU_CORES" ]
then
CPU_CORES=1
fi
echo -e "\033[0;32mDo you want to disable the tests? (yes/no)\033[0m"
read -e TEST_ANSWER
case "$TEST_ANSWER" in
[nN] | [n|N][O|o] ) TEST_STATUS='--enable-tests' # qt tests still have some problems
;; # so use --without-gui
[yY] | [yY][Ee][Ss] ) TEST_STATUS='--disable-tests'
;;
*) TEST_STATUS='--disable-tests'
;;
esac
echo -e "\033[0;32mDo you want to disable the debug? (yes/no)\033[0m"
read -e DEBUG_ANSWER
case "$DEBUG_ANSWER" in
[nN] | [n|N][O|o] ) DEBUG_STATUS='--enable-debug' # qt tests still have some problems
;; # so use --without-gui
[yY] | [yY][Ee][Ss] ) DEBUG_STATUS='--disable-debug'
;;
*) DEBUG_STATUS='--disable-debug'
;;
esac
# Upgrade the system and install required dependencies
sudo apt update
sudo apt install git zip unzip build-essential libtool bsdmainutils autotools-dev autoconf pkg-config automake python3 libqt5svg5-dev -y
# Clone code from official Github repository
rm -rf SAPP
git clone https://github.com/sappcoin-com/SAPP.git
# Entering directory
cd SAPP
# Compile dependencies
cd depends
make -j$(echo $CPU_CORES) HOST=x86_64-pc-linux-gnu
cd ..
# Compile
./autogen.sh
./configure --enable-glibc-back-compat --prefix=$(pwd)/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++" --enable-cxx --enable-static --disable-shared $(echo $DEBUG_STATUS) $(echo $TEST_STATUS) --disable-bench --with-pic --enable-upnp-default CPPFLAGS="-fPIC -O3 --param ggc-min-expand=1 --param ggc-min-heapsize=32768" CXXFLAGS="-fPIC -O3 --param ggc-min-expand=1 --param ggc-min-heapsize=32768"
make -j$(echo $CPU_CORES) HOST=x86_64-pc-linux-gnu
cd ..
# Create zip file of binaries
cp SAPP/src/sapphired SAPP/src/sapphire-cli SAPP/src/sapphire-tx SAPP/src/qt/sapphire-qt .
zip SAPP-$(git describe --abbrev=0 --tags | sed s/v//)-Linux.zip sapphired sapphire-cli sapphire-tx sapphire-qt
rm -f sapphired sapphire-cli sapphire-tx sapphire-qt