Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/collectd: fix netsnmp dependency handling
@ 2019-08-10 12:29 Bernd Kuhls
  2019-08-11 13:03 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2019-08-10 12:29 UTC (permalink / raw)
  To: buildroot

When a defconfig contains

BR2_PACKAGE_COLLECTD_SNMP is not set
BR2_PACKAGE_NETSNMP=y

collectd was built with snmp support, --with-libnetsnmp should only be
enabled if the collectd-specific option BR2_PACKAGE_COLLECTD_SNMP
is enabled.

Fixes:
http://autobuild.buildroot.net/results/d1c/d1c88b21883d9a6af54cd9a99bc4b0125f08095d/

Please note that this patch does not fix the collectd build with
netsnmp support but the build should only fail for defconfigs with
BR2_PACKAGE_COLLECTD_SNMP enabled ;)

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/collectd/collectd.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
index 8eb7aa2ec0..ff36adaef3 100644
--- a/package/collectd/collectd.mk
+++ b/package/collectd/collectd.mk
@@ -182,8 +182,10 @@ endif
 ifeq ($(BR2_PACKAGE_MYSQL),y)
 COLLECTD_CONF_OPTS += --with-libmysql=$(STAGING_DIR)/usr
 endif
-ifeq ($(BR2_PACKAGE_NETSNMP),y)
+ifeq ($(BR2_PACKAGE_COLLECTD_SNMP),y)
 COLLECTD_CONF_OPTS += --with-libnetsnmp=$(STAGING_DIR)/usr
+else
+COLLECTD_CONF_OPTS += --with-libnetsnmp=no
 endif
 ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
 COLLECTD_CONF_OPTS += --with-libpq=$(STAGING_DIR)/usr/bin/pg_config
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 1/1] package/collectd: fix netsnmp dependency handling
  2019-08-10 12:29 [Buildroot] [PATCH 1/1] package/collectd: fix netsnmp dependency handling Bernd Kuhls
@ 2019-08-11 13:03 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2019-08-11 13:03 UTC (permalink / raw)
  To: buildroot

Hello Bernd,

On Sat, 10 Aug 2019 14:29:04 +0200
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
> index 8eb7aa2ec0..ff36adaef3 100644
> --- a/package/collectd/collectd.mk
> +++ b/package/collectd/collectd.mk
> @@ -182,8 +182,10 @@ endif
>  ifeq ($(BR2_PACKAGE_MYSQL),y)
>  COLLECTD_CONF_OPTS += --with-libmysql=$(STAGING_DIR)/usr
>  endif
> -ifeq ($(BR2_PACKAGE_NETSNMP),y)
> +ifeq ($(BR2_PACKAGE_COLLECTD_SNMP),y)
>  COLLECTD_CONF_OPTS += --with-libnetsnmp=$(STAGING_DIR)/usr
> +else
> +COLLECTD_CONF_OPTS += --with-libnetsnmp=no
>  endif

We normally use --without-foo instead of --with-foo=no.

But more importantly, there is already a --without-snmp that is passed
when BR2_PACKAGE_COLLECTD_SNMP is disabled:

	$(if $(BR2_PACKAGE_COLLECTD_SNMP),--enable-snmp,--disable-snmp) \

Isn't that sufficient ?

Also, if the --disable-snmp isn't sufficient, then don't we have the
same problem for MySQL, PostgreSQL and a number of other dependencies ?

For example, for MySQL, we have in CONF_OPTS:

	$(if $(BR2_PACKAGE_COLLECTD_MYSQL),--enable-mysql,--disable-mysql) \

Then in DEPENDENCIES:

	$(if $(BR2_PACKAGE_COLLECTD_MYSQL),mysql) \

And later:

ifeq ($(BR2_PACKAGE_MYSQL),y)
COLLECTD_CONF_OPTS += --with-libmysql=$(STAGING_DIR)/usr
endif

So we have the exact same situation as SNMP.

Could you have a look into this ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-11 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-10 12:29 [Buildroot] [PATCH 1/1] package/collectd: fix netsnmp dependency handling Bernd Kuhls
2019-08-11 13:03 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox