Build util and common before building server #5112

pull jtimon wants to merge 1 commits into bitcoin:master from jtimon:make changing 1 files +6 −4
  1. jtimon commented at 6:42 AM on October 21, 2014: contributor

    If after compile one introduces errores in say, chainparams, make will compile main before founding the errors. This change doesn't guarantee that the dependencies will compiled in the correct order, but it's a short term solution for convenience.

  2. laanwj commented at 9:21 AM on October 21, 2014: member

    I prefer to not enforce any specific build order to leave space for maximum parallelism.

    But I see that this just switches around the order which is fine by me. I'd only suggest to add a comment why it is this way, to avoid people changing it again.

  3. theuni commented at 4:56 PM on October 21, 2014: member

    ACK in principle, but this needs to be reordered for the bin targets as well. This fixes the general "make" and "make check" cases, but not the specific cases like "make bitcoind". See below for (untested) changes needed in addition to yours.

    Also, this will work itself out soon anyway as we begin shifting libs around as a core lib starts to emerge, but I have no issue with rearranging before that. This way is arguably more correct anyway.

    diff --git a/src/Makefile.am b/src/Makefile.am
    index 155adfe..980361d 100644
    --- a/src/Makefile.am
    +++ b/src/Makefile.am
    @@ -259,8 +259,8 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
    
     # bitcoind binary #
     bitcoind_LDADD = \
    -  $(LIBBITCOIN_SERVER) \
       $(LIBBITCOIN_COMMON) \
    +  $(LIBBITCOIN_SERVER) \
       $(LIBBITCOIN_UNIVALUE) \
       $(LIBBITCOIN_UTIL) \
       $(LIBBITCOIN_CRYPTO) \
    diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
    index f8f4439..561e033 100644
    --- a/src/Makefile.qt.include
    +++ b/src/Makefile.qt.include
    @@ -358,11 +358,11 @@ endif
     if TARGET_WINDOWS
       qt_bitcoin_qt_SOURCES += $(BITCOIN_RC)
     endif
    -qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
    +qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER)
     if ENABLE_WALLET
     qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
     endif
    -qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
    +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
       $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
     if USE_LIBSECP256K1
       qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
    diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include
    index 23375be..b3ef9a8 100644
    --- a/src/Makefile.qttest.include
    +++ b/src/Makefile.qttest.include
    @@ -26,11 +26,11 @@ endif
    
     nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP)
    
    -qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER)
    +qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER)
     if ENABLE_WALLET
     qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
     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_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
       $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
       $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
     if USE_LIBSECP256K1
    diff --git a/src/Makefile.test.include b/src/Makefile.test.include
    cory@cory-i7:~/dev/bitcoin/src(reducedeps3)$ git --no-pager diff Makefile.am Makefile.test.include Makefile.qttest.include Makefile.qt.include
    diff --git a/src/Makefile.am b/src/Makefile.am
    index 155adfe..980361d 100644
    --- a/src/Makefile.am
    +++ b/src/Makefile.am
    @@ -259,8 +259,8 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
    
     # bitcoind binary #
     bitcoind_LDADD = \
    -  $(LIBBITCOIN_SERVER) \
       $(LIBBITCOIN_COMMON) \
    +  $(LIBBITCOIN_SERVER) \
       $(LIBBITCOIN_UNIVALUE) \
       $(LIBBITCOIN_UTIL) \
       $(LIBBITCOIN_CRYPTO) \
    diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
    index f8f4439..561e033 100644
    --- a/src/Makefile.qt.include
    +++ b/src/Makefile.qt.include
    @@ -358,11 +358,11 @@ endif
     if TARGET_WINDOWS
       qt_bitcoin_qt_SOURCES += $(BITCOIN_RC)
     endif
    -qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
    +qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER)
     if ENABLE_WALLET
     qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
     endif
    -qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
    +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
       $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
     if USE_LIBSECP256K1
       qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
    diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include
    index 23375be..b3ef9a8 100644
    --- a/src/Makefile.qttest.include
    +++ b/src/Makefile.qttest.include
    @@ -26,11 +26,11 @@ endif
    
     nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP)
    
    -qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER)
    +qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER)
     if ENABLE_WALLET
     qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
     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_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
       $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
       $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
     if USE_LIBSECP256K1
    diff --git a/src/Makefile.test.include b/src/Makefile.test.include
    index b20e226..deaf97b 100644
    --- a/src/Makefile.test.include
    +++ b/src/Makefile.test.include
    @@ -79,7 +79,7 @@ endif
    
     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_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
    +test_test_bitcoin_LDADD = $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
       $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
     if ENABLE_WALLET
     test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
    
  4. laanwj commented at 8:14 AM on October 22, 2014: member

    @theuni The order of libraries in the linking phase is important, if LIBBITCOIN_SERVER uses symbols from LIBBITCOIN_COMMON then they should be in that order. Right? I don't think reordering them in the binaries is as harmless as @jtimon's change.

  5. laanwj added the label Build system on Oct 22, 2014
  6. theuni commented at 3:44 AM on October 24, 2014: member

    @laanwj Yes, of course. Ignore that comment.

    Building for specific targets will still go in the old order, but @jtimon's change is still an improvement.

  7. jtimon force-pushed on Oct 27, 2014
  8. jtimon commented at 11:51 AM on October 27, 2014: contributor

    Rebased with comment and a few additional ordering changes.

  9. Build util and common before building server 071473c55c
  10. in src/Makefile.am:None in 8923c9f8b7 outdated
      46 |    libbitcoin_util.a \
      47 | +  libbitcoin_common.a \
      48 |    univalue/libbitcoin_univalue.a \
      49 | -  crypto/libbitcoin_crypto.a
      50 | +  libbitcoin_server.a \
      51 | +  libbitcoin_cli.a \
    


    sipa commented at 11:56 AM on October 27, 2014:

    remove the \ here and add one after crypto.


    jtimon commented at 12:18 PM on October 27, 2014:

    Opps

  11. jtimon force-pushed on Oct 27, 2014
  12. laanwj merged this on Oct 27, 2014
  13. laanwj closed this on Oct 27, 2014

  14. laanwj referenced this in commit f35d71ed22 on Oct 27, 2014
  15. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me