Commit Graph

146 Commits

Author SHA1 Message Date
Hennadii Stepanov dd3e0fa125
build: Fix false positive `CHECK_ATOMIC` test for clang-15 2024-04-12 09:52:06 +02:00
MarcoFalke fa223ba5eb
Revert "build: Fix undefined reference to __mulodi4"
This reverts commit e4c8bb62e4.
2024-01-09 15:38:57 +01:00
Hennadii Stepanov f8ca1357c8
build: Fix check whether `-latomic` needed 2024-01-04 11:47:47 +00:00
MarcoFalke fa67f096bd
build: Require C++20 compiler 2023-12-07 11:05:33 +01:00
fanquake ebc7063c80
doc: update docs for CHECK_ATOMIC macro
Clarify that supported versions of GCC are not affected, and that Clang
prior to version 15 still requires the explicit -latomic linking, when
compiling for 32-bit.
2023-11-02 16:53:58 +00:00
MarcoFalke fa953f15bf
build: Bump minimum supported GCC to g++-9
Also, update the code to use constexpr, which does not work in g++-8.

Also, drop the no longer needed build-aux/m4/l_filesystem.m4.
2023-05-18 12:24:40 +02:00
MarcoFalke fad2c200f4
build: Bump minimum Clang to clang-10 2023-05-17 10:30:41 +02:00
fanquake 14afc71a61
build: remove Boost lib detection from ax_boost_base
We don't use / link against Boost libraries, so there is no reason for
us to try and detect them / muddle with LDFLAGS.
2023-01-13 10:41:33 +00:00
fanquake 85f0f933b4
build: sync ax_boost_base from upstream
I upstreamed our change,
https://github.com/autoconf-archive/autoconf-archive/pull/260, so sync
with upstream.

Slightly simplifies #25465.
2022-09-04 10:10:16 +01:00
Andrew Chow 4de4221ab4 build: Check for std::atomic::exchange rather than std::atomic_exchange
Our usage of std::atomic is with it's own exchange function, not
std::atomic_exchange. So we should be looking specifically for that
function.

Additionally, -pthread and -lpthread have an effect on whether -latomic
will be needed, so the atomics check needs to use these flags as well.
This will make the flags in use better match what is actually used when
linking.

This removes the need for -latomic for riscv builds, which resolves a
guix cross architecture reproducibility issue.
2022-07-18 10:47:19 -04:00
fanquake 7b00595d33
build: stop overriding user CXXFLAGS
Let users have the final say in regards to CXXFLAGS.
2022-04-03 19:36:17 +01:00
fanquake 35c3fd43c3
build: stop overriding user CPPFLAGS
Let the user have the final say in regards to CPPFLAGS
2022-04-03 19:36:11 +01:00
MarcoFalke fa7dada1fc
build: update ax_cxx_compile_stdcxx to serial 14 2022-03-02 13:18:47 +01:00
fanquake 39e66e938f
build: use header-only Boost unit test 2022-02-13 20:59:02 +00:00
fanquake 07269321f3
build: remove Boost::system usage 2022-02-03 18:35:52 +08:00
Kiminuo b87f9c5edf
build: remove boost::filesystem usage 2022-02-03 18:35:52 +08:00
fanquake ffc89d1f21
build: add support for std::filesystem
Add a macro to check if linking with -lstdc++fs or -lc++fs is required.
2022-02-03 18:35:41 +08:00
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