From fc5ed587cad409183af1a2ab2f46f83202bb918a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 16 Sep 2019 12:45:40 +0200 Subject: [PATCH] Merge #16871: build: make building protobuf optional in depends 107e030723552cf272dc8da01bb682032a457a3d build: make protobuf optional in depends (fanquake) ff6122f32b21fa00e9308e098b33b9657debc1d7 doc: clarify protobuf build requirements (fanquake) Pull request description: As mentioned by dongcarl in https://github.com/bitcoin/bitcoin/pull/15584#issuecomment-521780972, make building `protobuf` optional in depends. With this change it will only be built if you pass `PROTOBUF=1`. ACKs for top commit: laanwj: code review ACK 107e030723552cf272dc8da01bb682032a457a3d Sjors: tACK 107e030 on macOS 10.14. When I build depends with `PROTOBUF=1` then `./configure` has `bip70` enabled. Tree-SHA512: 49bc247a6879aaf55b943a3d0b930544ddef1e69a481955a8bebe0b02c9ad0fe168b93025f34168334cef34bb567478eb98eacab62ba909f2f64fb21119c71b8 --- ci/dash/matrix.sh | 1 + depends/Makefile | 9 +++++++-- depends/README.md | 2 ++ depends/config.site.in | 4 ++++ depends/packages/packages.mk | 6 ++++-- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ci/dash/matrix.sh b/ci/dash/matrix.sh index c33658732c..ab1e542f08 100755 --- a/ci/dash/matrix.sh +++ b/ci/dash/matrix.sh @@ -53,6 +53,7 @@ elif [ "$BUILD_TARGET" = "win64" ]; then export DIRECT_WINE_EXEC_TESTS=true elif [ "$BUILD_TARGET" = "linux32" ]; then export HOST=i686-pc-linux-gnu + export DEP_OPTS="NO_PROTOBUF=1" export BITCOIN_CONFIG="--enable-zmq --disable-bip70 --enable-reduce-exports --enable-crash-hooks" export USE_SHELL="/bin/dash" export PYZMQ=true diff --git a/depends/Makefile b/depends/Makefile index b29b782207..ab4a42ed28 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -33,6 +33,7 @@ WORK_PATH = $(BASEDIR)/work BASE_CACHE ?= $(BASEDIR)/built SDK_PATH ?= $(BASEDIR)/SDKs NO_QT ?= +NO_PROTOBUF ?= NO_WALLET ?= NO_ZMQ ?= NO_UPNP ?= @@ -134,11 +135,14 @@ wallet_packages_$(NO_WALLET) = $(wallet_packages) upnp_packages_$(NO_UPNP) = $(upnp_packages) zmq_packages_$(NO_ZMQ) = $(zmq_packages) +protobuf_packages_$(NO_PROTOBUF) = $(protobuf_packages) + packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) -ifneq ($(qt_packages_),) -native_packages += $(qt_native_packages) +ifneq ($(protobuf_packages_),) +native_packages += $(protobuf_native_packages) +packages += $(protobuf_packages) endif ifneq ($(zmq_packages_),) @@ -205,6 +209,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_ -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \ -e 's|@no_qt@|$(NO_QT)|' \ -e 's|@no_zmq@|$(NO_ZMQ)|' \ + -e 's|@disable_bip70@|$(NO_PROTOBUF)|' \ -e 's|@no_wallet@|$(NO_WALLET)|' \ -e 's|@no_upnp@|$(NO_UPNP)|' \ -e 's|@debug@|$(DEBUG)|' \ diff --git a/depends/README.md b/depends/README.md index 88a279ca6e..138d18d05f 100644 --- a/depends/README.md +++ b/depends/README.md @@ -91,6 +91,8 @@ The following can be set when running make: `make FOO=bar`
Don't download/build/cache packages needed for enabling upnp
DEBUG
disable some optimizations and enable more runtime checking
+
PROTOBUF
+
build protobuf (used for deprecated BIP70 support)
HOST_ID_SALT
Optional salt to use when generating host package ids
BUILD_ID_SALT
diff --git a/depends/config.site.in b/depends/config.site.in index 0048f26b3e..ff50f6e48d 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -47,6 +47,10 @@ if test -z $enable_zmq && test -n "@no_zmq@"; then enable_zmq=no fi +if test -n $disable_bip70 && test -n "@disable_bip70@"; then + disable_bip70=no +fi + if test -n "@debug@" && test -z "@no_qt@" && test "x$with_gui" != xno; then with_gui=qt5_debug fi diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index d5cd08a7f6..6af042701e 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -1,7 +1,9 @@ packages:=boost openssl libevent gmp bls-dash backtrace cmake immer -qt_native_packages = native_protobuf -qt_packages = qrencode protobuf zlib +protobuf_native_packages = native_protobuf +protobuf_packages = protobuf + +qt_packages = qrencode zlib qt_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig