forked from decenomy/SAPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_windows.sh
executable file
·41 lines (33 loc) · 1.5 KB
/
build_windows.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
#!/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
# 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 curl g++-mingw-w64-x86-64 g++-mingw-w64-x86-64-posix libqt5svg5-dev -y
echo "1" | sudo update-alternatives --config x86_64-w64-mingw32-g++
# Clone code from official Github repository
rm -rf SAPP
git clone https://github.com/sappcoin-com/SAPP.git
# Entering directory
cd SAPP
# Disable WSL support for Win32 applications.
sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status"
# Compile dependencies
cd depends
make -j$(echo $CPU_CORES) HOST=x86_64-w64-mingw32
cd ..
# Compile
./autogen.sh
./configure --prefix=$(pwd)/depends/x86_64-w64-mingw32 --disable-debug --disable-tests --disable-bench --disable-online-rust --enable-upnp-default CFLAGS="-O3" CXXFLAGS="-O3"
make -j$(echo $CPU_CORES) HOST=x86_64-w64-mingw32
cd ..
# Create zip file of binaries
cp SAPP/src/sapphired.exe SAPP/src/sapphire-cli.exe SAPP/src/sapphire-tx.exe SAPP/src/qt/sapphire-qt.exe .
zip SAPP-Windows.zip sapphired.exe sapphire-cli.exe sapphire-tx.exe sapphire-qt.exe
rm -f sapphired.exe sapphire-cli.exe sapphire-tx.exe sapphire-qt.exe
# Enable WSL support for Win32 applications.
sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status"