package/bluez5_utils: make tools optional

The tools are currently always build and installed. In many cases
those tools are not needed in a production system. So make this
step optional. This saves up to 2MB on the target.

Further tweak the deprecated option. It has effects when the --enable-tools
is set as well as when --enable-client is set. So explain this in the
options description and update the install step for gatttool to only be
added when client is enabled.

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Michael Nosthoff
2021-07-31 22:38:03 +02:00
committed by Arnout Vandecappelle (Essensium/Mind)
parent 03c148c8de
commit 2245000fed
2 changed files with 24 additions and 5 deletions

View File

@@ -43,13 +43,23 @@ config BR2_PACKAGE_BLUEZ5_UTILS_MONITOR
help help
Build monitor utility btmon. Build monitor utility btmon.
config BR2_PACKAGE_BLUEZ5_UTILS_TOOLS
bool "build tools"
help
Build tools like bluemoon, btattach, hex2hcd, l2test,
l2ping, mpris-proxy, rctest.
config BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED config BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED
bool "install deprecated tools" bool "install deprecated tools"
depends on BR2_PACKAGE_BLUEZ5_UTILS_CLIENT depends on BR2_PACKAGE_BLUEZ5_UTILS_CLIENT || BR2_PACKAGE_BLUEZ5_UTILS_TOOLS
help help
Build deprecated tools. These currently include: Build deprecated tools.
When "build tools" is selected these tools are installed:
hciattach, hciconfig, hcitool, hcidump, rfcomm, sdptool, hciattach, hciconfig, hcitool, hcidump, rfcomm, sdptool,
ciptool, gatttool. ciptool.
When CLI client is enabled "gatttool" is installed.
config BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL config BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL
bool "build experimental tools" bool "build experimental tools"

View File

@@ -20,7 +20,6 @@ BLUEZ5_UTILS_DEPENDENCIES = \
libglib2 libglib2
BLUEZ5_UTILS_CONF_OPTS = \ BLUEZ5_UTILS_CONF_OPTS = \
--enable-tools \
--enable-library \ --enable-library \
--disable-cups \ --disable-cups \
--disable-manpages \ --disable-manpages \
@@ -46,6 +45,12 @@ else
BLUEZ5_UTILS_CONF_OPTS += --disable-monitor BLUEZ5_UTILS_CONF_OPTS += --disable-monitor
endif endif
ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_TOOLS),y)
BLUEZ5_UTILS_CONF_OPTS += --enable-tools
else
BLUEZ5_UTILS_CONF_OPTS += --disable-tools
endif
# experimental plugins # experimental plugins
ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL),y) ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL),y)
BLUEZ5_UTILS_CONF_OPTS += --enable-experimental BLUEZ5_UTILS_CONF_OPTS += --enable-experimental
@@ -125,12 +130,16 @@ else
BLUEZ5_UTILS_CONF_OPTS += --disable-sixaxis BLUEZ5_UTILS_CONF_OPTS += --disable-sixaxis
endif endif
# install gatttool (For some reason upstream choose not to do it by default)
ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED),y) ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED),y)
# install gatttool (For some reason upstream choose not to do it by default)
# gattool depends on the client for readline
ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS_CLIENT),y)
define BLUEZ5_UTILS_INSTALL_GATTTOOL define BLUEZ5_UTILS_INSTALL_GATTTOOL
$(INSTALL) -D -m 0755 $(@D)/attrib/gatttool $(TARGET_DIR)/usr/bin/gatttool $(INSTALL) -D -m 0755 $(@D)/attrib/gatttool $(TARGET_DIR)/usr/bin/gatttool
endef endef
BLUEZ5_UTILS_POST_INSTALL_TARGET_HOOKS += BLUEZ5_UTILS_INSTALL_GATTTOOL BLUEZ5_UTILS_POST_INSTALL_TARGET_HOOKS += BLUEZ5_UTILS_INSTALL_GATTTOOL
endif
# hciattach_bcm43xx defines default firmware path in `/etc/firmware`, but # hciattach_bcm43xx defines default firmware path in `/etc/firmware`, but
# Broadcom firmware blobs are usually located in `/lib/firmware`. # Broadcom firmware blobs are usually located in `/lib/firmware`.
BLUEZ5_UTILS_CONF_ENV += \ BLUEZ5_UTILS_CONF_ENV += \