summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/sysconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/sysconfig.py')
-rw-r--r--Lib/distutils/sysconfig.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 099e058..4a4fadd 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -285,18 +285,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:
@@ -324,7 +331,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]