diff --git a/configure.ac b/configure.ac index c1032d167..63f9b75fe 100644 --- a/configure.ac +++ b/configure.ac @@ -1003,7 +1003,7 @@ unset PKG_CONFIG_LIBDIR PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP" ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no" -AC_CONFIG_SUBDIRS([src/secp256k1]) +AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 2c3274673..1cd85e2f1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -DIST_SUBDIRS = secp256k1 +DIST_SUBDIRS = secp256k1 univalue AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) @@ -21,6 +21,7 @@ BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include +BITCOIN_INCLUDES += -I$(srcdir)/univalue/include LIBBITCOIN_SERVER=libbitcoin_server.a LIBBITCOIN_WALLET=libbitcoin_wallet.a @@ -28,13 +29,16 @@ LIBBITCOIN_COMMON=libbitcoin_common.a LIBBITCOIN_CLI=libbitcoin_cli.a LIBBITCOIN_UTIL=libbitcoin_util.a LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a -LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a LIBBITCOINQT=qt/libbitcoinqt.a LIBSECP256K1=secp256k1/libsecp256k1.la +LIBUNIVALUE=univalue/lib/libunivalue.la LIBZCASH=libzcash.a $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) + +$(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*) + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) # Make is not made aware of per-object dependencies to avoid limiting building parallelization # But to build the less dependent modules first, we manually select their order here: @@ -42,7 +46,6 @@ EXTRA_LIBRARIES = \ crypto/libbitcoin_crypto.a \ libbitcoin_util.a \ libbitcoin_common.a \ - univalue/libbitcoin_univalue.a \ libbitcoin_server.a \ libbitcoin_cli.a \ libzcash.a @@ -287,14 +290,6 @@ crypto_libbitcoin_crypto_a_SOURCES += \ ${EQUIHASH_TROMP_SOURCES} endif -# univalue JSON library -univalue_libbitcoin_univalue_a_SOURCES = \ - univalue/univalue.cpp \ - univalue/univalue.h \ - univalue/univalue_escapes.h \ - univalue/univalue_read.cpp \ - univalue/univalue_write.cpp - # common: shared between bitcoind, and bitcoin-qt and non-server tools libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_SOURCES = \ @@ -374,7 +369,7 @@ endif zcashd_LDADD = \ $(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_UNIVALUE) \ + $(LIBUNIVALUE) \ $(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_CRYPTO) \ $(LIBZCASH) \ @@ -411,7 +406,7 @@ endif zcash_cli_LDADD = \ $(LIBBITCOIN_CLI) \ - $(LIBBITCOIN_UNIVALUE) \ + $(LIBUNIVALUE) \ $(LIBBITCOIN_UTIL) \ $(BOOST_LIBS) \ $(SSL_LIBS) \ @@ -432,7 +427,7 @@ endif # FIXME: Is libzcash needed for zcash_tx? zcash_tx_LDADD = \ - $(LIBBITCOIN_UNIVALUE) \ + $(LIBUNIVALUE) \ $(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_UTIL) \ $(LIBSECP256K1) \ diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 9513da080..5dde324aa 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -364,7 +364,7 @@ endif if ENABLE_ZMQ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif -qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) $(LIBZCASH_LIBS) qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) qt_bitcoin_qt_LIBTOOLFLAGS = --tag CXX diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 128c3f6d6..6a9d6b1a8 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -33,7 +33,7 @@ endif if ENABLE_ZMQ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) endif -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \ +qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) $(LIBZCASH_LIBS) qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 56be626d6..4defc09ed 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -98,7 +98,7 @@ endif test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) test_test_bitcoin_CPPFLAGS = -fopenmp $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) -test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ +test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \ $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) if ENABLE_WALLET test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) @@ -131,6 +131,7 @@ check-local: @echo "Running test/bitcoin-util-test.py..." $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check %.json.h: %.json @$(MKDIR_P) $(@D) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index d589a5a7c..6e54cd97a 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -12,7 +12,7 @@ #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index b36a01b73..0ba7e9a43 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -11,7 +11,7 @@ #include "primitives/transaction.h" #include "script/script.h" #include "script/sign.h" -#include "univalue/univalue.h" +#include #include "util.h" #include "utilmoneystr.h" #include "utilstrencodings.h" diff --git a/src/core_read.cpp b/src/core_read.cpp index e064955ff..1b3e9025d 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -9,7 +9,7 @@ #include "script/script.h" #include "serialize.h" #include "streams.h" -#include "univalue/univalue.h" +#include #include "util.h" #include "utilstrencodings.h" #include "version.h" diff --git a/src/core_write.cpp b/src/core_write.cpp index c3babec2f..26eeba655 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -10,7 +10,7 @@ #include "script/standard.h" #include "serialize.h" #include "streams.h" -#include "univalue/univalue.h" +#include #include "util.h" #include "utilmoneystr.h" #include "utilstrencodings.h" diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index feb282644..ca3af2574 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -18,7 +18,7 @@ #include -#include "univalue/univalue.h" +#include #ifdef ENABLE_WALLET #include diff --git a/src/rest.cpp b/src/rest.cpp index 1fce7dfc9..82155bab1 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -16,7 +16,7 @@ #include #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index fef578cc5..365ae3584 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -13,7 +13,7 @@ #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index f0c6611ae..fe442b81c 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -11,7 +11,7 @@ #include #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/rpcclient.h b/src/rpcclient.h index d68b4ed6a..8937a56f0 100644 --- a/src/rpcclient.h +++ b/src/rpcclient.h @@ -6,7 +6,7 @@ #ifndef BITCOIN_RPCCLIENT_H #define BITCOIN_RPCCLIENT_H -#include "univalue/univalue.h" +#include UniValue RPCConvertValues(const std::string& strMethod, const std::vector& strParams); /** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 8f63b752c..dd622444e 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -28,7 +28,7 @@ #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index ef480034c..38610903b 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -20,7 +20,8 @@ #include #include -#include "univalue/univalue.h" + +#include #include "zcash/Address.hpp" diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index e8eca24f8..522edc741 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -16,7 +16,7 @@ #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index b6e618155..852a3aef1 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -16,7 +16,7 @@ #include #include -#include "univalue/univalue.h" +#include //! HTTP status codes enum HTTPStatusCode diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index a23c1d8ee..5ff035164 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -26,7 +26,7 @@ #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 6fe41193e..89250b54a 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -31,7 +31,7 @@ #include #include -#include "univalue/univalue.h" +#include using namespace boost::asio; using namespace RPCServer; diff --git a/src/rpcserver.h b/src/rpcserver.h index 607cff1c2..6ee17da68 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -18,7 +18,7 @@ #include -#include "univalue/univalue.h" +#include class AsyncRPCQueue; class CRPCCommand; diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index bd754cafe..361d8b8ea 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -18,7 +18,7 @@ #include #include -#include "univalue/univalue.h" +#include extern UniValue read_json(const std::string& jsondata); diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index 9037d3f16..1dfb3e221 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -13,7 +13,7 @@ #include #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index f3d1ce0ed..1dd74eb0e 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -31,7 +31,7 @@ #include #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index dfb4c2f65..a1e3dbdc2 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -27,7 +27,7 @@ #include #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index ce554ee3e..989ed7428 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -18,7 +18,7 @@ #include -#include "univalue/univalue.h" +#include extern UniValue read_json(const std::string& jsondata); diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index d2e9a3388..065883612 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -27,7 +27,7 @@ #include #include -#include "univalue/univalue.h" +#include #include "zcash/Note.hpp" #include "zcash/Address.hpp" diff --git a/src/test/univalue_tests.cpp b/src/test/univalue_tests.cpp index de84faca2..6eb8d1ab4 100644 --- a/src/test/univalue_tests.cpp +++ b/src/test/univalue_tests.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "univalue/univalue.h" +#include #include "test/test_bitcoin.h" #include diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 7f9c89da2..7ae68b994 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -19,7 +19,7 @@ #include #include -#include "univalue/univalue.h" +#include using namespace std; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 5e1efe2db..562b60b66 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -31,7 +31,7 @@ #include -#include "univalue/univalue.h" +#include #include