forked from chips-blockchain/chips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·43 lines (40 loc) · 1.57 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
#!/bin/bash
# EMC2 build script for Ubuntu & Debian 9 v.3 (c) Decker (and webworker)
# modified for CHIPS by Duke Leto
berkeleydb() {
CHIPS_ROOT=$(pwd)
CHIPS_PREFIX="${CHIPS_ROOT}/db4"
mkdir -p $CHIPS_PREFIX
wget -N 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c
tar -xzvf db-4.8.30.NC.tar.gz
cat <<-EOL >atomic-builtin-test.cpp
#include <stdint.h>
#include "atomic.h"
int main() {
db_atomic_t *p; atomic_value_t oldval; atomic_value_t newval;
__atomic_compare_exchange(p, oldval, newval);
return 0;
}
EOL
if g++ atomic-builtin-test.cpp -I./db-4.8.30.NC/dbinc -DHAVE_ATOMIC_SUPPORT -DHAVE_ATOMIC_X86_GCC_ASSEMBLY -o atomic-builtin-test 2>/dev/null; then
echo "No changes to bdb source are needed ..."
rm atomic-builtin-test 2>/dev/null
else
echo "Updating atomic.h file ..."
sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-4.8.30.NC/dbinc/atomic.h
fi
cd db-4.8.30.NC/build_unix/
../dist/configure -enable-cxx -disable-shared -with-pic -prefix=$CHIPS_PREFIX
make install
cd $CHIPS_ROOT
}
buildCHIPS() {
git pull
./autogen.sh
./configure LDFLAGS="-L${CHIPS_PREFIX}/lib/" CPPFLAGS="-I${CHIPS_PREFIX}/include/" --with-gui=no --disable-tests --disable-bench --without-miniupnpc --enable-experimental-asm --enable-static --disable-shared
make -j$(nproc)
}
berkeleydb
buildCHIPS
echo "Done building CHIPS!"