[Univalue] add univalue over subtree

similar to secp256k1 include and compile univalue over a subtree
This commit is contained in:
Jonas Schnelli 2015-09-04 16:11:34 +02:00 committed by Jonas Schnelli
parent 6e16a41313
commit 9623e93473
30 changed files with 39 additions and 43 deletions

View File

@ -940,7 +940,7 @@ unset PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP" PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no" 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 AC_OUTPUT

View File

@ -1,4 +1,4 @@
DIST_SUBDIRS = secp256k1 DIST_SUBDIRS = secp256k1 univalue
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) 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$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
BITCOIN_INCLUDES += -I$(srcdir)/univalue/include
LIBBITCOIN_SERVER=libbitcoin_server.a LIBBITCOIN_SERVER=libbitcoin_server.a
LIBBITCOIN_WALLET=libbitcoin_wallet.a LIBBITCOIN_WALLET=libbitcoin_wallet.a
@ -28,12 +29,15 @@ LIBBITCOIN_COMMON=libbitcoin_common.a
LIBBITCOIN_CLI=libbitcoin_cli.a LIBBITCOIN_CLI=libbitcoin_cli.a
LIBBITCOIN_UTIL=libbitcoin_util.a LIBBITCOIN_UTIL=libbitcoin_util.a
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
LIBBITCOINQT=qt/libbitcoinqt.a LIBBITCOINQT=qt/libbitcoinqt.a
LIBSECP256K1=secp256k1/libsecp256k1.la LIBSECP256K1=secp256k1/libsecp256k1.la
LIBUNIVALUE=univalue/lib/libunivalue.la
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) $(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 # 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: # But to build the less dependent modules first, we manually select their order here:
@ -41,7 +45,6 @@ EXTRA_LIBRARIES = \
crypto/libbitcoin_crypto.a \ crypto/libbitcoin_crypto.a \
libbitcoin_util.a \ libbitcoin_util.a \
libbitcoin_common.a \ libbitcoin_common.a \
univalue/libbitcoin_univalue.a \
libbitcoin_server.a \ libbitcoin_server.a \
libbitcoin_cli.a libbitcoin_cli.a
if ENABLE_WALLET if ENABLE_WALLET
@ -248,14 +251,6 @@ crypto_libbitcoin_crypto_a_SOURCES = \
crypto/sha512.cpp \ crypto/sha512.cpp \
crypto/sha512.h crypto/sha512.h
# 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 # common: shared between bitcoind, and bitcoin-qt and non-server tools
libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
libbitcoin_common_a_SOURCES = \ libbitcoin_common_a_SOURCES = \
@ -332,7 +327,7 @@ endif
bitcoind_LDADD = \ bitcoind_LDADD = \
$(LIBBITCOIN_SERVER) \ $(LIBBITCOIN_SERVER) \
$(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UNIVALUE) \ $(LIBUNIVALUE) \
$(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CRYPTO) \ $(LIBBITCOIN_CRYPTO) \
$(LIBLEVELDB) \ $(LIBLEVELDB) \
@ -360,7 +355,7 @@ endif
bitcoin_cli_LDADD = \ bitcoin_cli_LDADD = \
$(LIBBITCOIN_CLI) \ $(LIBBITCOIN_CLI) \
$(LIBBITCOIN_UNIVALUE) \ $(LIBUNIVALUE) \
$(LIBBITCOIN_UTIL) $(LIBBITCOIN_UTIL)
bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS) bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS)
@ -376,7 +371,7 @@ bitcoin_tx_SOURCES += bitcoin-tx-res.rc
endif endif
bitcoin_tx_LDADD = \ bitcoin_tx_LDADD = \
$(LIBBITCOIN_UNIVALUE) \ $(LIBUNIVALUE) \
$(LIBBITCOIN_COMMON) \ $(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UTIL) \ $(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CRYPTO) \ $(LIBBITCOIN_CRYPTO) \

View File

@ -367,7 +367,7 @@ endif
if ENABLE_ZMQ if ENABLE_ZMQ
qt_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) qt_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif 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) \ $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)
qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) qt_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)

View File

@ -33,7 +33,7 @@ endif
if ENABLE_ZMQ if ENABLE_ZMQ
qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif 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) \ $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
$(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \ $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \
$(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)

View File

@ -91,7 +91,7 @@ endif
test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) test_test_bitcoin_CPPFLAGS = $(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) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1)
if ENABLE_WALLET if ENABLE_WALLET
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
@ -124,6 +124,7 @@ check-local:
@echo "Running test/bitcoin-util-test.py..." @echo "Running test/bitcoin-util-test.py..."
$(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/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 secp256k1 check
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
%.json.h: %.json %.json.h: %.json
@$(MKDIR_P) $(@D) @$(MKDIR_P) $(@D)

View File

@ -18,7 +18,7 @@
#include <event2/buffer.h> #include <event2/buffer.h>
#include <event2/keyvalq_struct.h> #include <event2/keyvalq_struct.h>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -12,7 +12,7 @@
#include "primitives/transaction.h" #include "primitives/transaction.h"
#include "script/script.h" #include "script/script.h"
#include "script/sign.h" #include "script/sign.h"
#include "univalue/univalue.h" #include <univalue.h>
#include "util.h" #include "util.h"
#include "utilmoneystr.h" #include "utilmoneystr.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"

View File

@ -9,7 +9,7 @@
#include "script/script.h" #include "script/script.h"
#include "serialize.h" #include "serialize.h"
#include "streams.h" #include "streams.h"
#include "univalue/univalue.h" #include <univalue.h>
#include "util.h" #include "util.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"
#include "version.h" #include "version.h"

View File

@ -10,7 +10,7 @@
#include "script/standard.h" #include "script/standard.h"
#include "serialize.h" #include "serialize.h"
#include "streams.h" #include "streams.h"
#include "univalue/univalue.h" #include <univalue.h>
#include "util.h" #include "util.h"
#include "utilmoneystr.h" #include "utilmoneystr.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"

View File

@ -18,7 +18,7 @@
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include "univalue/univalue.h" #include <univalue.h>
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
#include <db_cxx.h> #include <db_cxx.h>

View File

@ -18,7 +18,7 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/dynamic_bitset.hpp> #include <boost/dynamic_bitset.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -20,7 +20,7 @@
#include <stdint.h> #include <stdint.h>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -12,7 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include <boost/algorithm/string/case_conv.hpp> // for to_lower() #include <boost/algorithm/string/case_conv.hpp> // for to_lower()
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -6,7 +6,7 @@
#ifndef BITCOIN_RPCCLIENT_H #ifndef BITCOIN_RPCCLIENT_H
#define BITCOIN_RPCCLIENT_H #define BITCOIN_RPCCLIENT_H
#include "univalue/univalue.h" #include <univalue.h>
UniValue RPCConvertValues(const std::string& strMethod, const std::vector<std::string>& strParams); UniValue RPCConvertValues(const std::string& strMethod, const std::vector<std::string>& strParams);
/** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null) /** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null)

View File

@ -25,7 +25,7 @@
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -22,7 +22,7 @@
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -19,7 +19,7 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -12,7 +12,7 @@
#include <string> #include <string>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include "univalue/univalue.h" #include <univalue.h>
//! HTTP status codes //! HTTP status codes
enum HTTPStatusCode enum HTTPStatusCode

View File

@ -31,7 +31,7 @@
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -13,7 +13,7 @@
#include "util.h" #include "util.h"
#include "utilstrencodings.h" #include "utilstrencodings.h"
#include "univalue/univalue.h" #include <univalue.h>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>

View File

@ -17,7 +17,7 @@
#include <boost/function.hpp> #include <boost/function.hpp>
#include "univalue/univalue.h" #include <univalue.h>
class CRPCCommand; class CRPCCommand;

View File

@ -18,7 +18,7 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "univalue/univalue.h" #include <univalue.h>
extern UniValue read_json(const std::string& jsondata); extern UniValue read_json(const std::string& jsondata);

View File

@ -13,7 +13,7 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -14,7 +14,7 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -27,7 +27,7 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -20,7 +20,7 @@
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "univalue/univalue.h" #include <univalue.h>
extern UniValue read_json(const std::string& jsondata); extern UniValue read_json(const std::string& jsondata);

View File

@ -26,7 +26,7 @@
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;

View File

@ -6,7 +6,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include <map> #include <map>
#include "univalue/univalue.h" #include <univalue.h>
#include "test/test_bitcoin.h" #include "test/test_bitcoin.h"
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>

View File

@ -20,7 +20,7 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/posix_time/posix_time.hpp>
#include "univalue/univalue.h" #include <univalue.h>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>

View File

@ -22,7 +22,7 @@
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
#include "univalue/univalue.h" #include <univalue.h>
using namespace std; using namespace std;