SKALE-1850 sgxwallet is build with all local dependencies

parent f3d36d37
...@@ -26,11 +26,13 @@ ...@@ -26,11 +26,13 @@
#include "sgxwallet.h" #include "sgxwallet.h"
#include <iostream> #include <iostream>
#include <memory>
#include <memory> #include <memory>
#include "SGXWalletServer.hpp" #include "SGXWalletServer.hpp"
#include "RPCException.h" #include "RPCException.h"
#include <libBLS/libff/libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp> //#include <libBLS/libff/libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
#include <libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
std::vector<std::string> SplitString(const char* koefs, const char symbol){ std::vector<std::string> SplitString(const char* koefs, const char symbol){
std::string str(koefs); std::string str(koefs);
...@@ -250,7 +252,7 @@ bool CreateBLSShare( const std::string& BLSKeyName, const char * s_shares, const ...@@ -250,7 +252,7 @@ bool CreateBLSShare( const std::string& BLSKeyName, const char * s_shares, const
if (!hex2carray(encryptedKeyHex, &dec_key_len, encr_key)){ if (!hex2carray(encryptedKeyHex, &dec_key_len, encr_key)){
throw RPCException(INVALID_HEX, "Invalid encryptedKeyHex"); throw RPCException(INVALID_HEX, "Invalid encryptedKeyHex");
} }
uint32_t enc_bls_len = 0; uint32_t enc_bls_len = 0;
std::cerr << "BEFORE create_bls_key IN ENCLAVE " << std::endl; std::cerr << "BEFORE create_bls_key IN ENCLAVE " << std::endl;
...@@ -341,8 +343,3 @@ std::vector<std::string> mult_G2(const std::string& x){ ...@@ -341,8 +343,3 @@ std::vector<std::string> mult_G2(const std::string& x){
result[3] = ConvertToString(elG2.Y.c1); result[3] = ConvertToString(elG2.Y.c1);
return result; return result;
} }
...@@ -91,10 +91,14 @@ secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so ...@@ -91,10 +91,14 @@ secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
## Use the variables, not the actual library names to ensure these ## Use the variables, not the actual library names to ensure these
## targets work on simulation builds. ## targets work on simulation builds.
sgxwallet_LDADD=-l$(SGX_URTS_LIB) -Lleveldb/build -LlibBLS/build -LlibBLS/build/libff/libff -l:libbls.a -l:libleveldb.a \ sgxwallet_LDADD=-l$(SGX_URTS_LIB) -LlibBLS/deps/deps_inst/x86_or_x64/lib -Lleveldb/build -LlibBLS/build \
-l:libff.a -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -ljsonrpccpp-stub -lpthread -ljsonrpccpp-common \ -LlibBLS/build/libff/libff \
-ljsonrpccpp-server -ljsonrpccpp-client -ljsoncpp -lcurl intel-sgx-ssl/Linux/package/lib64/libsgx_usgxssl.a \ -l:libbls.a -l:libleveldb.a \
intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a -l:libff.a -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a \
-ljsonrpccpp-stub -ljsonrpccpp-server -ljsonrpccpp-client -ljsonrpccpp-common -ljsoncpp -lmicrohttpd \
intel-sgx-ssl/Linux/package/lib64/libsgx_usgxssl.a \
intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a \
-lgnutls -lgcrypt -lcurl -lssl -lcrypto -lz -lpthread
testw_SOURCES=testw.cpp stubclient.cpp SGXWalletServer.cpp RPCException.cpp BLSCrypto.cpp ServerInit.cpp LevelDB.cpp \ testw_SOURCES=testw.cpp stubclient.cpp SGXWalletServer.cpp RPCException.cpp BLSCrypto.cpp ServerInit.cpp LevelDB.cpp \
......
...@@ -63,14 +63,6 @@ Currently the build builds with **automake 1.15**. You need to install it since ...@@ -63,14 +63,6 @@ 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; cd .. cd scripts; sudo dpkg -i automake_1.15.1-3ubuntu2_all.deb; cd ..
``` ```
## 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 ## Build dependencies
Dependencies only need to be built once. Dependencies only need to be built once.
...@@ -84,12 +76,11 @@ cd scripts; ./build.py; cd .. ...@@ -84,12 +76,11 @@ cd scripts; ./build.py; cd ..
Co to the project's top directory, then run Co to the project's top directory, then run
``` ```
export CFLAGS= libtoolize --force
export CXXFLAGS= aclocal
export LDFLAGS= autoheader
#autoreconf automake --force-missing --add-missing
autoconf autoconf
automake
./configure ./configure
``` ```
...@@ -98,6 +89,9 @@ automake ...@@ -98,6 +89,9 @@ automake
Go to project's top directory and run Go to project's top directory and run
``` ```
export CFLAGS=-I`readlink -f ./libBLS/deps/deps_inst/x86_or_x64/include`
export CXXFLAGS=-I`readlink -f ./libBLS/deps/deps_inst/x86_or_x64/include`
export LDFLAGS=-L`readlink -f ./libBLS/deps/deps_inst/x86_or_x64/lib`
make make
``` ```
......
...@@ -63,7 +63,7 @@ ENCLAVE_KEY=$(ENCLAVE)_private.pem ...@@ -63,7 +63,7 @@ ENCLAVE_KEY=$(ENCLAVE)_private.pem
## Additional Automake flags needed to build the enclave. ## Additional Automake flags needed to build the enclave.
## ##
AM_CPPFLAGS += -Wall -Wno-implicit-function-declaration $(TGMP_CPPFLAGS) -I../trusted_libff -I../sgx-sdk-build/sgxsdk/include/libcxx \ AM_CPPFLAGS += -Wall -Wno-implicit-function-declaration $(TGMP_CPPFLAGS) -I./trusted_libff -I../sgx-sdk-build/sgxsdk/include/libcxx \
-I../intel-sgx-ssl/Linux/package/include -I../intel-sgx-ssl/Linux/package/include
AM_CXXFLAGS += -fno-builtin AM_CXXFLAGS += -fno-builtin
......
...@@ -322,7 +322,7 @@ SGXSSL_BINDIR = @SGXSSL_BINDIR@ ...@@ -322,7 +322,7 @@ SGXSSL_BINDIR = @SGXSSL_BINDIR@
AM_CFLAGS = @SGX_ENCLAVE_CFLAGS@ AM_CFLAGS = @SGX_ENCLAVE_CFLAGS@
AM_CPPFLAGS = @SGX_ENCLAVE_CPPFLAGS@ -Wall \ AM_CPPFLAGS = @SGX_ENCLAVE_CPPFLAGS@ -Wall \
-Wno-implicit-function-declaration $(TGMP_CPPFLAGS) \ -Wno-implicit-function-declaration $(TGMP_CPPFLAGS) \
-I../trusted_libff -I../sgx-sdk-build/sgxsdk/include/libcxx \ -I./trusted_libff -I../sgx-sdk-build/sgxsdk/include/libcxx \
-I../intel-sgx-ssl/Linux/package/include -I../intel-sgx-ssl/Linux/package/include
AM_CXXFLAGS = @SGX_ENCLAVE_CXXFLAGS@ @SGX_ENCLAVE_CFLAGS@ -fno-builtin AM_CXXFLAGS = @SGX_ENCLAVE_CXXFLAGS@ @SGX_ENCLAVE_CFLAGS@ -fno-builtin
AM_LDFLAGS = @SGX_ENCLAVE_LDFLAGS@ $(TGMP_LDFLAGS) AM_LDFLAGS = @SGX_ENCLAVE_LDFLAGS@ $(TGMP_LDFLAGS)
......
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