mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Merged revisions 73341 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73341 | tarek.ziade | 2009-06-11 10:12:20 +0200 (Thu, 11 Jun 2009) | 1 line Fixed #5201: now distutils.sysconfig.parse_makefile() understands '53264' in Makefiles ........
This commit is contained in:
parent
e5ed650d71
commit
6b16c00b92
3 changed files with 41 additions and 7 deletions
|
@ -275,18 +275,25 @@ def parse_makefile(fn, g=None):
|
|||
|
||||
while 1:
|
||||
line = fp.readline()
|
||||
if line is None: # eof
|
||||
if line is None: # eof
|
||||
break
|
||||
m = _variable_rx.match(line)
|
||||
if m:
|
||||
n, v = m.group(1, 2)
|
||||
v = string.strip(v)
|
||||
if "$" in v:
|
||||
v = v.strip()
|
||||
# `$$' is a literal `$' in make
|
||||
tmpv = v.replace('$$', '')
|
||||
|
||||
if "$" in tmpv:
|
||||
notdone[n] = v
|
||||
else:
|
||||
try: v = int(v)
|
||||
except ValueError: pass
|
||||
done[n] = v
|
||||
try:
|
||||
v = int(v)
|
||||
except ValueError:
|
||||
# insert literal `$'
|
||||
done[n] = v.replace('$$', '$')
|
||||
else:
|
||||
done[n] = v
|
||||
|
||||
# do variable interpolation here
|
||||
while notdone:
|
||||
|
@ -314,7 +321,7 @@ def parse_makefile(fn, g=None):
|
|||
else:
|
||||
try: value = int(value)
|
||||
except ValueError:
|
||||
done[name] = string.strip(value)
|
||||
done[name] = value.strip()
|
||||
else:
|
||||
done[name] = value
|
||||
del notdone[name]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue