Assuming that you’re building in Linux, legacy wallet support will require Berkeley DB 4.8. You can find instructions in the corresponding section along with a helpful install script’s location. There is also this comprehensive guide on how to compile bitcoind for testing by Jon Atack, which provides a few more details that might be helpful.
At the end of the mentioned install script, it prints instructions on how to configure the compilation of bitcoind. Look for something along the lines of
db4 build complete.
When compiling bitcoind, run `./configure` in the following way:
export BDB_PREFIX='<SOME-PATH>/db4'
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...
Use these instructions to configure your installation after installing BDB. Run:
- The
export BDB_PREFIX='<SOME-PATH>/db4'
from the scripts final output ./autogen.sh
- Also from the script output use
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...
, adding any other parameters you like - finally call,
make
ormake install
according to your intended outcome