Skip to content

Commit

Permalink
Add correct moc sources
Browse files Browse the repository at this point in the history
Added sources to libbitcoin_util

Added libbitcoin to daemon, not building

bitcoind compiles with libbitcoin.
  • Loading branch information
TheCharlatan committed Nov 15, 2017
1 parent 6657363 commit 019ecc5
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 161 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ qrc_*.cpp
#mac specific
.DS_Store
build
doc/Doxyfile

!src/leveldb/Makefile

Expand Down
43 changes: 31 additions & 12 deletions share/qt/extract_strings_qt.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2012-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys

OUT_CPP="src/qt/bitcoinstrings.cpp"
OUT_CPP="qt/bitcoinstrings.cpp"
EMPTY=['""']

def parse_po(text):
Expand All @@ -28,7 +34,7 @@ def parse_po(text):
in_msgstr = False
# message start
in_msgid = True

msgid = [line[6:]]
elif line.startswith('msgstr '):
in_msgid = False
Expand All @@ -45,26 +51,39 @@ def parse_po(text):

return messages

files = glob.glob('src/*.cpp') + glob.glob('src/*.h')
files = sys.argv[1:]

# xgettext -n --keyword=_ $FILES
child = Popen(['xgettext','--output=-','-n','--keyword=_'] + files, stdout=PIPE)
XGETTEXT=os.getenv('XGETTEXT', 'xgettext')
if not XGETTEXT:
print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr)
print('Please install package "gettext" and re-run \'./configure\'.',file=sys.stderr)
exit(1)
child = Popen([XGETTEXT,'--output=-','-n','--keyword=_'] + files, stdout=PIPE)
(out, err) = child.communicate()

messages = parse_po(out)
messages = parse_po(out.decode('utf-8'))

f = open(OUT_CPP, 'w')
f.write("""#include <QtGlobal>
// Automatically generated by extract_strings.py
f.write("""
#include <QtGlobal>
// Automatically generated by extract_strings_qt.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif
""")
f.write('static const char UNUSED *bitcoin_strings[] = {')
f.write('static const char UNUSED *bitcoin_strings[] = {\n')
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),))
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),))
if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'):
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),))
messages.sort(key=operator.itemgetter(0))
for (msgid, msgstr) in messages:
if msgid != EMPTY:
f.write('QT_TRANSLATE_NOOP("bitcoin-core", %s),\n' % ('\n'.join(msgid)))
f.write('};')
f.write('};\n')
f.close()
183 changes: 96 additions & 87 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
#LIBBITCOIN_COMMON=libbitcoin_common.a
#LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a
#LIBBITCOIN_CLI=libbitcoin_cli.a
#LIBBITCOIN_UTIL=libbitcoin_util.a
LIBBITCOIN_UTIL=libbitcoin_util.a
#LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
#LIBBITCOINQT=qt/libbitcoinqt.a
LIBBITCOINQT=qt/libbitcoinqt.a
#LIBSECP256K1=secp256k1/libsecp256k1.la

#if ENABLE_ZMQ
Expand All @@ -48,16 +48,17 @@ $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)

# 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:
#EXTRA_LIBRARIES += \
# $(LIBBITCOIN_CRYPTO) \
# $(LIBBITCOIN_UTIL) \
EXTRA_LIBRARIES += $(LIBBITCOIN_UTIL)

# $(LIBBITCOIN_COMMON) \
# $(LIBBITCOIN_CONSENSUS) \
# $(LIBBITCOIN_SERVER) \
# $(LIBBITCOIN_CLI) \
# $(LIBBITCOIN_WALLET) \
#
# $(LIBBITCOIN_ZMQ)


#lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS)

bin_PROGRAMS =
Expand Down Expand Up @@ -142,47 +143,33 @@ obj/build.h: FORCE
#libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h

# server: shared between bitcoind and bitcoin-qt
#libbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
#libbitcoin_server_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
#libbitcoin_server_a_SOURCES = \
# addrdb.cpp \
# addrman.cpp \
# bloom.cpp \
# blockencodings.cpp \
# chain.cpp \
# checkpoints.cpp \
# consensus/tx_verify.cpp \
# httprpc.cpp \
# httpserver.cpp \
# init.cpp \
# dbwrapper.cpp \
# merkleblock.cpp \
#libbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS) libbitcoin_server_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_server_a_SOURCES = addrman.cpp \ alert.cpp \ beacon.cpp \ bitcoinrpc.cpp \ block.cpp \ boinc.cpp \ checkpoints.cpp \ cpid.cpp \ crypter.cpp \ db.cpp \ init.cpp \ irc.cpp \
# kernel.cpp \
# key.cpp \
# keystore.cpp \
# main.cpp \
# miner.cpp \
# netbase.cpp \
# net.cpp \
# net_processing.cpp \
# noui.cpp \
# policy/fees.cpp \
# policy/policy.cpp \
# policy/rbf.cpp \
# pow.cpp \
# rest.cpp \
# rpc/blockchain.cpp \
# rpc/mining.cpp \
# rpc/misc.cpp \
# rpc/net.cpp \
# rpc/rawtransaction.cpp \
# rpc/server.cpp \
# script/sigcache.cpp \
# script/ismine.cpp \
# timedata.cpp \
# torcontrol.cpp \
# txdb.cpp \
# txmempool.cpp \
# ui_interface.cpp \
# validation.cpp \
# validationinterface.cpp \
# versionbits.cpp \
# $(BITCOIN_CORE_H)
# pbkdf2.cpp \
# protocol.cpp \
# rpcblockchain.cpp \
# rpcdump.cpp \
# rpcmining.cpp \
# rpcnet.cpp \
# rpcrawtransaction.cpp \
# rpcwallet.cpp \
# script.cpp \
# scrypt.cpp \
# sync.cpp \
# txdb-leveldb.cpp \
# upgrader.cpp \
# util.cpp \
# version.cpp \
# wallet.cpp \
# walletdb.cpp \
# $(BITCOIN_CORE_H)

#if ENABLE_ZMQ
#libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS)
Expand Down Expand Up @@ -290,43 +277,9 @@ obj/build.h: FORCE
# util: shared between all executables.
# This library *must* be included to make sure that the glibc
# backward-compatibility objects and their sanity checks are linked.
#libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
#libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
#libbitcoin_util_a_SOURCES = \
# support/lockedpool.cpp \
# chainparamsbase.cpp \
# clientversion.cpp \
# compat/glibc_sanity.cpp \
# compat/glibcxx_sanity.cpp \
# compat/strnlen.cpp \
# fs.cpp \
# random.cpp \
# rpc/protocol.cpp \
# support/cleanse.cpp \
# sync.cpp \
# threadinterrupt.cpp \
# util.cpp \
# utilmoneystr.cpp \
# utilstrencodings.cpp \
# utiltime.cpp \
# $(BITCOIN_CORE_H)

#if GLIBC_BACK_COMPAT
#libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
#endif

# cli: shared between bitcoin-cli and bitcoin-qt
#libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
#libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
#libbitcoin_cli_a_SOURCES = \
# rpc/client.cpp \
# $(BITCOIN_CORE_H)

#nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
#

# bitcoind binary #
bitcoind_SOURCES = addrman.cpp \
libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libbitcoin_util_a_SOURCES = addrman.cpp \
alert.cpp \
beacon.cpp \
bitcoinrpc.cpp \
Expand Down Expand Up @@ -365,6 +318,61 @@ bitcoind_SOURCES = addrman.cpp \
walletdb.cpp \
$(BITCOIN_CORE_H)

#if GLIBC_BACK_COMPAT
#libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
#endif

# cli: shared between bitcoin-cli and bitcoin-qt
#libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
#libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
#libbitcoin_cli_a_SOURCES = \
# rpc/client.cpp \
# $(BITCOIN_CORE_H)

#nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
#

# bitcoind binary #
bitcoind_SOURCES =
#bitcoind_SOURCES = addrman.cpp \
# alert.cpp \
# beacon.cpp \
# bitcoinrpc.cpp \
# block.cpp \
# boinc.cpp \
# checkpoints.cpp \
# cpid.cpp \
# crypter.cpp \
# db.cpp \
# init.cpp \
# irc.cpp \
# kernel.cpp \
# key.cpp \
# keystore.cpp \
# main.cpp \
# miner.cpp \
# netbase.cpp \
# net.cpp \
# noui.cpp \
# pbkdf2.cpp \
# protocol.cpp \
# rpcblockchain.cpp \
# rpcdump.cpp \
# rpcmining.cpp \
# rpcnet.cpp \
# rpcrawtransaction.cpp \
# rpcwallet.cpp \
# script.cpp \
# scrypt.cpp \
# sync.cpp \
# txdb-leveldb.cpp \
# upgrader.cpp \
# util.cpp \
# version.cpp \
# wallet.cpp \
# walletdb.cpp \
# $(BITCOIN_CORE_H)

bitcoind_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
bitcoind_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
Expand All @@ -374,18 +382,19 @@ bitcoind_SOURCES += bitcoind-res.rc
endif

bitcoind_LDADD = \
$(LIBBITCOIN_UTIL) \
$(LIBLEVELDB) \
$(LIBLEVELDB_SSE42) \
$(LIBMEMENV)
# $(LIBBITCOIN_SERVER) \
# $(LIBBITCOIN_COMMON) \
# $(LIBUNIVALUE) \
# $(LIBBITCOIN_UTIL) \
# $(LIBBITCOIN_WALLET) \
# $(LIBBITCOIN_CONSENSUS) \
# $(LIBBITCOIN_CRYPTO) \
# $(LIBBITCOIN_WALLET)
# $(LIBBITCOIN_CONSENSUS)
# $(LIBBITCOIN_CRYPTO)
# $(LIBSECP256K1)
# $(LIBBITCOIN_ZMQ)
# $(LIBBITCOIN_SERVER)
# $(LIBBITCOIN_COMMON)
# $(LIBUNIVALUE)


bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(CURL_LIBS)
#bitcoind_LDADD += $(ZMQ_IBS)
Expand Down
Loading

0 comments on commit 019ecc5

Please sign in to comment.