Changeset View
Changeset View
Standalone View
Standalone View
ext/python/Tools/freeze/checkextensions.py
Show All 12 Lines | for e in extensions: | ||||
setup = os.path.join(e, 'Setup') | setup = os.path.join(e, 'Setup') | ||||
liba = os.path.join(e, 'lib.a') | liba = os.path.join(e, 'lib.a') | ||||
if not os.path.isfile(liba): | if not os.path.isfile(liba): | ||||
liba = None | liba = None | ||||
edict[e] = parsesetup.getsetupinfo(setup), liba | edict[e] = parsesetup.getsetupinfo(setup), liba | ||||
for mod in unknown: | for mod in unknown: | ||||
for e in extensions: | for e in extensions: | ||||
(mods, vars), liba = edict[e] | (mods, vars), liba = edict[e] | ||||
if not mods.has_key(mod): | if mod not in mods: | ||||
continue | continue | ||||
modules.append(mod) | modules.append(mod) | ||||
if liba: | if liba: | ||||
# If we find a lib.a, use it, ignore the | # If we find a lib.a, use it, ignore the | ||||
# .o files, and use *all* libraries for | # .o files, and use *all* libraries for | ||||
# *all* modules in the Setup file | # *all* modules in the Setup file | ||||
if liba in files: | if liba in files: | ||||
break | break | ||||
files.append(liba) | files.append(liba) | ||||
for m in mods.keys(): | for m in mods: | ||||
files = files + select(e, mods, vars, | files = files + select(e, mods, vars, | ||||
m, 1) | m, 1) | ||||
break | break | ||||
files = files + select(e, mods, vars, mod, 0) | files = files + select(e, mods, vars, mod, 0) | ||||
break | break | ||||
return files, modules | return files, modules | ||||
def select(e, mods, vars, mod, skipofiles): | def select(e, mods, vars, mod, skipofiles): | ||||
Show All 39 Lines | while i < len(str): | ||||
var = str[i:i+1] | var = str[i:i+1] | ||||
i = i+1 | i = i+1 | ||||
if var == '(': | if var == '(': | ||||
j = str.find(')', i) | j = str.find(')', i) | ||||
if j < 0: | if j < 0: | ||||
break | break | ||||
var = str[i:j] | var = str[i:j] | ||||
i = j+1 | i = j+1 | ||||
if vars.has_key(var): | if var in vars: | ||||
str = str[:k] + vars[var] + str[i:] | str = str[:k] + vars[var] + str[i:] | ||||
i = k | i = k | ||||
return str | return str |