diff --git a/configure.ac b/configure.ac index 94febc651..7babe6689 100644 --- a/configure.ac +++ b/configure.ac @@ -787,7 +787,6 @@ AX_BOOST_FILESYSTEM AX_BOOST_PROGRAM_OPTIONS AX_BOOST_THREAD AX_BOOST_CHRONO -AX_BOOST_DATE_TIME dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic dnl counter implementations. In 1.63 and later the std::atomic approach is default. @@ -854,7 +853,7 @@ fi if test x$use_boost = xyes; then -BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB $BOOST_DATE_TIME_LIB" +BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB" dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums diff --git a/depends/packages/libsodium.mk b/depends/packages/libsodium.mk new file mode 100644 index 000000000..92a490802 --- /dev/null +++ b/depends/packages/libsodium.mk @@ -0,0 +1,22 @@ +package=libsodium +$(package)_version=1.0.18 +$(package)_download_path=https://download.libsodium.org/libsodium/releases/ +$(package)_file_name=$(package)-$($(package)_version)-stable.tar.gz +$(package)_sha256_hash=cd191879fe6da6adf1f64801d68ced47b610e1558080a754779b32cf704ce9e3 + +define $(package)_set_vars +$(package)_config_opts_mingw32+=CFLAGS="-Ofast -fomit-frame-pointer -march=pentium3 -mtune=westmere" +endef + +define $(package)_config_cmds + ./configure --host=$(HOST) --prefix=$(host_prefix) --exec-prefix=$(host_prefix) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 088723ebd..d83fec838 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -1,4 +1,4 @@ -packages:=boost openssl libevent zeromq +packages:=boost openssl libevent zeromq libsodium native_packages := native_ccache qt_native_packages = native_protobuf diff --git a/doc/build-unix.md b/doc/build-unix.md index 25387675d..ef264629e 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -65,7 +65,7 @@ Dependency Build Instructions: Ubuntu & Debian ---------------------------------------------- Build requirements: - sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 + sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 cmake libsodium-dev Options when installing required Boost library files: diff --git a/doc/build-windows.md b/doc/build-windows.md index db9ba371d..8448cc8fd 100644 --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -58,7 +58,7 @@ installing the toolchain will be different. First, install the general dependencies: - sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git + sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git cmake libsodium-dev A host toolchain (`build-essential`) is necessary because some dependency packages (such as `protobuf`) need to build host utilities that are used in the diff --git a/src/Makefile.am b/src/Makefile.am index ac7063ff5..0654c019d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -521,7 +521,7 @@ if GLIBC_BACK_COMPAT endif libbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS) -libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1) $(CRYPTO_LIBS) +libbitcoinconsensus_la_LIBADD = $(BOOST_LIBS) $(LIBSECP256K1) $(CRYPTO_LIBS) $(LIBBITCOIN_CNUTILS) libbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include $(CN_UTILS_INCLUDE) -DBUILD_BITCOIN_INTERNAL $(SSL_CFLAGS) libbitcoinconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) diff --git a/src/cn_utils/crypto/tree-hash.c b/src/cn_utils/crypto/tree-hash.c index b2dc3ffb2..9737895a1 100644 --- a/src/cn_utils/crypto/tree-hash.c +++ b/src/cn_utils/crypto/tree-hash.c @@ -37,7 +37,7 @@ #ifdef _MSC_VER #include #elif !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) \ - && !defined(__NetBSD__) + && !defined(__NetBSD__) && !defined(__MINGW32__) #include #else #include