aboutsummaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-26 00:23:13 +0000
committerlloyd <[email protected]>2014-01-26 00:23:13 +0000
commit4f8afd8dc67b0f34d93a105df078644f1c762878 (patch)
tree5bdcbe7a1bda6797d5b45a445bc992f657356e93 /configure.py
parentf5bd8adc44701a37204a6748089c2ee11a5a781d (diff)
If the build compiler doesn't support intrinsics we need, disable the module
rather than causing the whole build to fail. Also mark MSVC as supporting intrinsics (except AVX2 which seemingly is not yet supported). Github issue 7.
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/configure.py b/configure.py
index f3125d77e..4b350742e 100755
--- a/configure.py
+++ b/configure.py
@@ -676,8 +676,15 @@ class ModuleInfo(object):
def compatible_os(self, os):
return self.os == [] or os in self.os
- def compatible_compiler(self, cc):
- return self.cc == [] or cc in self.cc
+ def compatible_compiler(self, ccinfo, cc):
+ if self.cc != [] and cc not in self.cc:
+ return False
+
+ for isa in self.need_isa:
+ if isa not in ccinfo.isa_flags:
+ return False
+
+ return True
def dependencies(self):
# utils is an implicit dep (contains types, etc)
@@ -1328,7 +1335,7 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
"""
Determine which modules to load based on options, target, etc
"""
-def choose_modules_to_use(modules, archinfo, options):
+def choose_modules_to_use(modules, archinfo, ccinfo, options):
for mod in modules.values():
mod.dependencies_exist(modules)
@@ -1356,7 +1363,7 @@ def choose_modules_to_use(modules, archinfo, options):
elif not module.compatible_os(options.os):
cannot_use_because(modname, 'incompatible OS')
- elif not module.compatible_compiler(options.compiler):
+ elif not module.compatible_compiler(ccinfo, options.compiler):
cannot_use_because(modname, 'incompatible compiler')
elif not module.compatible_cpu(archinfo, options):
cannot_use_because(modname, 'incompatible CPU')
@@ -1916,7 +1923,10 @@ def main(argv = None):
logging.info('Disabling assembly code, cannot use in amalgamation')
options.asm_ok = False
- loaded_mods = choose_modules_to_use(modules, archinfo[options.arch], options)
+ loaded_mods = choose_modules_to_use(modules,
+ archinfo[options.arch],
+ cc,
+ options)
if not osinfo[options.os].build_shared:
if options.build_shared_lib: