[Dnsmasq-discuss] Fwd: [PATCH] Makefile: make variables overridable

Geert Stappers stappers at stappers.nl
Sat Jul 11 15:17:48 BST 2020


On Sat, Jul 11, 2020 at 02:33:36PM +0200, betaboon wrote:
> Hello Simon, hello everyone.
> 
> when cross-compiling dnsmasq for armv7 in nixos we ran into the
> Makefile not picking up the variables properly.
> 
> for now we are maintaining the attached patch in our package-tree to
> get around this issue, but would love to upstream this to you.
> 
> The issue in question can be found here:
> https://github.com/NixOS/nixpkgs/pull/91422

That "pull request" says the reason
is https://github.com/NixOS/nixpkgs/pull/91418

The "#91418" mentions

dbus.c:21:10: fatal error: dbus/dbus.h: No such file or directory
   21 | #include <dbus/dbus.h>
      |          ^~~~~~~~~~~~~


> 
> >From 41d49b07a32625839f267a45379297066a7879ca Mon Sep 17 00:00:00 2001
> From: betaboon <betaboon at 0x80.ninja>
> Date: Tue, 30 Jun 2020 12:13:41 +0200
> Subject: [PATCH] Makefile: make variables overridable
> 
> ---
>  Makefile | 38 +++++++++++++++++++-------------------
>  1 file changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 78e25f0..8e44354 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -18,31 +18,31 @@
> 
>  # Variables you may well want to override.
> 
> -PREFIX        = /usr/local
> -BINDIR        = $(PREFIX)/sbin
> -MANDIR        = $(PREFIX)/share/man
> -LOCALEDIR     = $(PREFIX)/share/locale
> -BUILDDIR      = $(SRC)
> -DESTDIR       =
> -CFLAGS        = -Wall -W -O2
> -LDFLAGS       =
> -COPTS         =
> -RPM_OPT_FLAGS =
> -LIBS          =
> +PREFIX        ?= /usr/local
> +BINDIR        ?= $(PREFIX)/sbin
> +MANDIR        ?= $(PREFIX)/share/man
> +LOCALEDIR     ?= $(PREFIX)/share/locale
> +BUILDDIR      ?= $(SRC)
> +DESTDIR       ?=
> +CFLAGS        ?= -Wall -W -O2
> +LDFLAGS       ?=
> +COPTS         ?=
> +RPM_OPT_FLAGS ?=
> +LIBS          ?=
> 
>  #################################################################
> 
>  # Variables you might want to override.
> 
> -PKG_CONFIG = pkg-config
> -INSTALL    = install
> -MSGMERGE   = msgmerge
> -MSGFMT     = msgfmt
> -XGETTEXT   = xgettext
> +PKG_CONFIG ?= pkg-config
> +INSTALL    ?= install
> +MSGMERGE   ?= msgmerge
> +MSGFMT     ?= msgfmt
> +XGETTEXT   ?= xgettext
> 
> -SRC = src
> -PO  = po
> -MAN = man
> +SRC ?= src
> +PO  ?= po
> +MAN ?= man
> 
>  #################################################################
> 
> --
> 2.27.0
> 

So a single 'dbus.c:21:10: fatal error: dbus/dbus.h: No such file or directory'
in the NixOS world, shows up here as request for, example given,

> -MANDIR        = $(PREFIX)/share/man
> +MANDIR        ?= $(PREFIX)/share/man


With whole commit message 'Makefile: make variables overridable'.



Patch reviewed and rejected.


Regards
Geert Stappers
-- 
Silence is hard to parse



More information about the Dnsmasq-discuss mailing list