forked from JTNowitzki/dmchain_contract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
69 lines (62 loc) · 1.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
#! /bin/bash
TIME_BEGIN=$( date -u +%s )
RED='\033[0;31m'
NC='\033[0m'
CWD=`pwd`
if [ ! -d "/usr/local/eosio.wasmsdk" ]; then
cd eosio.wasmsdk
git submodule update --init --recursive
sed "s/bash .\/scripts/echo 1 | bash .\/scripts/g;s/\${CORE_SYMBOL}/DMC/g" build.sh | bash
cd build
sudo make install
cd ${CWD}
fi
# cd eosio.contracts
# sh build.sh
# cd ${CWD}
printf "\t=========== Building fibos.contracts ===========\n\n"
unamestr=`uname`
if [[ "${unamestr}" == 'Darwin' ]]; then
BOOST=/usr/local
CXX_COMPILER=g++
else
BOOST=~/opt/boost
OS_NAME=$( cat /etc/os-release | grep ^NAME | cut -d'=' -f2 | sed 's/\"//gI' )
case "$OS_NAME" in
"Amazon Linux AMI")
CXX_COMPILER=g++
C_COMPILER=gcc
;;
"CentOS Linux")
CXX_COMPILER=g++
C_COMPILER=gcc
;;
"elementary OS")
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
;;
"Fedora")
CXX_COMPILER=g++
C_COMPILER=gcc
;;
"Linux Mint")
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
;;
"Ubuntu")
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
;;
*)
printf "\\n\\tUnsupported Linux Distribution. Exiting now.\\n\\n"
exit 1
esac
fi
CORES=`getconf _NPROCESSORS_ONLN`
mkdir -p build
pushd build &> /dev/null
cmake -DCXX_COMPILER="${CXX_COMPILER}" -DBOOST_ROOT="${BOOST}" -DEOSIO_INSTALL_PREFIX=/usr/local ../fibos.contracts
make -j${CORES}
popd &> /dev/null
TIME_END=$(( $(date -u +%s) - ${TIME_BEGIN} ))
printf "\\n\\tfibos.contracts has been successfully built. %02d:%02d:%02d\\n\\n" $(($TIME_END/3600)) $(($TIME_END%3600/60)) $(($TIME_END%60))