forked from EOSIO/eosio.cdt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·65 lines (56 loc) · 1.48 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
#! /bin/bash
printf "\t=========== Building eosio.wasmsdk ===========\n\n"
RED='\033[0;31m'
NC='\033[0m'
export DISK_MIN=10
export TEMP_DIR="/tmp"
unamestr=`uname`
if [[ "${unamestr}" == 'Darwin' ]]; then
BOOST=/usr/local
CXX_COMPILER=g++
export ARCH="Darwin"
export BOOST_ROOT=${BOOST}
bash ./scripts/eosio_build_darwin.sh
else
BOOST=~/opt/boost
OS_NAME=$( cat /etc/os-release | grep ^NAME | cut -d'=' -f2 | sed 's/\"//gI' )
export BOOST_ROOT=${BOOST}
case "$OS_NAME" in
"Amazon Linux AMI")
export ARCH="Amazon Linux AMI"
bash ./scripts/eosio_build_amazon.sh
;;
"CentOS Linux")
export ARCH="Centos"
bash ./scripts/eosio_build_centos.sh
;;
"elementary OS")
export ARCH="elementary OS"
bash ./scripts/eosio_build_ubuntu.sh
;;
"Fedora")
export ARCH="Fedora"
bash ./scripts/eosio_build_fedora.sh
;;
"Linux Mint")
export ARCH="Linux Mint"
bash ./scripts/eosio_build_ubuntu.sh
;;
"Ubuntu")
export ARCH="Ubuntu"
bash ./scripts/eosio_build_ubuntu.sh
;;
*)
printf "\\n\\tUnsupported Linux Distribution. Exiting now.\\n\\n"
exit 1
esac
fi
if [ $# -ge 1 ]; then
CORE_SYMBOL=$1
fi
CORES=`getconf _NPROCESSORS_ONLN`
mkdir -p build
pushd build &> /dev/null
cmake -DBOOST_ROOT="${BOOST}" -DCORE_SYMBOL_NAME="${CORE_SYMBOL}" ../
make -j${CORES}
popd &> /dev/null