Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,7 @@ endif()

find_package(LibEvent REQUIRED)

find_package(GMP)
if(GMP_FOUND)
else()
message(WARNING "GMP not found, falling back to OpenSSL for bignum!")
set(BIGNUM_CONFIGURE_FLAGS "--with-zerocoin-bignum=openssl")
endif()
find_package(GMP REQUIRED)

find_package(ZMQ)
find_package(Miniupnp)
Expand Down Expand Up @@ -363,11 +358,6 @@ set(ZEROCOIN_SOURCES
./src/libzerocoin/ParamGeneration.cpp
./src/libzerocoin/Params.cpp
)
if(GMP_FOUND)
list(APPEND ZEROCOIN_SOURCES ./src/libzerocoin/bignum_gmp.cpp)
else()
list(APPEND ZEROCOIN_SOURCES ./src/libzerocoin/bignum_openssl.cpp)
endif()
add_library(ZEROCOIN_A STATIC ${ZEROCOIN_SOURCES})
target_include_directories(ZEROCOIN_A PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
${OPENSSL_INCLUDE_DIR}
Expand Down Expand Up @@ -529,14 +519,11 @@ target_link_libraries(pivx-tx
secp256k1
SAPLING_A
rustzcash
${Boost_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY} ${LIBEVENT_LIB} ${sodium_LIBRARY_RELEASE} -ldl pthread
${Boost_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY} ${LIBEVENT_LIB} ${sodium_LIBRARY_RELEASE} ${GMP_LIBRARY} -ldl pthread
)
if($ENV{target} MATCHES "Windows")
target_link_libraries(pivx-tx ${WINDOWS_LDADD})
endif()
if(GMP_FOUND)
target_link_libraries(pivx-tx ${GMP_LIBRARY})
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(pivx-tx "-framework Cocoa")
endif()
Expand All @@ -551,7 +538,8 @@ target_include_directories(pivxd PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb
${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include
${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/helpers/memenv
${LIBEVENT_INCLUDE_DIR})
${LIBEVENT_INCLUDE_DIR}
${GMP_INCLUDE_DIR})
target_link_libraries(pivxd
pthread
SERVER_A
Expand All @@ -566,16 +554,12 @@ target_link_libraries(pivxd
crc32c
secp256k1
rustzcash
${BerkeleyDB_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES} ${LIBEVENT_LIB} pthread
${BerkeleyDB_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES} ${LIBEVENT_LIB} ${GMP_LIBRARY} pthread
)
if($ENV{target} MATCHES "Windows")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wstack-protector -fstack-protector-all -fPIE -pipe -O2 -pthread -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va -pie --static")
target_link_libraries(pivxd ${WINDOWS_LDADD})
endif()
if(GMP_FOUND)
target_link_libraries(pivxd ${GMP_LIBRARY})
target_include_directories(pivxd PUBLIC ${GMP_INCLUDE_DIR})
endif()
if(ZMQ_FOUND)
target_link_libraries(pivxd ZMQ_A ${ZMQ_LIB})
target_include_directories(pivxd PUBLIC ${ZMQ_INCLUDE_DIR})
Expand Down
1 change: 0 additions & 1 deletion build-aux/m4/gmp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if test x"$has_gmp" != x"yes"; then
AC_CHECK_LIB(gmp, __gmpz_init,[
has_gmp=yes;
LIBS="$LIBS -lgmp";
AC_DEFINE(HAVE_LIBGMP, 1, [Define this symbol if libgmp is installed])
])
])
fi
Expand Down
57 changes: 6 additions & 51 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ AC_ARG_ENABLE([zmq],
[use_zmq=$enableval],
[use_zmq=yes])

AC_ARG_WITH([zerocoin-bignum],
[AS_HELP_STRING([--with-zerocoin-bignum=gmp|openssl|auto],
[Specify Bignum Implementation. Default is auto])],
[req_bignum=$withval],
[req_bignum=auto])

AC_ARG_ENABLE(man,
[AS_HELP_STRING([--disable-man],
[do not install man pages (default is to install)])],,
Expand Down Expand Up @@ -1159,6 +1153,12 @@ else
fi
fi

dnl gmp check
GMP_CHECK
if test x"$has_gmp" != x"yes"; then
AC_MSG_ERROR([libgmp not found])
fi

dnl univalue check

need_bundled_univalue=yes
Expand Down Expand Up @@ -1265,32 +1265,6 @@ if test "x$use_ccache" = "xyes"; then
AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"])
fi

dnl bignum value
set_bignum=$req_bignum
case $req_bignum in
auto)
GMP_CHECK
if test x"$has_gmp" != x"yes"; then
AC_MSG_ERROR([gmp bignum automatically selected but libgmp is not available. Use depends,
install libgmp or select an other bignum implementation (ONLY gmp is fully SUPPORTED)])
else
set_bignum=gmp
fi
;;
gmp)
GMP_CHECK
if test x"$has_gmp" != x"yes"; then
AC_MSG_ERROR([gmp bignum explicitly requested but libgmp is not available])
fi
;;
openssl)
AC_MSG_WARN([openssl bignum explicitly requested. This is DEPRECATED.])
;;
*)
AC_MSG_ERROR([invalid bignum implementation selection])
;;
esac

dnl enable wallet
AC_MSG_CHECKING([if wallet should be enabled])
if test x$enable_wallet != xno; then
Expand Down Expand Up @@ -1381,22 +1355,6 @@ fi

AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])

# select bignum implementation
case $set_bignum in
gmp)
AC_DEFINE(USE_NUM_GMP, 1, [Define this symbol to use the gmp implementation])
;;
openssl)
AC_DEFINE(USE_NUM_OPENSSL, 1, [Define this symbol to use openssl implementation])
;;
*)
AC_MSG_ERROR([invalid bignum implementation])
;;
esac

AM_CONDITIONAL([USE_NUM_GMP], [test "x$set_bignum" = "xgmp"])
AM_CONDITIONAL([USE_NUM_OPENSSL], [test "x$set_bignum" = "xopenssl"])

AC_MSG_CHECKING([whether to build test_pivx])
if test x$use_tests = xyes; then
AC_MSG_RESULT([yes])
Expand Down Expand Up @@ -1494,8 +1452,6 @@ AC_SUBST(SODIUM_LIBS)
AC_SUBST(ZMQ_LIBS)
AC_SUBST(LIBZCASH_LIBS)
AC_SUBST(QR_LIBS)
AC_SUBST(USE_NUM_GMP)
AC_SUBST(USE_NUM_OPENSSL)
AC_SUBST(HAVE_FDATASYNC)
AC_SUBST(HAVE_FULLFSYNC)
AC_SUBST(HAVE_O_CLOEXEC)
Expand Down Expand Up @@ -1571,7 +1527,6 @@ if test x$bitcoin_enable_qt != xno; then
echo " with qtcharts = $use_qtcharts"
fi
echo " with zmq = $use_zmq"
echo " with bignum = $set_bignum"
echo " with test = $use_tests"
echo " with bench = $use_bench"
echo " with upnp = $use_upnp"
Expand Down
6 changes: 0 additions & 6 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,6 @@ libzerocoin_libbitcoin_zerocoin_a_SOURCES = \
libzerocoin/ParamGeneration.cpp \
libzerocoin/Params.cpp \
zpiv/zpivmodule.cpp
if USE_NUM_GMP
libzerocoin_libbitcoin_zerocoin_a_SOURCES += libzerocoin/bignum_gmp.cpp
endif
if USE_NUM_OPENSSL
libzerocoin_libbitcoin_zerocoin_a_SOURCES += libzerocoin/bignum_openssl.cpp
endif

# common: shared between pivxd, and pivx-qt and non-server tools
libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
Expand Down
Loading