I'm having build error with current master (1c7ef0abd11f35a27cc860ceb7e075b78f53cecf), with Gentoo Linux:
$ make clean
$ ./autogen.sh
$ ./configure
$ make
...
CXX qt/libbitcoinqt_a-rpcconsole.o
In file included from qt/rpcconsole.cpp:32:
./wallet/bdb.h:27:10: fatal error: db_cxx.h: No such file or directory
27 | #include <db_cxx.h>
| ^~~~~~~~~~
compilation terminated.
$ locate db_cxx.h
/usr/include/db4.8/db_cxx.h
/usr/include/db5.3/db_cxx.h
Reverting 46a890960e4b07e5aec479aa8e07e9c34ce68aee (#25244) fixes the problem.