--- siputils.py.orig 2010-09-03 03:26:37.000000000 +1000 +++ siputils.py 2010-10-31 02:55:12.000000000 +1100 @@ -1415,8 +1415,8 @@ # 'real_prefix' exists if virtualenv is being used. dl = getattr(sys, 'real_prefix', sys.exec_prefix).split(os.sep) - if "Python.framework" not in dl: - error("SIP requires Python to be built as a framework") + #if "Python.framework" not in dl: + # error("SIP requires Python to be built as a framework") self.LFLAGS.append("-undefined dynamic_lookup") @@ -2319,18 +2319,54 @@ lhs = line[:assstart].strip() rhs = line[assend + 1:].strip() +# print "lhs is", lhs +# print "rhs is", rhs + + # check for X = foo $$X (like += but prepending) + s_start = rhs.find(lhs) + if s_start != -1: +# print "maybe found substr" + s_pre_s = s_start + while s_pre_s >= 0 and rhs[s_pre_s] not in string.whitespace: + s_pre_s -= 1 + s_pre_s += 1 + s_pre_str = rhs[s_pre_s:s_start] + s_end = s_start + while s_end < len(rhs) and rhs[s_end] not in string.whitespace: + s_end += 1 + s_str = rhs[s_start:s_end] +# print "before: s_str =", s_str +# print "befire: s_pre_str =", s_pre_str + if s_pre_str.find("$$") == 0: + # $$ something, maybe; find that something + if len(s_pre_str) == 3: +# print "looking for brackets at end" + # verify termination is a bracket type + if s_str[len(s_str)-1] in "}]": + s_str = s_str[:(len(s_str)-1)] +# print "s_str is", s_str + if len(s_str) == len(lhs): +# print "found match" + # make sure 'lhs' is already in 'raw' + orig_rhs = raw.get(lhs) + if orig_rhs is not None: + rhs = rhs[:s_pre_s] + orig_rhs +# print "new rhs is", rhs # Remove the escapes for any quotes. rhs = rhs.replace(r'\"', '"').replace(r"\'", "'") - if adding and rhs != "": orig_rhs = raw.get(lhs) if orig_rhs is not None: rhs = orig_rhs + " " + rhs +# print "new rhs is", rhs raw[lhs] = rhs +# print "added lhs = ", lhs, ", rhs = ", rhs line = f.readline() +# print "raw is", raw + # Go through the raw dictionary extracting the macros we need and # resolving any macro expansions. First of all, make sure every macro has # a value.