print ' Installed version:', swig_version[2]
Exit(1)
-if swig_version[2] == "2.0.9":
+if swig_version[2] in ["2.0.9", "2.0.10"]:
print '\n' + termcap.Yellow + termcap.Bold + \
- 'Warning: SWIG version 2.0.9 sometimes generates broken code.\n' + \
+ 'Warning: SWIG version 2.0.9/10 sometimes generates broken code.\n' + \
termcap.Normal + \
'This problem only affects some platforms and some Python\n' + \
'versions. See the following SWIG bug report for details:\n' + \
print "Warning: Header file <fenv.h> not found."
print " This host has no IEEE FP rounding mode control."
+# Check if we should enable KVM-based hardware virtualization
+have_kvm = conf.CheckHeader('linux/kvm.h', '<>')
+if not have_kvm:
+ print "Info: Header file <linux/kvm.h> not found, " \
+ "disabling KVM support."
+
+# Check if the requested target ISA is compatible with the host
+def is_isa_kvm_compatible(isa):
+ isa_comp_table = {
+ "arm" : ( "armv7l" ),
+ }
+ try:
+ import platform
+ host_isa = platform.machine()
+ except:
+ print "Warning: Failed to determine host ISA."
+ return False
+
+ return host_isa in isa_comp_table.get(isa, [])
+
+
######################################################################
#
# Finish the configuration
BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks', have_posix_clock),
BoolVariable('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False),
+ BoolVariable('USE_KVM', 'Enable hardware virtualized (KVM) CPU models', have_kvm),
EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None',
all_protocols),
)
if env['EFENCE']:
env.Append(LIBS=['efence'])
+ if env['USE_KVM']:
+ if not have_kvm:
+ print "Warning: Can not enable KVM, host seems to lack KVM support"
+ env['USE_KVM'] = False
+ elif not is_isa_kvm_compatible(env['TARGET_ISA']):
+ print "Info: KVM support disabled due to unsupported host and " \
+ "target ISA combination"
+ env['USE_KVM'] = False
+
# Save sticky variable settings back to current variables file
sticky_vars.Save(current_vars_file, env)