summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-06-03 07:23:05 -0700
committerGabe Black <gabeblack@google.com>2017-06-03 15:24:02 +0000
commitc58537ca206f2fb3829050a4a0e342edef0bd64b (patch)
treeb0813e58558ed89290b11cf9aa4561f19e0ffddc /SConstruct
parent2ce045341b73166cad2ef95b37c87d8d4c590d80 (diff)
downloadgem5-c58537ca206f2fb3829050a4a0e342edef0bd64b.tar.xz
dev: Add a version of EtherTap which uses the tap driver.
The object is called EtherTap (as opposed to EtherTapStub, what the former EtherTap was renamed to), and its existance is gated on the linux/if_tun.h header file existing. That's probably overly strict, but it will hopefully be minimally likely to break the build for other systems. Change-Id: Ie03507fadf0d843a4d4d52f283c44a416c6f2a74 Reviewed-on: https://gem5-review.googlesource.com/3646 Reviewed-by: Nathan Binkert <nate@binkert.org> Maintainer: Nathan Binkert <nate@binkert.org>
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct13
1 files changed, 13 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 65179f10a..ef7af0f26 100755
--- a/SConstruct
+++ b/SConstruct
@@ -1101,6 +1101,11 @@ if not have_kvm:
print "Info: Compatible header file <linux/kvm.h> not found, " \
"disabling KVM support."
+# Check if the TUN/TAP driver is available.
+have_tuntap = conf.CheckHeader('linux/if_tun.h', '<>')
+if not have_tuntap:
+ print "Info: Compatible header file <linux/if_tun.h> not found."
+
# x86 needs support for xsave. We test for the structure here since we
# won't be able to run new tests by the time we know which ISA we're
# targeting.
@@ -1233,6 +1238,9 @@ sticky_vars.AddVariables(
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),
+ BoolVariable('USE_TUNTAP',
+ 'Enable using a tap device to bridge to the host network',
+ have_tuntap),
BoolVariable('BUILD_GPU', 'Build the compute-GPU model', False),
EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None',
all_protocols),
@@ -1477,6 +1485,11 @@ for variant_path in variant_paths:
"target ISA combination"
env['USE_KVM'] = False
+ if env['USE_TUNTAP']:
+ if not have_tuntap:
+ print "Warning: Can't connect EtherTap with a tap device."
+ env['USE_TUNTAP'] = False
+
if env['BUILD_GPU']:
env.Append(CPPDEFINES=['BUILD_GPU'])