SKALE-1850 json and json-rpc libraries are built locally

parent 2c14e9a3
......@@ -3,33 +3,36 @@
gmp-build
tgmp-build
install-sh
/config.log
/config.status
/Makefile.in
/Makefile
/secure_enclave_u.h
/secure_enclave_u.c
/secure_enclave.edl
/am--include-marker
config.log
config.status
Makefile.in
Makefile
secure_enclave_u.h
secure_enclave_u.c
secure_enclave.edl
am--include-marker
*.o
/aclocal.m4
/secure_enclave.signed.so
/sgxgmpmath
/sgxgmppi
/.deps/
/CMakeCache.txt
/cmake_install.cmake
/sgxd.cbp
/sgx-gmp/
/sgx-sdk-build/
/secure_enclave/Makefile
/secure_enclave/secure_enclave.signed.so
/secure_enclave/secure_enclave.so
/secure_enclave/secure_enclave_t.c
/secure_enclave/secure_enclave_t.h
/sgxd
/cert/SGXServerCertificate*
/autom4te.cache
/sgxwallet
/testw
/configure
aclocal.m4
secure_enclave.signed.so
sgxgmpmath
sgxgmppi
.deps
CMakeCache.txt
cmake_install.cmake
sgxd.cbp
sgx-gmp
sgx-sdk-build
secure_enclave/Makefile
secure_enclave/secure_enclave.signed.so
secure_enclave/secure_enclave.so
secure_enclave/secure_enclave_t.c
secure_enclave/secure_enclave_t.h
sgxd
cert/SGXServerCertificate*
autom4te.cache
sgxwallet
testw
configure
jsonrpc/argtable2
jsonrpc/jsoncpp
jsonrpc/libjson-rpc-cpp
......@@ -55,6 +55,14 @@ Currently the build builds with **automake 1.15**. You need to install it since
`cd scripts; sudo dpkg -i automake_1.15.1-3ubuntu2_all.deb`
## Prepare custom root variables for locally build dependencies
```
export CFLAGS="-I`pwd`/libBLS/deps/deps_inst/x86_or_x64/include"
export CXXFLAGS="-I`pwd`/libBLS/deps/deps_inst/x86_or_x64/include"
export LDFLAGS="-L`pwd`/libBLS/deps/deps_inst/x86_or_x64/lib"
```
## Build dependencies
Dependencies only need to be built once.
......@@ -71,9 +79,6 @@ Co to the project's top directory, then run
autoreconf
autoconf
automake
export CFLAGS="-I `pwd`/libBLS/deps/deps_inst/x86_or_x64/include"
export CXXFLAGS="-I `pwd`/libBLS/deps/deps_inst/x86_or_x64/include"
export LDFLAGS="-L `pwd`/libBLS/deps/deps_inst/x86_or_x64/lib"
./configure
```
......
#!/bin/bash
export UNIX_SYSTEM_NAME=`uname -s`
export NUMBER_OF_CPU_CORES=1
if [ "$UNIX_SYSTEM_NAME" = "Linux" ];
then
export NUMBER_OF_CPU_CORES=`grep -c ^processor /proc/cpuinfo`
export READLINK=readlink
export SO_EXT=so
fi
if [ "$UNIX_SYSTEM_NAME" = "Darwin" ];
then
#export NUMBER_OF_CPU_CORES=`system_profiler | awk '/Number Of CPUs/{print $4}{next;}'`
export NUMBER_OF_CPU_CORES=`sysctl -n hw.ncpu`
# required -> brew install coreutils
export READLINK=/usr/local/bin/greadlink
export SO_EXT=dylib
fi
INSTALL_ROOT_RELATIVE="../libBLS/deps/deps_inst/x86_or_x64/"
INSTALL_ROOT=`$READLINK -f $INSTALL_ROOT_RELATIVE`
TOP_CMAKE_BUILD_TYPE="Release"
if [ "$DEBUG" = "1" ];
then
DEBUG=1
TOP_CMAKE_BUILD_TYPE="Debug"
DEBUG_D="d"
CONF_DEBUG_OPTIONS="--enable-debug"
else
DEBUG=0
DEBUG_D=""
CONF_DEBUG_OPTIONS=""
fi
git clone https://github.com/jonathanmarvens/argtable2.git
cd argtable2
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=$TOP_CMAKE_BUILD_TYPE ..
make
make install
cd ../..
tar -xzf ./pre_downloaded/jsoncpp.tar.gz
cd jsoncpp
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=$TOP_CMAKE_BUILD_TYPE \
-DBUILD_SHARED_LIBS=NO \
-DBUILD_STATIC_LIBS=YES \
..
make
make install
cd ../..
tar -xzf ./pre_downloaded/libjson-rpc-cpp.tar.gz
cd libjson-rpc-cpp
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=$TOP_CMAKE_BUILD_TYPE \
-DBUILD_SHARED_LIBS=NO \
-DBUILD_STATIC_LIBS=YES \
-DUNIX_DOMAIN_SOCKET_SERVER=YES \
-DUNIX_DOMAIN_SOCKET_CLIENT=YES \
-DFILE_DESCRIPTOR_SERVER=YES \
-DFILE_DESCRIPTOR_CLIENT=YES \
-DTCP_SOCKET_SERVER=YES \
-DTCP_SOCKET_CLIENT=YES \
-DREDIS_SERVER=NO \
-DREDIS_CLIENT=NO \
-DHTTP_SERVER=YES \
-DHTTP_CLIENT=YES \
-DCOMPILE_TESTS=NO \
-DCOMPILE_STUBGEN=YES \
-DCOMPILE_EXAMPLES=NO \
-DWITH_COVERAGE=NO \
-DARGTABLE_INCLUDE_DIR=../../argtable2/src \
-DARGTABLE_LIBRARY=$INSTALL_ROOT/lib/libargtable2${DEBUG_D}.a \
-DJSONCPP_INCLUDE_DIR=$INSTALL_ROOT/include \
..
make
make install
cd ../..
......@@ -66,9 +66,11 @@ GMP_BUILD_DIR = topDir + "/gmp-build"
TGMP_BUILD_DIR = topDir + "/tgmp-build"
SDK_DIR = topDir + "/sgx-sdk-build"
BLS_DIR = topDir + "/libBLS"
JSON_LIBS_DIR = topDir + "/jsonrpc"
AUTOMAKE_DIR = "/usr/share/automake-1.15"
if not os.path.isdir(AUTOMAKE_DIR):
raise Exception("Could not find " + AUTOMAKE_DIR)
#subprocess.call(["git", "submodule", "update", "--init"])
subprocess.call(["rm", "-f", "install-sh"])
......@@ -82,6 +84,7 @@ subprocess.call(["ln", "-s", AUTOMAKE_DIR + "/install-sh", "install-sh"])
subprocess.call(["ln", "-s", AUTOMAKE_DIR + "/depcomp", "depcomp"])
subprocess.call(["ln", "-s", AUTOMAKE_DIR + "/missing", "missing"])
subprocess.call(["ln", "-s", AUTOMAKE_DIR + "/compile", "compile"])
assert subprocess.call(["cp", "configure.gmp", GMP_DIR + "/configure"]) == 0
os.chdir(LEVELDB_DIR)
assert subprocess.call(["bash", "-c", "mkdir -p build"]) == 0
......@@ -117,7 +120,11 @@ os.chdir(SSL_SOURCE_DIR)
assert subprocess.call(["wget", "https://www.openssl.org/source/openssl-1.1.1b.tar.gz"]) == 0
print "===>>> Making SSL project"
os.chdir(SSL_MAKE_DIR)
assert subprocess.call(["make", "SGX_SDK=" + SGX_SDK_DIR_SSL, "all", "test"]) == 0
assert subprocess.call(["make", "SGX_SDK=" + SGX_SDK_DIR_SSL, "all", "test"]) == 0
#assert subprocess.call(["make", "SGX_SDK=" + SGX_SDK_DIR_SSL, "all" ]) == 0
os.chdir(JSON_LIBS_DIR)
assert subprocess.call(["bash", "-c", "./build.sh"]) == 0
os.chdir(topDir)
print("Build successfull.")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment