SKALE-1850 sgxwallet is build with all local dependencies

parent f3d36d37
......@@ -26,11 +26,13 @@
#include "sgxwallet.h"
#include <iostream>
#include <memory>
#include <memory>
#include "SGXWalletServer.hpp"
#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::string str(koefs);
......@@ -250,7 +252,7 @@ bool CreateBLSShare( const std::string& BLSKeyName, const char * s_shares, const
if (!hex2carray(encryptedKeyHex, &dec_key_len, encr_key)){
throw RPCException(INVALID_HEX, "Invalid encryptedKeyHex");
}
uint32_t enc_bls_len = 0;
std::cerr << "BEFORE create_bls_key IN ENCLAVE " << std::endl;
......@@ -341,8 +343,3 @@ std::vector<std::string> mult_G2(const std::string& x){
result[3] = ConvertToString(elG2.Y.c1);
return result;
}
......@@ -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
## 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 \
-l:libff.a -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -ljsonrpccpp-stub -lpthread -ljsonrpccpp-common \
-ljsonrpccpp-server -ljsonrpccpp-client -ljsoncpp -lcurl intel-sgx-ssl/Linux/package/lib64/libsgx_usgxssl.a \
intel-sgx-ssl/Linux/package/lib64/libsgx_tsgxssl_crypto.a
sgxwallet_LDADD=-l$(SGX_URTS_LIB) -LlibBLS/deps/deps_inst/x86_or_x64/lib -Lleveldb/build -LlibBLS/build \
-LlibBLS/build/libff/libff \
-l:libbls.a -l:libleveldb.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 \
......
......@@ -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 ..
```
## 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.
......@@ -84,12 +76,11 @@ cd scripts; ./build.py; cd ..
Co to the project's top directory, then run
```
export CFLAGS=
export CXXFLAGS=
export LDFLAGS=
#autoreconf
libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
automake
./configure
```
......@@ -98,6 +89,9 @@ automake
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
```
......
......@@ -63,7 +63,7 @@ ENCLAVE_KEY=$(ENCLAVE)_private.pem
## 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
AM_CXXFLAGS += -fno-builtin
......
......@@ -322,7 +322,7 @@ SGXSSL_BINDIR = @SGXSSL_BINDIR@
AM_CFLAGS = @SGX_ENCLAVE_CFLAGS@
AM_CPPFLAGS = @SGX_ENCLAVE_CPPFLAGS@ -Wall \
-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
AM_CXXFLAGS = @SGX_ENCLAVE_CXXFLAGS@ @SGX_ENCLAVE_CFLAGS@ -fno-builtin
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