From: Daniel P. Berrangé Date: Fri, 13 Mar 2020 18:39:25 +0000 (+0000) Subject: build: workaround behaviour regression in gnu make 4.3 X-Git-Tag: v6.2.0-rc1~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdd941eeb25f62eaf8ff234ee4c8351257bb25a0;p=thirdparty%2Flibvirt.git build: workaround behaviour regression in gnu make 4.3 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 Signed-off-by: Daniel P. Berrangé --- diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index b829c8a18b..3020921be8 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -687,8 +687,7 @@ msg_gen_function += virLastErrorPrefixMessage # msg_gen_function += vshPrint # msg_gen_function += vshError -space = -space += +space = $(null) $(null) func_re= ($(subst $(space),|,$(msg_gen_function))) # Look for diagnostics that aren't marked for translation.