summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorBjoern A. Zeeb <baz21@cam.ac.uk>2017-02-09 19:00:00 -0500
committerBjoern A. Zeeb <baz21@cam.ac.uk>2017-02-09 19:00:00 -0500
commite07f0c50438479f9e0c17fe7ab42dbcb7df4cb9c (patch)
treeb569a0c3345d6ed266b934b1bea6f4a7935a2263 /SConstruct
parentd728f6786b26a66816f1d4ae0abdefd01e5ec3c4 (diff)
downloadgem5-e07f0c50438479f9e0c17fe7ab42dbcb7df4cb9c.tar.xz
scons: make build better on FreeBSD
Various changes we found needed to build gem5 successfully on FreeBSD. Reviewed at http://reviews.gem5.org/r/3378/ Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct20
1 files changed, 18 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 8a72419b4..e728e51fd 100755
--- a/SConstruct
+++ b/SConstruct
@@ -655,6 +655,9 @@ if main['GCC'] or main['CLANG']:
'-Wno-sign-compare', '-Wno-unused-parameter'])
# We always compile using C++11
main.Append(CXXFLAGS=['-std=c++11'])
+ if sys.platform.startswith('freebsd'):
+ main.Append(CCFLAGS=['-I/usr/local/include'])
+ main.Append(CXXFLAGS=['-I/usr/local/include'])
else:
print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
print "Don't know what compiler options to use for your compiler."
@@ -771,6 +774,10 @@ elif main['CLANG']:
main.Append(CXXFLAGS=['-stdlib=libc++'])
main.Append(LIBS=['c++'])
+ # On FreeBSD we need libthr.
+ if sys.platform.startswith('freebsd'):
+ main.Append(LIBS=['thr'])
+
else:
print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
print "Don't know what compiler options to use for your compiler."
@@ -884,8 +891,12 @@ main.Append(SWIGFLAGS=swig_flags)
# Check for 'timeout' from GNU coreutils. If present, regressions will
# be run with a time limit. We require version 8.13 since we rely on
# support for the '--foreground' option.
-timeout_lines = readCommand(['timeout', '--version'],
- exception='').splitlines()
+if sys.platform.startswith('freebsd'):
+ timeout_lines = readCommand(['gtimeout', '--version'],
+ exception='').splitlines()
+else:
+ timeout_lines = readCommand(['timeout', '--version'],
+ exception='').splitlines()
# Get the first line and tokenize it
timeout_version = timeout_lines[0].split() if timeout_lines else []
main['TIMEOUT'] = timeout_version and \
@@ -1083,6 +1094,11 @@ backtrace_impls = [ "none" ]
if conf.CheckLibWithHeader(None, 'execinfo.h', 'C',
'backtrace_symbols_fd((void*)0, 0, 0);'):
backtrace_impls.append("glibc")
+elif conf.CheckLibWithHeader('execinfo', 'execinfo.h', 'C',
+ 'backtrace_symbols_fd((void*)0, 0, 0);'):
+ # NetBSD and FreeBSD need libexecinfo.
+ backtrace_impls.append("glibc")
+ main.Append(LIBS=['execinfo'])
if backtrace_impls[-1] == "none":
default_backtrace_impl = "none"