aboutsummaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-12-08 15:26:14 +0000
committerlloyd <[email protected]>2009-12-08 15:26:14 +0000
commit500392029c610b48695876a54cafb5585a75befb (patch)
treeeb4b922f5d54ddb45349f74f78216f93b7c47704 /configure.py
parentd2ed3e0752b32db1377c498734c724e18af7c42b (diff)
parentf63359f348d347bebee036b11d0c9641ee3d56d6 (diff)
propagate from branch 'net.randombit.botan' (head 142a9359ba02d5dfcf3f2c9f99902f82ab41724e)
to branch 'net.randombit.botan.gost_3410' (head 064884e9c2fde8228effdd48e80fed78ff0c42cb)
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py36
1 files changed, 29 insertions, 7 deletions
diff --git a/configure.py b/configure.py
index 274620e60..1a3dfe0f7 100755
--- a/configure.py
+++ b/configure.py
@@ -316,7 +316,7 @@ def lex_me_harder(infofile, to_obj, allowed_groups, name_val_pairs):
for group in allowed_groups:
to_obj.__dict__[group] = []
- for (key,val) in name_val_pairs.iteritems():
+ for (key,val) in name_val_pairs.items():
to_obj.__dict__[key] = val
def lexed_tokens(): # Convert to an interator
@@ -381,7 +381,15 @@ class ModuleInfo(object):
and not filename.startswith('.')]
# Coerce to more useful types
- self.libs = force_to_dict(self.libs)
+ def convert_lib_list(l):
+ result = {}
+ for (targetlist, vallist) in zip(l[::3], l[2::3]):
+ vals = vallist.split(',')
+ for target in targetlist.split(','):
+ result[target] = result.setdefault(target, []) + vals
+ return result
+
+ self.libs = convert_lib_list(self.libs)
def add_dir_name(filename):
if filename.count(':') == 0:
@@ -434,6 +442,17 @@ class ModuleInfo(object):
deps.append(self.parent_module)
return deps
+ """
+ Ensure that all dependencies of this module actually exist, warning
+ about any that do not
+ """
+ def dependencies_exist(self, modules):
+ all_deps = map(lambda s: s.split('|'), self.dependencies())
+
+ for missing in filter(lambda s: s not in modules, sum(all_deps, [])):
+ logging.warn("Module '%s', dep of '%s', does not exist" % (
+ missing, self.basename))
+
def __cmp__(self, other):
if self.basename < other.basename:
return -1
@@ -665,7 +684,7 @@ class OsInfo(object):
def defines(self):
return ['TARGET_OS_IS_%s' % (self.basename.upper())] + \
['TARGET_OS_HAS_' + feat.upper()
- for feat in self.target_features]
+ for feat in sorted(self.target_features)]
def fixup_proc_name(proc):
proc = proc.lower().replace(' ', '')
@@ -739,15 +758,15 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
def link_to():
libs = set()
for module in modules:
- for (osname,link_to) in module.libs.iteritems():
+ for (osname,link_to) in module.libs.items():
if osname == 'all' or osname == osinfo.basename:
- libs.add(link_to)
+ libs |= set(link_to)
else:
match = re.match('^all!(.*)', osname)
if match is not None:
exceptions = match.group(1).split(',')
if osinfo.basename not in exceptions:
- libs.add(link_to)
+ libs |= set(link_to)
return sorted(libs)
def objectfile_list(sources, obj_dir):
@@ -913,6 +932,9 @@ Determine which modules to load based on options, target, etc
"""
def choose_modules_to_use(modules, archinfo, options):
+ for mod in modules.values():
+ mod.dependencies_exist(modules)
+
to_load = []
maybe_dep = []
not_using_because = {}
@@ -920,7 +942,7 @@ def choose_modules_to_use(modules, archinfo, options):
def cannot_use_because(mod, reason):
not_using_because.setdefault(reason, []).append(mod)
- for (modname, module) in modules.iteritems():
+ for (modname, module) in modules.items():
if modname in options.disabled_modules:
cannot_use_because(modname, 'disabled by user')
elif modname in options.enabled_modules: