diff options
author | fanquake <fanquake@gmail.com> | 2022-09-13 17:13:36 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-09-13 17:14:53 +0100 |
commit | 29d540b7ada890dd588c4825d40c27c5e6f20061 (patch) | |
tree | d96ad0d5c9cff0b6bc34aae0f9d2d3bcfaee1e26 | |
parent | c85688347eac1a79099ae61dfc37e69e3fa3b220 (diff) | |
parent | b50a4b7647c63f2557409308389ef09a67aef5ce (diff) | |
download | bitcoin-29d540b7ada890dd588c4825d40c27c5e6f20061.tar.xz |
Merge bitcoin/bitcoin#26070: build: Quiet warnings in symlinked headers installed from homebrew
b50a4b7647c63f2557409308389ef09a67aef5ce build: quiet warnings in system headers installed from homebrew (Cory Fields)
Pull request description:
From the included comment:
Homebrew may create symlinks in `/usr/local/include` for some packages. Because MacOS's clang internally adds `-I /usr/local/include` to its search paths, this will negate efforts to use `-isystem` for those packages, as they will be found first in `/usr/local`. Use the internal `-internal-isystem` option to system-ify all `/usr/local/include` paths without adding it to the list of search paths in case it's not already there.
This fixes the issue explained here: https://github.com/bitcoin/bitcoin/pull/26056#issuecomment-1243362059
~Also temporarily includes #26056 as a test. I will remove that commit if/when c-i is happy, and fanquake can rebase it post-merge.~
I've removed this commit now that c-i succeeded with it.
ACKs for top commit:
hebasto:
ACK b50a4b7647c63f2557409308389ef09a67aef5ce, tested as a part of bitcoin/bitcoin#26056 on macOS Monterey 12.6 (21G115, both Intel and Apple M1) + Apple clang 14.0.0:
Tree-SHA512: 163aa359d27c31d52b444252762e32dd8a11acc043cf1a2aa953f902d1dab77ece52e2dfedcce637e6a1dda47e4c566bfeb8d3b092f82bfc73923843b7bc619c
-rw-r--r-- | configure.ac | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 1405adf702..12f8f2dcc6 100644 --- a/configure.ac +++ b/configure.ac @@ -746,6 +746,16 @@ case $host in dnl It's safe to add these paths even if the functionality is disabled by dnl the user (--without-wallet or --without-gui for example). + dnl Homebrew may create symlinks in /usr/local/include for some packages. + dnl Because MacOS's clang internally adds "-I /usr/local/include" to its search + dnl paths, this will negate efforts to use -isystem for those packages, as they + dnl will be found first in /usr/local. Use the internal "-internal-isystem" + dnl option to system-ify all /usr/local/include paths without adding it to the list + dnl of search paths in case it's not already there. + if test "$suppress_external_warnings" != "no"; then + AX_CHECK_PREPROC_FLAG([-Xclang -internal-isystem/usr/local/include], [CORE_CPPFLAGS="$CORE_CPPFLAGS -Xclang -internal-isystem/usr/local/include"], [], [$CXXFLAG_WERROR]) + fi + if test "$use_bdb" != "no" && $BREW list --versions berkeley-db@4 >/dev/null && test "$BDB_CFLAGS" = "" && test "$BDB_LIBS" = ""; then bdb_prefix=$($BREW --prefix berkeley-db@4 2>/dev/null) dnl This must precede the call to BITCOIN_FIND_BDB48 below. |