Skip to content

Commit 019ecc5

Browse files
committed
Add correct moc sources
Added sources to libbitcoin_util Added libbitcoin to daemon, not building bitcoind compiles with libbitcoin.
1 parent 6657363 commit 019ecc5

File tree

5 files changed

+193
-161
lines changed

5 files changed

+193
-161
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ qrc_*.cpp
4040
#mac specific
4141
.DS_Store
4242
build
43+
doc/Doxyfile
4344

4445
!src/leveldb/Makefile
4546

share/qt/extract_strings_qt.py

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
2+
# Copyright (c) 2012-2016 The Bitcoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
25
'''
3-
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
6+
Extract _("...") strings for translation and convert to Qt stringdefs so that
47
they can be picked up by Qt linguist.
58
'''
9+
from __future__ import division,print_function,unicode_literals
610
from subprocess import Popen, PIPE
7-
import glob
11+
import operator
12+
import os
13+
import sys
814

9-
OUT_CPP="src/qt/bitcoinstrings.cpp"
15+
OUT_CPP="qt/bitcoinstrings.cpp"
1016
EMPTY=['""']
1117

1218
def parse_po(text):
@@ -28,7 +34,7 @@ def parse_po(text):
2834
in_msgstr = False
2935
# message start
3036
in_msgid = True
31-
37+
3238
msgid = [line[6:]]
3339
elif line.startswith('msgstr '):
3440
in_msgid = False
@@ -45,26 +51,39 @@ def parse_po(text):
4551

4652
return messages
4753

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

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

54-
messages = parse_po(out)
65+
messages = parse_po(out.decode('utf-8'))
5566

5667
f = open(OUT_CPP, 'w')
57-
f.write("""#include <QtGlobal>
58-
// Automatically generated by extract_strings.py
68+
f.write("""
69+
70+
#include <QtGlobal>
71+
72+
// Automatically generated by extract_strings_qt.py
5973
#ifdef __GNUC__
6074
#define UNUSED __attribute__((unused))
6175
#else
6276
#define UNUSED
6377
#endif
6478
""")
65-
f.write('static const char UNUSED *bitcoin_strings[] = {')
79+
f.write('static const char UNUSED *bitcoin_strings[] = {\n')
80+
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),))
81+
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),))
82+
if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'):
83+
f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),))
84+
messages.sort(key=operator.itemgetter(0))
6685
for (msgid, msgstr) in messages:
6786
if msgid != EMPTY:
6887
f.write('QT_TRANSLATE_NOOP("bitcoin-core", %s),\n' % ('\n'.join(msgid)))
69-
f.write('};')
88+
f.write('};\n')
7089
f.close()

src/Makefile.am

Lines changed: 96 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
2828
#LIBBITCOIN_COMMON=libbitcoin_common.a
2929
#LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a
3030
#LIBBITCOIN_CLI=libbitcoin_cli.a
31-
#LIBBITCOIN_UTIL=libbitcoin_util.a
31+
LIBBITCOIN_UTIL=libbitcoin_util.a
3232
#LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
33-
#LIBBITCOINQT=qt/libbitcoinqt.a
33+
LIBBITCOINQT=qt/libbitcoinqt.a
3434
#LIBSECP256K1=secp256k1/libsecp256k1.la
3535

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

4949
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
5050
# But to build the less dependent modules first, we manually select their order here:
51-
#EXTRA_LIBRARIES += \
52-
# $(LIBBITCOIN_CRYPTO) \
53-
# $(LIBBITCOIN_UTIL) \
51+
EXTRA_LIBRARIES += $(LIBBITCOIN_UTIL)
52+
5453
# $(LIBBITCOIN_COMMON) \
5554
# $(LIBBITCOIN_CONSENSUS) \
5655
# $(LIBBITCOIN_SERVER) \
5756
# $(LIBBITCOIN_CLI) \
5857
# $(LIBBITCOIN_WALLET) \
58+
#
5959
# $(LIBBITCOIN_ZMQ)
6060

61+
6162
#lib_LTLIBRARIES = $(LIBBITCOINCONSENSUS)
6263

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

144145
# server: shared between bitcoind and bitcoin-qt
145-
#libbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
146-
#libbitcoin_server_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
147-
#libbitcoin_server_a_SOURCES = \
148-
# addrdb.cpp \
149-
# addrman.cpp \
150-
# bloom.cpp \
151-
# blockencodings.cpp \
152-
# chain.cpp \
153-
# checkpoints.cpp \
154-
# consensus/tx_verify.cpp \
155-
# httprpc.cpp \
156-
# httpserver.cpp \
157-
# init.cpp \
158-
# dbwrapper.cpp \
159-
# merkleblock.cpp \
146+
#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 \
147+
# kernel.cpp \
148+
# key.cpp \
149+
# keystore.cpp \
150+
# main.cpp \
160151
# miner.cpp \
152+
# netbase.cpp \
161153
# net.cpp \
162-
# net_processing.cpp \
163154
# noui.cpp \
164-
# policy/fees.cpp \
165-
# policy/policy.cpp \
166-
# policy/rbf.cpp \
167-
# pow.cpp \
168-
# rest.cpp \
169-
# rpc/blockchain.cpp \
170-
# rpc/mining.cpp \
171-
# rpc/misc.cpp \
172-
# rpc/net.cpp \
173-
# rpc/rawtransaction.cpp \
174-
# rpc/server.cpp \
175-
# script/sigcache.cpp \
176-
# script/ismine.cpp \
177-
# timedata.cpp \
178-
# torcontrol.cpp \
179-
# txdb.cpp \
180-
# txmempool.cpp \
181-
# ui_interface.cpp \
182-
# validation.cpp \
183-
# validationinterface.cpp \
184-
# versionbits.cpp \
185-
# $(BITCOIN_CORE_H)
155+
# pbkdf2.cpp \
156+
# protocol.cpp \
157+
# rpcblockchain.cpp \
158+
# rpcdump.cpp \
159+
# rpcmining.cpp \
160+
# rpcnet.cpp \
161+
# rpcrawtransaction.cpp \
162+
# rpcwallet.cpp \
163+
# script.cpp \
164+
# scrypt.cpp \
165+
# sync.cpp \
166+
# txdb-leveldb.cpp \
167+
# upgrader.cpp \
168+
# util.cpp \
169+
# version.cpp \
170+
# wallet.cpp \
171+
# walletdb.cpp \
172+
# $(BITCOIN_CORE_H)
186173

187174
#if ENABLE_ZMQ
188175
#libbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS)
@@ -290,43 +277,9 @@ obj/build.h: FORCE
290277
# util: shared between all executables.
291278
# This library *must* be included to make sure that the glibc
292279
# backward-compatibility objects and their sanity checks are linked.
293-
#libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
294-
#libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
295-
#libbitcoin_util_a_SOURCES = \
296-
# support/lockedpool.cpp \
297-
# chainparamsbase.cpp \
298-
# clientversion.cpp \
299-
# compat/glibc_sanity.cpp \
300-
# compat/glibcxx_sanity.cpp \
301-
# compat/strnlen.cpp \
302-
# fs.cpp \
303-
# random.cpp \
304-
# rpc/protocol.cpp \
305-
# support/cleanse.cpp \
306-
# sync.cpp \
307-
# threadinterrupt.cpp \
308-
# util.cpp \
309-
# utilmoneystr.cpp \
310-
# utilstrencodings.cpp \
311-
# utiltime.cpp \
312-
# $(BITCOIN_CORE_H)
313-
314-
#if GLIBC_BACK_COMPAT
315-
#libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
316-
#endif
317-
318-
# cli: shared between bitcoin-cli and bitcoin-qt
319-
#libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
320-
#libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
321-
#libbitcoin_cli_a_SOURCES = \
322-
# rpc/client.cpp \
323-
# $(BITCOIN_CORE_H)
324-
325-
#nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
326-
#
327-
328-
# bitcoind binary #
329-
bitcoind_SOURCES = addrman.cpp \
280+
libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
281+
libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
282+
libbitcoin_util_a_SOURCES = addrman.cpp \
330283
alert.cpp \
331284
beacon.cpp \
332285
bitcoinrpc.cpp \
@@ -365,6 +318,61 @@ bitcoind_SOURCES = addrman.cpp \
365318
walletdb.cpp \
366319
$(BITCOIN_CORE_H)
367320

321+
#if GLIBC_BACK_COMPAT
322+
#libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
323+
#endif
324+
325+
# cli: shared between bitcoin-cli and bitcoin-qt
326+
#libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
327+
#libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
328+
#libbitcoin_cli_a_SOURCES = \
329+
# rpc/client.cpp \
330+
# $(BITCOIN_CORE_H)
331+
332+
#nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
333+
#
334+
335+
# bitcoind binary #
336+
bitcoind_SOURCES =
337+
#bitcoind_SOURCES = addrman.cpp \
338+
# alert.cpp \
339+
# beacon.cpp \
340+
# bitcoinrpc.cpp \
341+
# block.cpp \
342+
# boinc.cpp \
343+
# checkpoints.cpp \
344+
# cpid.cpp \
345+
# crypter.cpp \
346+
# db.cpp \
347+
# init.cpp \
348+
# irc.cpp \
349+
# kernel.cpp \
350+
# key.cpp \
351+
# keystore.cpp \
352+
# main.cpp \
353+
# miner.cpp \
354+
# netbase.cpp \
355+
# net.cpp \
356+
# noui.cpp \
357+
# pbkdf2.cpp \
358+
# protocol.cpp \
359+
# rpcblockchain.cpp \
360+
# rpcdump.cpp \
361+
# rpcmining.cpp \
362+
# rpcnet.cpp \
363+
# rpcrawtransaction.cpp \
364+
# rpcwallet.cpp \
365+
# script.cpp \
366+
# scrypt.cpp \
367+
# sync.cpp \
368+
# txdb-leveldb.cpp \
369+
# upgrader.cpp \
370+
# util.cpp \
371+
# version.cpp \
372+
# wallet.cpp \
373+
# walletdb.cpp \
374+
# $(BITCOIN_CORE_H)
375+
368376
bitcoind_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
369377
bitcoind_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
370378
bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
@@ -374,18 +382,19 @@ bitcoind_SOURCES += bitcoind-res.rc
374382
endif
375383

376384
bitcoind_LDADD = \
385+
$(LIBBITCOIN_UTIL) \
377386
$(LIBLEVELDB) \
378387
$(LIBLEVELDB_SSE42) \
379388
$(LIBMEMENV)
380-
# $(LIBBITCOIN_SERVER) \
381-
# $(LIBBITCOIN_COMMON) \
382-
# $(LIBUNIVALUE) \
383-
# $(LIBBITCOIN_UTIL) \
384-
# $(LIBBITCOIN_WALLET) \
385-
# $(LIBBITCOIN_CONSENSUS) \
386-
# $(LIBBITCOIN_CRYPTO) \
389+
# $(LIBBITCOIN_WALLET)
390+
# $(LIBBITCOIN_CONSENSUS)
391+
# $(LIBBITCOIN_CRYPTO)
387392
# $(LIBSECP256K1)
388393
# $(LIBBITCOIN_ZMQ)
394+
# $(LIBBITCOIN_SERVER)
395+
# $(LIBBITCOIN_COMMON)
396+
# $(LIBUNIVALUE)
397+
389398

390399
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(CURL_LIBS)
391400
#bitcoind_LDADD += $(ZMQ_IBS)

0 commit comments

Comments
 (0)