[Buildroot] [PATCH] netsnmp: add option to enable debugging code
Luca Ceresoli
luca at lucaceresoli.net
Mon Mar 19 09:19:02 UTC 2012
Peter Korsgaard wrote:
>>>>>> "Arnout" == Arnout Vandecappelle<arnout at mind.be> writes:
> Arnout> On Thursday 15 March 2012 22:04:27 Luca Ceresoli wrote:
> >> +ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING),y)
> >> + NETSNMP_CONF_OPT += --disable-debugging
> >> +endif
>
> Arnout> Peter, is it correct that you prefer to have both the positive
> Arnout> and the negative option in such a situation? I.e.
>
> Arnout> ifeq ($(BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING),y)
> Arnout> NETSNMP_CONF_OPT += --enable-debugging
> Arnout> else
> Arnout> NETSNMP_CONF_OPT += --disable-debugging
> Arnout> endif
>
> I don't feel strongly about it, but the 2nd approach means you don't
> need to look at configure.ac to check if it defaults to --enable (and it
> won't break if the default is ever changed).
>
Arnout's version is definitely more robust, although less concise and more
boring to write.
But there are many other examples in the current Buildroot code without the
else part. So I think we should have a guideline to follow coherently.
It would be great to have a macro to generate all of this boilerplate code,
both robust and concise. I would love to be able to write something like:
$(call ac-arg-endisable,BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING,debugging)
It's even on my TODO list, which is the first step to many great things!
Luca
More information about the buildroot
mailing list