summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2012-05-24 09:41:37 -0400
committerEric Milkie <milkie@10gen.com>2012-05-24 09:41:37 -0400
commite6f9efc3c372f5bc8871df838c6e891117655a88 (patch)
tree8bf1e909f7d20ce2c33ef2bc3adc08bea60d81ef /SConstruct
parent220150db81ea754fc94cc402d957626a7961278e (diff)
downloadmongo-e6f9efc3c372f5bc8871df838c6e891117655a88.tar.gz
SERVER-5852 use libunwind routines for backtrace on freebsd
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct11
1 files changed, 8 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index b349f4e4166..4c8f52889b7 100644
--- a/SConstruct
+++ b/SConstruct
@@ -789,7 +789,10 @@ def doConfigure(myenv):
if solaris or conf.CheckDeclaration('clock_gettime', includes='#include <time.h>'):
conf.CheckLib('rt')
- if (conf.CheckCXXHeader( "execinfo.h" ) and
+ if freebsd and conf.CheckCXXHeader( "unwind.h" ):
+ myenv.Append( CPPDEFINES=[ "MONGO_HAVE_UNWIND_BACKTRACE" ] )
+
+ elif (conf.CheckCXXHeader( "execinfo.h" ) and
conf.CheckDeclaration('backtrace', includes='#include <execinfo.h>') and
conf.CheckDeclaration('backtrace_symbols', includes='#include <execinfo.h>')):
@@ -808,9 +811,11 @@ def doConfigure(myenv):
if not conf.CheckLib( v8_lib_choices ):
Exit(1)
- # requires ports devel/libexecinfo to be installed
+ # requires ports devel/libexecinfo or devel/libunwind to be installed
if freebsd or openbsd:
- if not conf.CheckLib("execinfo"):
+ # CheckLib actually sets the -l argument, so check in the
+ # order of precedence.
+ if not (conf.CheckLib("unwind") or conf.CheckLib("execinfo")):
Exit(1)
# 'tcmalloc' needs to be the last library linked. Please, add new libraries before this