diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -281,6 +281,8 @@ def parse_makefile(fn, g=None): # do variable interpolation here while notdone: + last_notdone = notdone.copy() + for name in notdone.keys(): value = notdone[name] m = _findvar1_rx.search(value) or _findvar2_rx.search(value) @@ -312,6 +314,11 @@ def parse_makefile(fn, g=None): else: # bogus variable reference; just drop it since we can't deal del notdone[name] + + # if we did not change a thing in notdone, we won't do it in the next round + if last_notdone==notdone: + print "sysconfig.py: warning: could not resolve names from makefile (recursive definition?):", notdone + break fp.close()