[libvirt PATCH] build: workaround behaviour regression in gnu make 4.3

Eric Blake eblake at redhat.com
Fri Mar 13 19:02:35 UTC 2020


On 3/13/20 1:42 PM, Daniel P. Berrangé wrote:
> We need the "$(space)" variable to contain a single whitespace
> character. We do this by assigning and then appending an empty
> string to the variable. Variable appends get separated by a
> single whitespace historically, but GNU make 4.3 introduced a
> behaviour regression.
> 
>    https://lists.gnu.org/archive/html/bug-make/2020-01/msg00057.html
> 
> [quote]
> * WARNING: Backward-incompatibility!
>    Previously appending using '+=' to an empty variable would
>    result in a value starting with a space.  Now the initial
>    space is only added if the variable already contains some
>    value.  Similarly, appending an empty string does not
>    add a trailing space.
> [/quote]
> 
> This patch tries a new trick to get a single whitespace by
> getting make to expand two non-existant variables separated
> by a space.

Reviewed-by: Eric Blake <eblake at redhat.com>

https://blog.jgc.org/2007/06/escaping-comma-and-space-in-gnu-make.html 
needs to be updated to cover this change in GNU make, but it also points 
out that GNU make permits:

$(space) = $(null) $(null)

as a way to then write [$( )] or [$ ] instead of [$(space)] (all three 
producing "[ ]"), if you really want to go crazy with odd macro names.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the libvir-list mailing list