Provide equivalent for applicable options from deprecated build system
I've noticed some options doesn't show in cmake -LH ..
output, which hints that they may not exists in cmake
build.
Here's an example of the deprecated build system that I'm using to generate the minimal build of bitcoin-tx
statically linked:
export CONFIG_SITE="${PWD}/depends/x86_64-pc-linux-musl/share/config.site"
./configure \
LDFLAGS="-static-libstdc++ -static-libgcc" \
--enable-deprecated-build-system \
--enable-c++17 \
--disable-wallet \
--disable-tests \
--disable-bench \
--disable-ccache \
--disable-zmq \
--disable-man \
--enable-util-cli=no \
--enable-util-tx=yes \
--with-gui=no \
--with-utils=no \
--with-libs=no \
--with-daemon=no \
--with-seeder=no
From what I've checked, the following options didn't have a truly equivalent:
CONFIG_SITE="${PWD}/depends/x86_64-pc-linux-musl/share/config.site"
LDFLAGS="-static-libgcc"
--with-daemon=no
I could get away with --with-daemon=no
using ninja bitcoin-tx
, but preserving previous options would be ideal.
I'm also aware of -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Linux64.cmake
, but that one didn't build an static linked binary:
/tmp # ./bitcoin-tx
Error loading shared library libboost_chrono.so.1.72.0: No such file or directory (needed by ./bitcoin-tx)
Error loading shared library libboost_filesystem.so.1.72.0: No such file or directory (needed by ./bitcoin-tx)
Error loading shared library libboost_thread.so.1.72.0: No such file or directory (needed by ./bitcoin-tx)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by ./bitcoin-tx)
I understand that without an equivalent for -static-libgcc
libgcc_s.so.1
wouldn't be included, but libboost
libraries should be there.
Context: On depends
I ran:
make NO_QT=1 NO_QR=1 NO_ZMQ=1 NO_WALLET=1 NO_BDB=1 NO_SQLITE=1 NO_UPNP=1 NO_NATPMP=1 -j4
which is what I've used for deprecated build system
then I ran:
cmake -GNinja .. -DBUILD_BITCOIN_WALLET=OFF -DBUILD_BITCOIN_QT=OFF -DENABLE_UPNP=OFF -DBUILD_BITCOIN_ZMQ=OFF -DENABLE_MAN=OFF -DBUILD_BITCOIN_CLI=OFF -DBUILD_BITCOIN_SEEDER=OFF -DBUILD_LIBBITCOINCONSENSUS=OFF -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Linux64.cmake -DENABLE_STATIC_LIBSTDCXX=ON -DOPENSSL_INCLUDE_DIR=/usr/include/openssl -DEvent_INCLUDE_DIR=/usr/include/event2/
ninja bitcoin-tx
Related: alpine
required explicit openssl
& event
INCLUDE_DIR
in order to work with depends
, will add that to alpine guide.
EDIT: INCLUDE_DIR
errors were related with -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Linux64.cmake
that was not pointing to the correct depends folder, so they're not actually needed