未验证 提交 d1d86e83 编写于 作者: M Matt Witherspoon 提交者: GitHub

Merge pull request #5478 from EOSIO/secp256k1_as_external

Build secp256k1 as a submodule
......@@ -74,8 +74,6 @@ if ("${OPENSSL_ROOT_DIR}" STREQUAL "")
endif()
endif()
find_package(Secp256k1 REQUIRED)
if(UNIX)
if(APPLE)
set(whole_archive_flag "-force_load")
......
......@@ -59,7 +59,6 @@ find_library(liboscrypto crypto @OPENSSL_ROOT_DIR@/lib)
find_library(libosssl ssl @OPENSSL_ROOT_DIR@/lib)
find_library(libchainbase chainbase @CMAKE_INSTALL_FULL_LIBDIR@)
find_library(libbuiltins builtins @CMAKE_INSTALL_FULL_LIBDIR@)
find_library(libsecp256k1 secp256k1 @Secp256k1_ROOT_DIR@/lib)
macro(add_eosio_test test_name)
add_executable( ${test_name} ${ARGN} )
......
......@@ -59,7 +59,6 @@ find_library(liboscrypto crypto @OPENSSL_ROOT_DIR@/lib)
find_library(libosssl ssl @OPENSSL_ROOT_DIR@/lib)
find_library(libchainbase chainbase @CMAKE_BINARY_DIR@/libraries/chainbase)
find_library(libbuiltins builtins @CMAKE_BINARY_DIR@/libraries/builtins)
find_library(libsecp256k1 secp256k1 @Secp256k1_ROOT_DIR@/lib)
macro(add_eosio_test test_name)
add_executable( ${test_name} ${ARGN} )
......
......@@ -5,7 +5,7 @@ ARG symbol=SYS
RUN git clone -b $branch https://github.com/EOSIO/eos.git --recursive \
&& cd eos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \
&& cmake --build /tmp/build --target install && rm /tmp/build/bin/eosiocpp
......
......@@ -56,13 +56,6 @@ RUN wget https://github.com/WebAssembly/binaryen/archive/1.37.21.tar.gz -O - | t
&& cmake --build build --target install \
&& cd .. && rm -rf binaryen-1.37.21
RUN git clone --depth 1 https://github.com/cryptonomex/secp256k1-zkp \
&& cd secp256k1-zkp \
&& ./autogen.sh \
&& ./configure --prefix=/usr/local \
&& make -j$(nproc) install \
&& cd .. && rm -rf secp256k1-zkp
RUN git clone --depth 1 -b releases/v3.3 https://github.com/mongodb/mongo-cxx-driver \
&& cd mongo-cxx-driver/build \
&& cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. \
......
......@@ -5,7 +5,7 @@ ARG symbol=SYS
RUN git clone -b $branch https://github.com/EOSIO/eos.git --recursive \
&& cd eos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \
&& cmake -H. -B"/opt/eosio" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/eosio -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/opt/eosio -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \
&& cmake --build /opt/eosio --target install \
&& cp /eos/Docker/config.ini / && ln -s /opt/eosio/contracts /contracts && cp /eos/Docker/nodeosd.sh /opt/eosio/bin/nodeosd.sh && ln -s /eos/tutorials /tutorials
......
......@@ -120,7 +120,7 @@
pushd "${SOURCE_DIR}" &> /dev/null
STALE_SUBMODS=$(( $(git submodule status | grep -c "^[+\-]") ))
STALE_SUBMODS=$(( $(git submodule status --recursive | grep -c "^[+\-]") ))
if [ $STALE_SUBMODS -gt 0 ]; then
printf "\\n\\tgit submodules are not up to date.\\n"
printf "\\tPlease run the command 'git submodule update --init --recursive'.\\n"
......
Subproject commit 347f86ff17013f5010f5ad8142ad99c9bd0cd87a
Subproject commit 8edb92dd2310108b8eb66d010b84ca4fc9dce898
......@@ -528,63 +528,6 @@ fi
printf "\\tMongo C++ driver found at /usr/local/lib64/libmongocxx-static.a.\\n"
fi
printf "\\n\\tChecking secp256k1-zkp installation.\\n"
# install secp256k1-zkp (Cryptonomex branch)
if [ ! -e "/usr/local/lib/libsecp256k1.a" ]; then
printf "\\tInstalling secp256k1-zkp (Cryptonomex branch).\\n"
if ! cd "${TEMP_DIR}"
then
printf "\\n\\tUnable to enter directory %s.\\n" "${TEMP_DIR}"
printf "\\n\\tExiting now.\\n"
exit 1;
fi
if ! git clone https://github.com/cryptonomex/secp256k1-zkp.git
then
printf "\\tUnable to clone repo secp256k1-zkp @ https://github.com/cryptonomex/secp256k1-zkp.git.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! cd "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\n\\tUnable to cd into directory %s/secp256k1-zkp.\\n" "${TEMP_DIR}"
printf "\\n\\tExiting now.\\n"
exit 1;
fi
if ! ./autogen.sh
then
printf "\\tError running autogen for secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! ./configure
then
printf "\\tError running configure for secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! make -j"${JOBS}"
then
printf "\\tError compiling secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! sudo make install
then
printf "\\tError installing secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! rm -rf "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\tError removing directory %s/secp256k1-zkp.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
printf "\\tsecp256k1 successfully installed @ /usr/local/lib/libsecp256k1.a.\\n"
else
printf "\\tsecp256k1 found @ /usr/local/lib/libsecp256k1.a.\\n"
fi
printf "\\n\\tChecking LLVM with WASM support.\\n"
if [ ! -d "${HOME}/opt/wasm/bin" ]; then
printf "\\tInstalling LLVM & WASM.\\n"
......
......@@ -618,63 +618,6 @@ mongodconf
printf "\\tMongo C++ driver found at /usr/local/lib64/libmongocxx-static.a.\\n"
fi
printf "\\n\\tChecking secp256k1-zkp installation.\\n"
# install secp256k1-zkp (Cryptonomex branch)
if [ ! -e "/usr/local/lib/libsecp256k1.a" ]; then
printf "\\tInstalling secp256k1-zkp (Cryptonomex branch).\\n"
if ! cd "${TEMP_DIR}"
then
printf "\\n\\tUnable to enter directory %s.\\n" "${TEMP_DIR}"
printf "\\n\\tExiting now.\\n"
exit 1;
fi
if ! git clone https://github.com/cryptonomex/secp256k1-zkp.git
then
printf "\\tUnable to clone repo secp256k1-zkp @ https://github.com/cryptonomex/secp256k1-zkp.git.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! cd "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\n\\tUnable to cd into directory %s/secp256k1-zkp.\\n" "${TEMP_DIR}"
printf "\\n\\tExiting now.\\n"
exit 1;
fi
if ! ./autogen.sh
then
printf "\\tError running autogen for secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! ./configure
then
printf "\\tError running configure for secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! make -j"${JOBS}"
then
printf "\\tError compiling secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! sudo make install
then
printf "\\tError installing secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! rm -rf "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\tError removing directory %s/secp256k1-zkp.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
printf "\\n\\tsecp256k1 successfully installed @ /usr/local/lib.\\n\\n"
else
printf "\\tsecp256k1 found @ /usr/local/lib.\\n"
fi
printf "\\n\\tChecking LLVM with WASM support installation.\\n"
if [ ! -d "${HOME}/opt/wasm/bin" ]; then
printf "\\n\\tInstalling LLVM with WASM\\n"
......
......@@ -396,62 +396,6 @@
printf "\\tMongo C++ driver found at /usr/local/lib/libmongocxx-static.a.\\n"
fi
printf "\\n\\tChecking secp256k1-zkp installation.\\n"
# install secp256k1-zkp (Cryptonomex branch)
if [ ! -e "/usr/local/lib/libsecp256k1.a" ]; then
if ! cd "${TEMP_DIR}"
then
printf "\\tUnable to enter directory %s.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! git clone https://github.com/cryptonomex/secp256k1-zkp.git
then
printf "\\tUnable to clone repo secp256k1-zkp @ https://github.com/cryptonomex/secp256k1-zkp.git.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! cd "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\tUnable to enter directory %s/secp256k1-zkp.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! ./autogen.sh
then
printf "\\tError running autogen.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! ./configure
then
printf "\\tConfiguring secp256k1-zkp has returned the above error.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! make -j"${CPU_CORE}"
then
printf "\\tError compiling secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! sudo make install
then
printf "\\tInstalling secp256k1-zkp has returned the above error.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! rm -rf "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\tUnable to remove directory %s/secp256k1-zkp56k1-zkp.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
printf "\\n\\n\\tSuccessffully installed secp256k1 @ /usr/local/lib/.\\n\\n"
else
printf "\\tsecp256k1 found at /usr/local/lib/.\\n"
fi
printf "\\n\\tChecking LLVM with WASM support.\\n"
if [ ! -d /usr/local/wasm/bin ]; then
if ! cd "${TEMP_DIR}"
......
......@@ -393,63 +393,6 @@
printf "\\tMongo C++ driver found at /usr/local/lib64/libmongocxx-static.a.\\n"
fi
printf "\\n\\tChecking secp256k1-zkp installation.\\n"
# install secp256k1-zkp (Cryptonomex branch)
if [ ! -e "/usr/local/lib/libsecp256k1.a" ]; then
printf "\\tInstalling secp256k1-zkp (Cryptonomex branch).\\n"
if ! cd "${TEMP_DIR}"
then
printf "\\n\\tUnable to cd into directory %s.\\n" "${TEMP_DIR}"
printf "\\n\\tExiting now.\\n"
exit 1;
fi
if ! git clone https://github.com/cryptonomex/secp256k1-zkp.git
then
printf "\\tUnable to clone repo secp256k1-zkp @ https://github.com/cryptonomex/secp256k1-zkp.git.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! cd "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\n\\tUnable to cd into directory %s.\\n" "${TEMP_DIR}/secp256k1-zkp"
printf "\\n\\tExiting now.\\n"
exit 1;
fi
if ! ./autogen.sh
then
printf "\\tError running autogen for secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! ./configure
then
printf "\\tError running configure for secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! make -j"${JOBS}"
then
printf "\\tError compiling secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! sudo make install
then
printf "\\tError installing secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! rm -rf "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\tError removing directory %s.\\n" "${TEMP_DIR}/secp256k1-zkp"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
printf "\\n\\tsecp256k1 successfully installed @ /usr/local/lib.\\n\\n"
else
printf "\\tsecp256k1 found @ /usr/local/lib.\\n"
fi
printf "\\n\\tChecking LLVM with WASM support installation.\\n"
if [ ! -d "${HOME}/opt/wasm/bin" ]; then
printf "\\tInstalling LLVM & WASM\\n"
......
......@@ -421,63 +421,6 @@ mongodconf
printf "\\tMongo C++ driver found at /usr/local/lib/libmongocxx-static.a.\\n"
fi
printf "\\n\\tChecking secp256k1-zkp installation.\\n"
# install secp256k1-zkp (Cryptonomex branch)
if [ ! -e "/usr/local/lib/libsecp256k1.a" ]; then
printf "\\tInstalling secp256k1-zkp (Cryptonomex branch).\\n"
if ! cd "${TEMP_DIR}"
then
printf "\\n\\tUnable to cd into directory %s.\\n" "${TEMP_DIR}"
printf "\\n\\tExiting now.\\n"
exit 1;
fi
if ! git clone https://github.com/cryptonomex/secp256k1-zkp.git
then
printf "\\tUnable to clone repo secp256k1-zkp @ https://github.com/cryptonomex/secp256k1-zkp.git.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! cd "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\n\\tUnable to cd into directory %s.\\n" "${TEMP_DIR}/secp256k1-zkp"
printf "\\n\\tExiting now.\\n"
exit 1;
fi
if ! ./autogen.sh
then
printf "\\tError running autogen for secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! ./configure
then
printf "\\tError running configure for secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! make -j"${JOBS}"
then
printf "\\tError compiling secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! sudo make install
then
printf "\\tError installing secp256k1-zkp.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! rm -rf "${TEMP_DIR}/secp256k1-zkp"
then
printf "\\tError removing directory %s.\\n" "${TEMP_DIR}/secp256k1-zkp"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
printf "\\n\\tsecp256k1 successfully installed @ /usr/local/lib.\\n\\n"
else
printf "\\tsecp256k1 found @ /usr/local/lib.\\n"
fi
printf "\\n\\tChecking for LLVM with WASM support.\\n"
if [ ! -d "${HOME}/opt/wasm/bin" ]; then
# Build LLVM and clang with WASM support:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册