ninjatool: quote dollars in variables

Otherwise, dollars (such as in the special $ORIGIN rpath) are
eaten by Make.

Reported-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2020-08-26 17:02:03 +02:00
parent ec14f888b8
commit 1a4db552d8

View File

@ -834,7 +834,8 @@ class Ninja2Make(NinjaParserEventsWithVars):
self.print()
for targets in self.build_vars:
for name, value in self.build_vars[targets].items():
self.print('%s: private .var.%s := %s' % (targets, name, value))
self.print('%s: private .var.%s := %s' %
(targets, name, value.replace('$', '$$')))
self.print()
if not self.seen_default:
default_targets = sorted(self.all_outs - self.all_ins, key=natural_sort_key)