mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
Bug 780407 - Pymake: Export variables in MAKEFLAGS, including those passed over the command-line. r=khuey
This commit is contained in:
parent
cb996847fc
commit
5c170e7fab
@ -498,9 +498,9 @@ def parsestring(s, filename):
|
||||
e.rstrip()
|
||||
|
||||
if token is None:
|
||||
condstack[-1].append(parserdata.ExportDirective(e, single=False))
|
||||
condstack[-1].append(parserdata.ExportDirective(e, concurrent_set=False))
|
||||
else:
|
||||
condstack[-1].append(parserdata.ExportDirective(e, single=True))
|
||||
condstack[-1].append(parserdata.ExportDirective(e, concurrent_set=True))
|
||||
|
||||
value = flattenmakesyntax(d, offset).lstrip()
|
||||
condstack[-1].append(parserdata.SetVariable(e, value=value, valueloc=d.getloc(offset), token=token, targetexp=None))
|
||||
|
@ -88,6 +88,7 @@ def parsecommandlineargs(args):
|
||||
vname = vname.strip()
|
||||
vnameexp = data.Expansion.fromstring(vname, "Command-line argument")
|
||||
|
||||
stmts.append(ExportDirective(vnameexp, concurrent_set=True))
|
||||
stmts.append(SetVariable(vnameexp, token=t,
|
||||
value=val, valueloc=Location('<command-line>', i, len(vname) + len(t)),
|
||||
targetexp=None, source=data.Variables.SOURCE_COMMANDLINE))
|
||||
@ -548,20 +549,22 @@ class ExportDirective(Statement):
|
||||
|
||||
See https://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion
|
||||
|
||||
The `single` field defines whether this statement occurred with or without
|
||||
a variable assignment. If True, no variable assignment was present. If
|
||||
False, the SetVariable immediately following this statement originally came
|
||||
from this export directive (the parser splits it into multiple statements).
|
||||
The `concurrent_set` field defines whether this statement occurred with or
|
||||
without a variable assignment. If False, no variable assignment was
|
||||
present. If True, the SetVariable immediately following this statement
|
||||
originally came from this export directive (the parser splits it into
|
||||
multiple statements).
|
||||
"""
|
||||
__slots__ = ('exp', 'single')
|
||||
|
||||
def __init__(self, exp, single):
|
||||
__slots__ = ('exp', 'concurrent_set')
|
||||
|
||||
def __init__(self, exp, concurrent_set):
|
||||
assert isinstance(exp, (data.Expansion, data.StringExpansion))
|
||||
self.exp = exp
|
||||
self.single = single
|
||||
self.concurrent_set = concurrent_set
|
||||
|
||||
def execute(self, makefile, context):
|
||||
if self.single:
|
||||
if self.concurrent_set:
|
||||
vlist = [self.exp.resolvestr(makefile, makefile.variables)]
|
||||
else:
|
||||
vlist = list(self.exp.resolvesplit(makefile, makefile.variables))
|
||||
|
@ -2,5 +2,6 @@
|
||||
|
||||
all:
|
||||
test "$(OVAR)" = "oval"
|
||||
test "$$OVAR" = "oval"
|
||||
@echo TEST-PASS
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user