Commit Graph

129 Commits

Author SHA1 Message Date
Hennadii Stepanov
c236f2e228
build: Drop redundant AC_SUBST macros
Variables that are declared with AC_ARG_VAR macro are substituted via
AC_SUBST macro.
PKG_CHECK_MODULES macro already has AC_ARG_VAR(${PACKAGE}_CFLAGS) and
AC_ARG_VAR(${PACKAGE}_LIBS).
2021-12-29 23:14:45 +02:00
Hennadii Stepanov
e5a81e65d7
build, refactor: Re-use qt_lib_suffix variable 2021-12-12 18:08:43 +02:00
fanquake
099325a759
Merge bitcoin/bitcoin#23616: build: Bump AX_PTHREAD macro to the latest version
d796091b04 build: Bump AX_PTHREAD macro to the latest version (Hennadii Stepanov)

Pull request description:

  This PR silents autoconf >2.69 (this [one](https://formulae.brew.sh/formula/autoconf), for instance) warnings about the obsolete `$as_echo`:

  ```
  % ./autogen.sh
  ...
  configure.ac:847: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
  lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
  lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
  ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
  ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
  build-aux/m4/ax_pthread.m4:89: AX_PTHREAD is expanded from...
  configure.ac:847: the top level
  ...
  ```

  No other behavior changes.

ACKs for top commit:
  fanquake:
    ACK d796091b04 - matches upstream at serial 31.

Tree-SHA512: aa9b60698f453427221444a5a63420d833c4c5dd23f8b0c74e5bd4639daec9c6cff0907a5281c00103ccb030e394998cf05653be750d4a3bf0f37ca41ff6fbe1
2021-12-08 13:38:29 +08:00
Hennadii Stepanov
d796091b04
build: Bump AX_PTHREAD macro to the latest version
This change silents autoconf >2.69 warnings about the obsolete $as_echo.
2021-12-07 12:55:39 +02:00
fanquake
d6d402bd2b
build: remove x-prefix comparisons
Very old shells suffered from bugs which meant that prefixing variables
with an "x" to ensure that the lefthand side of a comparison always
started with an alphanumeric character was needed. Modern shells don't
suffer from this issue (i.e Bash was fixed in 1996).

In any case, we've already got unprefixed checks used in our codebase,
i.e https://github.com/bitcoin/bitcoin/blob/master/configure.ac#L292,
and have dependencies (in depends) that also use unprefixed comparisons.

I think it's time that we can consolidate on not using the x-prefix
workaround. At best it's mostly just confusing.

More info:
https://github.com/koalaman/shellcheck/wiki/SC2268
https://www.vidarholen.net/contents/blog/?p=1035
2021-12-03 21:03:35 +08:00
fanquake
c870027cc2
build: qt 5.15.2 2021-12-03 14:07:12 +08:00
fanquake
efd4fe156a
build: consistently quote AC_MSG_* arguments 2021-11-12 14:31:59 +08:00
fanquake
80762dfc45
build: consistently quote arguments in AC_ARG_VAR() 2021-11-12 14:31:59 +08:00
fanquake
cdb47e18b7
build: consistently quote AC_DEFINE() arguments 2021-11-12 14:31:55 +08:00
fanquake
a17a3f9d62
build: consistently quote AC_MSG_CHECKING() arguments 2021-11-12 10:05:36 +08:00
fanquake
05923e7c62
build: AC_PATH_PROG(S) consistently quote arguments 2021-11-12 10:02:00 +08:00
fanquake
b4dba0c6c7
build: AX_CHECK_PREPROC_FLAG() serial 6 2021-11-12 10:01:59 +08:00
fanquake
b3dd6c1d0f
build: AX_CHECK_COMPILE_FLAG() serial 6 2021-11-12 10:01:59 +08:00
fanquake
5e6bc437c5
build: cleanup AX_CHECK_LINK_FLAG() usage
There should be no functional change.
2021-11-12 10:01:59 +08:00
fanquake
a874637bf9
build: AX_CHECK_LINK_FLAG serial 6 2021-11-12 10:01:59 +08:00
fanquake
747cd17404
build: no-longer fail default configure if BDB isn't available
Inline with moving to descriptor (sqlite) wallets by default for 0.23,
this adapts the build system so that a default `./configure` invocation
no-longer fails if BDB isn't present. Currently, if configure is run
with no options, and no BDB is present, we'll fail with:
```bash
checking for Berkeley DB C++ headers... no
configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for BDB wallet support (--without-bdb to disable BDB wallet support)
```

If descriptor wallets are to be the default, this behaviour no longer
makes sense, as a builder should be able to configure and build, to use
a wallet, without BDB installed, and without passing additional
arguments, i.e `--without-bdb` or `--with-incompatible-bdb`, to
configure.

With this change, running configure will no-longer fail, and will
instead print:
```bash
checking for Berkeley DB C++ headers... no
configure: WARNING: libdb_cxx headers missing
configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support
configure: WARNING: Passing --without-bdb will suppress this warning
checking for sqlite3 >= 3.7.17... yes
checking whether to build wallet with support for sqlite... yes
```
2021-10-05 11:38:28 +08:00
Hennadii Stepanov
e251726aff
build, qt: Fix typo in QtInputSupport check 2021-08-27 17:50:30 +03:00
fanquake
d23570098c
Merge bitcoin/bitcoin#21882: build: Fix undefined reference to __mulodi4
e4c8bb62e4 build: Fix undefined reference to __mulodi4 (Hennadii Stepanov)

Pull request description:

  When compiling with clang on 32-bit systems the `__mulodi4` symbol is defined in compiler-rt only.

  Fixes #21294.

  See more:
  - https://bugs.llvm.org/show_bug.cgi?id=16404
  - https://bugs.llvm.org/show_bug.cgi?id=28629

ACKs for top commit:
  MarcoFalke:
    tested-only ACK e4c8bb62e4
  luke-jr:
    utACK e4c8bb62e4
  fanquake:
    ACK e4c8bb62e4 - it's a bit of an awkward workaround to carry, but at-least it's contained to the fuzzers.

Tree-SHA512: 93edb4ed568027702b1b9aba953ad50889b834ef97fde3cb99d1ce70076d9c00aa13f95c86b12d6f59b24fa90108d93742f920e15119901a2848fb337ab859a1
2021-07-29 20:53:36 +08:00
Hennadii Stepanov
e4c8bb62e4
build: Fix undefined reference to __mulodi4
When compiling with clang on 32-bit systems the __mulodi4 symbol is
defined in compiler-rt only.
2021-07-27 14:53:24 +03:00
Hennadii Stepanov
a8bd5ea017
build, qt: Fix libraries linking order for Linux hosts
This change fixes configuring with Qt on Alpine Linux.
2021-06-06 23:25:07 +03:00
fanquake
6fe012c6bd
Merge bitcoin/bitcoin#22133: build, qt: Make QWindowsVistaStylePlugin available again (regression)
ab86ac7739 build, qt: Make QWindowsVistaStylePlugin available again (regression) (Hennadii Stepanov)

Pull request description:

  This PR is similar to 1be8e0f238, and, actually, it is a #21376 follow up.

  Required as in Qt 5.12.x style plugins are separated.

  Fixes #22132.
  Fixes https://github.com/bitcoin-core/gui/issues/303.

  **Note for reviewers**. Besides visual changes in the GUI, you could compare the first dozen of lines in the `debug.log` file.

  ---

  #### Guix build:
  ```
  $ HOSTS=x86_64-w64-mingw32 contrib/guix/guix-build
  $ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  guix-build-ab86ac7739b2/output/dist-archive/SKIPATTEST.TAG
  d3f05888c95d6cf6f4a0bac952d4c0bf1e271f49cb7ab92b08080b753957e5e5  guix-build-ab86ac7739b2/output/dist-archive/bitcoin-ab86ac7739b2.tar.gz
  113bb86ffd2854e08d3c0c5cd3f9728f2e4fe6c7a1813bc1c4b73eb48ad6597f  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/bitcoin-ab86ac7739b2-win-unsigned.tar.gz
  3fdc99754d6f26d9655a308c8847076d8fd4db8d61f4f18d8ef545894a42c10d  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/bitcoin-ab86ac7739b2-win64-debug.zip
  932bb69e3eb1a617f9e337b83220c9d6a277bec421f4d78e32dffde5643eb00c  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/bitcoin-ab86ac7739b2-win64-setup-unsigned.exe
  852f4c03ad049fcd6bb2ce25b3bcf4e18b90d34f7232660024b341bd7c8dd710  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/bitcoin-ab86ac7739b2-win64.zip
  c6a33a193a6b128e665198dde94758acab3a5ab7fefe0c3c6617eb98ad01693d  guix-build-ab86ac7739b2/output/x86_64-w64-mingw32/inputs.SHA256SUMS
  ```

ACKs for top commit:
  laanwj:
    Concept and code review ACK ab86ac7739
  fanquake:
    ACK ab86ac7739

Tree-SHA512: 9f5498480379fad41de616da48331e123daf5b2294ca79c33ffea2b113b314634be9a2a70bf060cb5be1392a48e9d047891e1d22c129f408f1d76a0bc888441f
2021-06-03 20:40:13 +08:00
Hennadii Stepanov
ab86ac7739
build, qt: Make QWindowsVistaStylePlugin available again (regression)
In Qt 5.12.x style plugins are separated.

Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
2021-06-03 00:25:01 +03:00
W. J. van der Laan
2aab8a6dd0
Merge bitcoin/bitcoin#21231: Add /opt/homebrew to path to look for boost libraries
9a0969585f build: Add /opt/homebrew to path to look for boost libraries (Fu Yong Quah)

Pull request description:

  Following the instruction in https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md for building on the M1 Macs don't work out of the box, because homebrew now defaults to /opt/homebrew instead of /usr/local. This PR fixes that.

ACKs for top commit:
  jonasschnelli:
    utACK 9a0969585f
  promag:
    Tested ACK 9a0969585f.

Tree-SHA512: 472568b97fbd8623481fe6fd43b0509fa32fe7f1c1d8090321a6a6a5bdc7343d4ad4122c10dcc7c9c93068db8a3f009a73befaf1ba11e4af54a66afd2c2dbe14
2021-06-02 20:37:11 +02:00
MarcoFalke
fa25ce45e9
build: improve macro for testing -latomic requirement 2021-05-11 20:07:20 +02:00
Hennadii Stepanov
2045e4cdd2
build: Use XLIFF file to provide more context to Transifex translators
Details: https://docs.transifex.com/formats/xliff
2021-04-20 15:48:48 +03:00
fanquake
fecb3723b6
build: additional PKG_CHECK_MODULES calls in bitcoin_qt.m4
Add checks for the edid, input and service support modules.
2021-04-03 15:27:04 +08:00
fanquake
a53eff3ce5
build: misc doc changes in bitcoin_qt.m4 2021-04-03 14:07:22 +08:00
fanquake
340fa6c0ff
build: set QT_*_CFLAGS & QT_*_LIBS in PKG_CHECK_MODULES() calls 2021-04-03 14:04:58 +08:00
fanquake
4b8ad97c5b
build: use QT_*_LIBS rather than passing lib names 2021-04-03 14:04:58 +08:00
fanquake
13313b2904
scripted-diff: replace Qt5 with ${qt_lib_prefix} in _BITCOIN_QT_CHECK_STATIC_LIBS
-BEGIN VERIFY SCRIPT-
sed -i -e "s/\[Qt5/\[\$\{qt_lib_prefix\}/g" build-aux/m4/bitcoin_qt.m4
sed -i -e "s/Qt5Core/\$\{qt_lib_prefix\}Core/g" build-aux/m4/bitcoin_qt.m4
-END VERIFY SCRIPT-
2021-04-03 14:04:58 +08:00
fanquake
477df3623c
build: reorder libs in _BITCOIN_QT_CHECK_STATIC_LIBS (move-only) 2021-04-03 14:04:57 +08:00
fanquake
879215e665
build: check if -lsocket is required with *ifaddrs 2021-03-29 11:09:40 +08:00
Hennadii Stepanov
72fc043954
build, qt: Drop redundant -lxcb-static flag
The removed flag has been already linked with Qt5XcbQpa.
2021-03-12 14:51:10 +02:00
Hennadii Stepanov
cba4a7e416
build, qt: Always test plugins/subdir before adding to search paths
The existence of each subdir is not guaranteed for all platforms.
2021-03-12 14:50:53 +02:00
Hennadii Stepanov
1be8e0f238
build: Add QMacStyle support 2021-03-10 12:57:26 +08:00
fanquake
06cd0da21f
build: qt 5.12.10
remove fix_configure_mac.patch
Fixed upstream: https://bugreports.qt.io/browse/QTBUG-67286

remove fix_riscv64_arch.patch
Was fixed upstream in 6a39e49a6cdeb28a04a3657bb6a22f848d5dfa9d

remove fix_rcc_determinism.patch
Fixed upstream in https://bugreports.qt.io/browse/QTBUG-62511

remove freetype_back_compat.patch
By the time we ship a release with Qt 5.12, we'll certainly no-longer be
supporting Ubuntu 14.04 and Ubuntu 16.04 ships with FreeType 2.6.1,
which is new enough that using the symbol is no-longer an issue.
The renaming of FT_Get_X11_Font_Format() happened in FreeType 2.6

remove xkb-default.patch
This was removed upstream in d5abf545971da717014d316127045fc19edbcd65

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2021-03-10 12:57:22 +08:00
Hennadii Stepanov
ffdd7de690
build, qt: Fix regression introduced in #21363
Due to the ill-formed code _BITCOIN_QT_CHECK_STATIC_PLUGIN never fails.
2021-03-09 23:31:47 +02:00
Hennadii Stepanov
32b8dc648f
build, refactor: Fix indentation 2021-03-05 09:11:13 +02:00
Hennadii Stepanov
57b65225dc
build, qt: Make Qt static libs check regardless of plugindir
Qt static libs reside in libdir.
2021-03-05 09:11:12 +02:00
Hennadii Stepanov
6203457915
build, refactor: Rename internal _BITCOIN_QT_FIND_STATIC_PLUGINS macro
New _BITCOIN_QT_CHECK_STATIC_LIBS name describes the macro functionality
more precisely.
2021-03-05 09:11:12 +02:00
Hennadii Stepanov
bf2477402d
build, qt: Refactor internal _BITCOIN_QT_CHECK_STATIC_PLUGINS macro
This change puts Q_IMPORT_PLUGIN(...) boilerplate into the macro, which
now accepts only one plugin to check, and it is renamed (plural ->
singular).
2021-03-05 09:10:56 +02:00
fanquake
fca3e98f64
Merge #18298: build: Fix Qt processing of configure script for depends with DEBUG=1
76f52e3da3 build: Fix Qt processing of configure script for depends with DEBUG=1 (Hennadii Stepanov)

Pull request description:

  This PR:
  - makes the `configure` script correctly pickup Qt if depends is built with `DEBUG=1`:
      - for Windows -- fix #19266
      - for macOS -- fix #16391
  - is an alternative to #18117 (without downsides)

ACKs for top commit:
  fanquake:
    ACK 76f52e3da3. Tested native darwin, and darwin/win cross compile with `DEBUG=1`.

Tree-SHA512: 8fde99302b4b06faf109315bddba9e3063b156c50f8f9863c2bd51718538c719429a63fdced071730c18022f2e559d3b25c1dcec3efa81fe79f657253680956a
2021-03-03 15:48:11 +08:00
Fu Yong Quah
9a0969585f build: Add /opt/homebrew to path to look for boost libraries 2021-02-19 01:37:31 +00:00
fanquake
7bf04e358a
build: remove mostly pointless BOOST_PROCESS macro
Performing a series of link checks for a Boost component that is
header-only doesn't make much sense, and currently means we just have
another confusing Boost macro in our tree. I'm not sure why this was
originally done this way; maybe Sjors or luke-jr can elaborate
(#15382 (929cda5470))?

The macro also has the side-effect of producing confusing error
messages. i.e in #20744, the CI is currently failing with:
```bash
checking for boostlib >= 1.58.0 (105800) lib path in "/tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/lib"... yes
checking for boostlib >= 1.58.0 (105800)... yes
checking whether the Boost::Process library is available... yes
configure: error: Could not find a version of the Boost::Process library!
```

This isn't useful, given there is no such thing as a `Boost::Process`
library.

This PR just removes the macro entirely, but maintains a `--with-boost-process`
(defaulting to off), flag to configure. Hopefully this will also be
removed, in favour of `--enable-disable-external-signer` if/when #16546
is merged.
2021-02-17 08:04:11 +08:00
Wladimir J. van der Laan
9996b1806a
Merge #21064: refactor: use std::shared_mutex & remove Boost Thread
060a2a64d4 ci: remove boost thread installation (fanquake)
06e1d7d81d build: don't build or use Boost Thread (fanquake)
7097add83c refactor: replace Boost shared_mutex with std shared_mutex in sigcache (fanquake)
8e55981ef8 refactor: replace Boost shared_mutex with std shared_mutex in cuckoocache tests (fanquake)

Pull request description:

  This replaces `boost::shared_mutex` and `boost::unique_lock` with [`std::shared_mutex`](https://en.cppreference.com/w/cpp/thread/shared_mutex) & [`std::unique_lock`](https://en.cppreference.com/w/cpp/thread/unique_lock).

  Even though [some concerns were raised](https://github.com/bitcoin/bitcoin/issues/16684#issuecomment-726214696) in #16684 with regard to `std::shared_mutex` being unsafe to use across some glibc versions, I still think this change is an improvement. As I mentioned in #21022, I also think trying to restrict standard library feature usage based on bugs in glibc is not only hard to do, but it's not currently clear exactly how we do that in practice (does it also extend to patching out use in our dependencies, should we be implementing more runtime checks for features we are using, when do we consider an affected glibc "old enough" not to worry about? etc). If you take a look through the [glibc bug tracker](https://sourceware.org/bugzilla/describecomponents.cgi?product=glibc) you'll no doubt find plenty of (active) bug reports for standard library code we already using. Obviously not to say we shouldn't try and avoid buggy code where possible.

  Two other points:

  [Cory mentioned in #21022](https://github.com/bitcoin/bitcoin/pull/21022#issuecomment-769274179):
  > It also seems reasonable to me to worry that boost hits the same underlying glibc bug, and we've just not happened to trigger the right conditions yet.

  Moving away from Boost to the standard library also removes the potential for differences related to Boosts configuration. Boost has multiple versions of `shared_mutex`, and what you end up using, and what it's backed by depends on:
  * The version of Boost.
  * The platform you're building for.
  * Which version of `BOOST_THREAD_VERSION` is defined: (2,3,4 or 5) default=2. (see [here](https://www.boost.org/doc/libs/1_70_0/doc/html/thread/build.html#thread.build.configuration) for some of the differences).
  * Is `BOOST_THREAD_V2_SHARED_MUTEX` defined? (not by default). If so, you might get the ["less performant, but more robust"](https://github.com/boostorg/thread/issues/230#issuecomment-475937761) version of `shared_mutex`.

  A lot of these factors are eliminated by our use of depends, but users will have varying configurations. It's also not inconceivable to think that a distro, or some package manager might start defining something like `BOOST_THREAD_VERSION=3`. Boost tried to change the default from 2 to 3 at one point.

  With this change, we no longer use Boost Thread, so this PR also removes it from depends, the build system, CI etc.

  Previous similar PRs were #19183 & #20922. The authors are included in the commits here.
  Also related to #21022 - pthread sanity checking.

ACKs for top commit:
  laanwj:
    Code review ACK 060a2a64d4
  vasild:
    ACK 060a2a64d4

Tree-SHA512: 572d14d8c9de20bc434511f20d3f431836393ff915b2fe9de5a47a02dca76805ad5c3fc4cceecb4cd43f3ba939a0508178c4e60e62abdbaaa6b3e8db20b75b03
2021-02-12 11:39:36 +01:00
fanquake
8f360e349e
build: remove ax_gcc_func_attribute macro
This is no-longer used.
2021-02-12 09:04:16 +08:00
fanquake
06e1d7d81d
build: don't build or use Boost Thread 2021-02-02 12:38:22 +08:00
fanquake
54ce4fac80
build: improve macro for testing -latomic requirement
riscv builds are currently failing because -latomic isn't being linked
against, when it is needed:
```bash
/home/ubuntu/build/bitcoin/distsrc-riscv64-linux-gnu/src/bitcoin-util.cpp:98: undefined reference to `__atomic_exchange_1'
```

This exteneds our macro to ensure that -latomic is linked against when
required.
2021-01-15 10:54:07 +08:00
Hennadii Stepanov
76f52e3da3
build: Fix Qt processing of configure script for depends with DEBUG=1
Now, if depends is built with DEBUG=1, the configure script correctly
finds Qt for macOS and Windows.
2021-01-08 10:48:22 +02:00
Hennadii Stepanov
ec4a46dd9c
build: Drop unneeded IOKit framework dependency 2020-11-25 18:25:52 +02:00