-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
124 lines (105 loc) · 3.54 KB
/
build.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
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
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
#set -x
#check the required folder deps
if [ ! -d deps ];
then
echo 'Please make sure the directory [deps] is exist'
exit 0
fi
#########################################################################################################################
#check and comiple boost library
cd deps
if [ ! -d boost_1_63_0 ];
then
if [ ! -f boost_1_63_0.tar.gz ];
then
wget -c https://boostorg.jfrog.io/artifactory/main/release/1.63.0/source/boost_1_63_0.tar.gz -O boost_1_63_0.tar.gz
fi
if [ ! -f boost_1_63_0.tar.gz ];
then
echo "can't found boost_1_63_0.tar.gz"
exit 0
fi
tar -zxvf boost_1_63_0.tar.gz
cd boost_1_63_0
./bootstrap.sh --prefix=`pwd`
./b2 install link=static
rm -rf bin.v2
cd ..
fi
export BOOST_ROOT=`pwd`/boost_1_63_0
export PATH=$BOOST_ROOT:$PATH
#########################################################################################################################
#check and compile the blocklink_crosschain_privatekey library
if [ ! -d blocklink_crosschain_privatekey ];
then
if [ ! -f blocklink_crosschain_privatekey.tar.gz ];
then
echo "can't found blocklink_crosschain_privatekey.tar.gz"
exit 0
fi
tar -zxvf blocklink_crosschain_privatekey.tar.gz
cd blocklink_crosschain_privatekey
cmake -DBOOST_ROOT=`pwd`/../boost_1_63_0 .
make -j 4
cd ..
fi
export CROSSCHAIN_PRIVATEKEY_PROJECT=`pwd`/blocklink_crosschain_privatekey
if [ ! -f ${CROSSCHAIN_PRIVATEKEY_PROJECT}/libblocklink_libbitcoin.a ];
then
echo "The libblocklink_libbitcoin.a is not exist"
exit 0
fi
export PATH=$CROSSCHAIN_PRIVATEKEY_PROJECT:$PATH
#########################################################################################################################
#check and compile the eth_crosschain_privatekey library
if [ ! -d eth_crosschain_privatekey ];
then
if [ ! -f eth_crosschain_privatekey.tar.gz ];
then
echo "can't found eth_crosschain_privatekey.tar.gz"
exit 0
fi
tar -zxvf eth_crosschain_privatekey.tar.gz
cd eth_crosschain_privatekey/eth_sign
cmake -DBOOST_ROOT=`pwd`/../../boost_1_63_0 .
make -j 4
cd cryptopp
make -j 4
cd ../../../
fi
export ETH_CROSSCHAIN_PROJECT=`pwd`/eth_crosschain_privatekey
if [ ! -f ${ETH_CROSSCHAIN_PROJECT}/eth_sign/libeth_sign.a ];
then
echo "The libeth_sign.a is not exist"
exit 0
fi
export PATH=$ETH_CROSSCHAIN_PROJECT:$PATH
cd ..
#########################################################################################################################
#compile whitecoin source code now
chmod +x libraries/fc/vendor/secp256k1-zkp/autogen.sh
cmake -DCMAKE_BUILD_TYPE=Release .
make -j 4
#########################################################################################################################
#check the compile is complete
if [ ! -f programs/cli_wallet/cli_wallet ];
then
echo 'Compile the xwc_cli is failed, please contract the developer or whitecoin'
exit 0
fi
if [ ! -f programs/witness_node/witness_node ];
then
echo 'Compile the xwc_node is failed, please contract the developer or whitecoin'
exit 0
fi
#copy files
rm -rf output
mkdir output
cp programs/cli_wallet/cli_wallet output/xwc_cli
strip output/xwc_cli
cp programs/witness_node/witness_node output/xwc_node
strip output/xwc_node
echo '#################################################################'
echo '#Success Pelease get the executable file from directory: output '
echo '#################################################################'