[Dnsmasq-discuss] Fwd: [PATCH] Makefile: make variables overridable
Pali Rohár
pali.rohar at gmail.com
Sun Jul 12 22:22:38 BST 2020
On Sunday 12 July 2020 22:19:42 Geert Stappers wrote:
> On Sun, Jul 12, 2020 at 09:05:17PM +0200, Pali Rohár wrote:
> > On Sunday 12 July 2020 13:53:11 John Ericson wrote:
> > > Hi, I am another NixOS maintainer.
> > >
> > > Yes, it is true that ?= in makefiles is somewhat rare, and that we
> > > can work around this other ways. But it was I who proposed the ?=
> > > change on our side, so let say why I think it's the right choice:
> > >
> > > Most C packages don't use "?=" and do
> > > FOO ?= foo
> > > but instead do have a configure script, so they do
> > > FOO = @FOO@
> > > with regular "=". However that configure script *does* silently
> > > consume environment variables, so the effect is the same.
> >
> > "FOO ?= foo" syntax is not supported by POSIX make:
> > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
> >
> > And requires some GNU Make extension.
> >
> > I guess because dnsmasq is supported also on non-GNU Make systems, it
> > cannot take some patch which adds dependency on Linux or GNU specific
> > feature.
>
> I rather hope that dnsmasq is considered usefull in worlds outside
> the Linux and GNU world.
>
>
> > > I wouldn't request upstream add a configure script is nothing
> > > is needed, and I don't even like the implicitness of environment
> > > variables myself. But the fact is it is the standard for distros
> > > to communicate information to all the myriad build systems,
> > > so I advocate this change so distros can remove extra packaging hacks.
> > >
> > > The variable we need to override is PKG_CONFIG.
> >
> > Basically I do not understand whole point of this patch. If you for
> > compilation need to override some Makefile variable, why do you not
> > set correct value of that variable?
> >
> > It is lot of easier to set correct value during compilation as patching
> > sources or sending patch to upstream and waiting if it would be released
> > in new version.
>
> I have prepared a patch which only changes the PKG_CONFIG
> and does have explaination[1] in the commit message.
But why is this change needed at all? Are there some bugs in GNU make so
that macros/variables initialized by '=' cannot be overridden and
initialization with '?=' is fixing those bugs?
--
Pali Rohár
pali.rohar at gmail.com
More information about the Dnsmasq-discuss
mailing list