forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathautogen.sh
executable file
·170 lines (146 loc) · 5.37 KB
/
autogen.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/sh
#
# Copyright (c) 2017-2019 The Energi Core developers
#
srcdir="$(dirname $0)"
if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then
LIBTOOLIZE="${GLIBTOOLIZE}"
export LIBTOOLIZE
fi
if [ "${SKIP_AUTO_DEPS}" = "true" ]; then
:
elif which apt-get >/dev/null 2>&1; then
deb_list=""
deb_list="${deb_list} python3-setuptools python3-dev"
deb_list="${deb_list} build-essential g++ libtool autotools-dev automake bsdmainutils pkg-config"
deb_list="${deb_list} autoconf autoconf2.13 autoconf2.64"
if ! which pip >/dev/null; then
rpm_list="${rpm_list} python3-pip"
fi
if [ "$HOST" = "x86_64-linux-musl" ]; then
deb_list="${deb_list} musl-dev musl-tools"
elif [ "$HOST" = "x86_64-w64-mingw32" ] || [ "$HOST" = "i686-w64-mingw32" ]; then
deb_list="${deb_list} mingw-w64 nsis"
if [ "$(lsb_release -is)" = "Ubuntu" ]; then
# old CI node
deb_list="${deb_list} wine-development wine64-development wine-binfmt"
else
deb_list="${deb_list} wine wine64 wine-binfmt"
fi
elif [ -z "$HOST" ]; then
deb_list="${deb_list} libssl-dev libevent-dev"
deb_list="${deb_list} libboost-system-dev libboost-filesystem-dev libboost-chrono-dev"
deb_list="${deb_list} libboost-program-options-dev libboost-test-dev libboost-thread-dev"
deb_list="${deb_list} libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools"
deb_list="${deb_list} libprotobuf-dev protobuf-compiler"
deb_list="${deb_list} libqrencode-dev"
deb_list="${deb_list} libminiupnpc-dev libzmq3-dev"
deb_list="${deb_list} libdb4.8-dev libdb4.8++-dev"
deb_list="${deb_list} lcov default-jre-headless"
deb_list="${deb_list} ccache"
deb_list="${deb_list} clang-5.0"
fi
deb_to_install=""
for d in $deb_list; do
if ! dpkg -s $d >/dev/null 2>&1; then
case $d in
libdb4.8*)
echo 'Please manually install libdb4.8-dev & libdb4.8++-dev'
echo ' from https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin/+packages'
exit 1
;;
*)
deb_to_install="${deb_to_install} ${d}"
;;
esac
fi
done
if [ -n "${deb_to_install}" ]; then
echo "Auto-trying to install Debian/Ubuntu deps"
set -x
sudo -n /usr/bin/apt-get install --no-install-recommends -y ${deb_to_install}
set +x
fi
pip_install() {
( which futoin-cid && cd $srcdir && CC=gcc CXX=g++ cte pip install "$@" )
for pip in /usr/local/bin/pip3 /usr/bin/pip3 /usr/local/bin/pip3 /usr/bin/pip; do
if [ -e $pip ]; then
CC=gcc CXX=g++ $pip install --user "$@";
break
fi
done
}
elif which yum >/dev/null 2>&1; then
rpm_list=""
rpm_list="${rpm_list} python-setuptools python-devel"
rpm_list="${rpm_list} boost-devel ccache"
rpm_list="${rpm_list} automake autoconf autoconf213 autoconf-archive"
rpm_list="${rpm_list} qt5-qtbase-devel qt5-qtbase-gui qt5-qttools-devel"
rpm_list="${rpm_list} protobuf-devel"
rpm_list="${rpm_list} qrencode-devel"
rpm_list="${rpm_list} libevent-devel"
rpm_list="${rpm_list} miniupnpc-devel czmq-devel"
rpm_list="${rpm_list} libdb4-devel libdb4-cxx-devel"
rpm_list="${rpm_list} openssl-devel"
if ! which pip >/dev/null; then
rpm_list="${rpm_list} python2-pip"
fi
rpm_to_install=""
for d in $rpm_list; do
if ! rpm -q $d >/dev/null 2>&1; then
rpm_to_install="${rpm_to_install} ${d}"
fi
done
if [ -n "${rpm_to_install}" ]; then
echo "Auto-trying to install RPM deps"
set -x
sudo -n /usr/bin/yum install -y ${rpm_to_install}
set +x
fi
pip_install() {
( which futoin-cid && cd $srcdir && CC=gcc CXX=g++ cte pip install "$@" )
CC=gcc CXX=g++ /bin/pip install --user "$@"
}
elif which brew >/dev/null 2>&1; then
brew_list=""
brew_list="${brew_list} ccache"
for f in $brew_list; do
brew install $f || true
done
pip_install() {
( which futoin-cid && cd $srcdir && cte pip install "$@" )
/usr/local/bin/pip install --user "$@"
}
else
pip_install() {
:
}
fi
#---
pip_install pyzmq
pip_install -U nrghash
#---
which autoreconf >/dev/null || \
(echo "configuration failed, please install autoconf first" && exit 1)
autoreconf --install --force --warnings=all $srcdir
if [ -n "$HOST" ]; then
case "$HOST" in
*-w64-mingw32)
# Need to update alternatives, ignore failure
sudo -n update-alternatives --set $HOST-gcc /usr/bin/$HOST-gcc-posix || true
sudo -n update-alternatives --set $HOST-g++ /usr/bin/$HOST-g++-posix || true
;;
esac
# TODO: create a separate Energi SDK
echo "Preparing dependencies"
# Ensure sysroot is clean of older versions which are unpacked from built folder
rm -rf $srcdir/depends/$HOST
make -C $srcdir/depends HOST=$HOST -j${MAKEJOBS:-$(nproc)}
install_dir=$srcdir/build/${ENERGI_VER:-energi}
mkdir -p $install_dir
if [ "$(uname)" = "Darwin" ]; then
cp -Rpf $srcdir/depends/$HOST/* $install_dir/
else
cp -rauf $srcdir/depends/$HOST/* $install_dir/
fi
fi