summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/stacktrace/build
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/stacktrace/build')
-rw-r--r--src/boost/libs/stacktrace/build/Jamfile.v2145
-rw-r--r--src/boost/libs/stacktrace/build/has_addr2line.cpp25
-rw-r--r--src/boost/libs/stacktrace/build/has_backtrace.cpp15
-rw-r--r--src/boost/libs/stacktrace/build/has_windbg.cpp13
-rw-r--r--src/boost/libs/stacktrace/build/has_windbg_cached.cpp28
5 files changed, 226 insertions, 0 deletions
diff --git a/src/boost/libs/stacktrace/build/Jamfile.v2 b/src/boost/libs/stacktrace/build/Jamfile.v2
new file mode 100644
index 00000000..6d6d85a9
--- /dev/null
+++ b/src/boost/libs/stacktrace/build/Jamfile.v2
@@ -0,0 +1,145 @@
+# Copyright (C) 2016-2019, Antony Polukhin.
+#
+# Use, modification and distribution is subject to the Boost Software License,
+# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+#
+
+project
+ : source-location .
+ : requirements
+ <visibility>hidden
+ ;
+
+lib dl ;
+lib gcc_s ;
+lib Dbgeng ;
+lib ole32 ;
+
+
+local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ;
+lib backtrace
+ :
+ : <search>$(LIBBACKTRACE_PATH)/lib <link>static
+ :
+ : <include>$(LIBBACKTRACE_PATH)/include
+ ;
+
+actions mp_simple_run_action
+{
+ $(>) > $(<)
+}
+
+rule mp-run-simple ( sources + : args * : input-files * : requirements * : target-name )
+{
+ exe $(target-name)_exe : $(sources) : $(requirements) ;
+ explicit $(target-name)_exe ;
+ make $(target-name).output : $(target-name)_exe : @mp_simple_run_action ;
+ explicit $(target-name).output ;
+ alias $(target-name) : $(target-name).output ;
+}
+
+mp-run-simple has_backtrace.cpp : : : <library>backtrace : libbacktrace ;
+explicit libbacktrace ;
+
+mp-run-simple has_addr2line.cpp : : : : addr2line ;
+explicit addr2line ;
+
+mp-run-simple has_windbg.cpp : : : <library>Dbgeng <library>ole32 : WinDbg ;
+explicit WinDbg ;
+
+mp-run-simple has_windbg_cached.cpp : : : <library>Dbgeng <library>ole32 : WinDbgCached ;
+explicit WinDbgCached ;
+
+local libraries ;
+
+lib boost_stacktrace_noop
+ : # sources
+ ../src/noop.cpp
+ : # requirements
+ <warnings>all
+ <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ : # default build
+ : # usage-requirements
+ #<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ ;
+
+libraries += boost_stacktrace_noop ;
+
+lib boost_stacktrace_backtrace
+ : # sources
+ ../src/backtrace.cpp
+ : # requirements
+ <warnings>all
+ <target-os>linux:<library>dl
+ <library>backtrace
+ <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ [ check-target-builds ../build//libbacktrace : : <build>no ]
+ : # default build
+ : # usage-requirements
+ #<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ ;
+
+libraries += boost_stacktrace_backtrace ;
+
+lib boost_stacktrace_addr2line
+ : # sources
+ ../src/addr2line.cpp
+ : # requirements
+ <warnings>all
+ <target-os>linux:<library>dl
+ <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ [ check-target-builds ../build//addr2line : : <build>no ]
+ : # default build
+ : # usage-requirements
+ #<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ ;
+
+libraries += boost_stacktrace_addr2line ;
+
+lib boost_stacktrace_basic
+ : # sources
+ ../src/basic.cpp
+ : # requirements
+ <warnings>all
+ <target-os>linux:<library>dl
+ <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ [ check-target-builds ../build//WinDbg : <build>no ]
+ : # default build
+ : # usage-requirements
+ #<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ ;
+
+libraries += boost_stacktrace_basic ;
+
+lib boost_stacktrace_windbg
+ : # sources
+ ../src/windbg.cpp
+ : # requirements
+ <warnings>all
+ <library>Dbgeng <library>ole32
+ <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ [ check-target-builds ../build//WinDbg : : <build>no ]
+ : # default build
+ : # usage-requirements
+ #<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ ;
+
+libraries += boost_stacktrace_windbg ;
+
+lib boost_stacktrace_windbg_cached
+ : # sources
+ ../src/windbg_cached.cpp
+ : # requirements
+ <warnings>all
+ <library>Dbgeng <library>ole32
+ <link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ [ check-target-builds ../build//WinDbgCached : : <build>no ]
+ : # default build
+ : # usage-requirements
+ #<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
+ ;
+
+libraries += boost_stacktrace_windbg_cached ;
+
+boost-install $(libraries) ;
diff --git a/src/boost/libs/stacktrace/build/has_addr2line.cpp b/src/boost/libs/stacktrace/build/has_addr2line.cpp
new file mode 100644
index 00000000..8a8c0f76
--- /dev/null
+++ b/src/boost/libs/stacktrace/build/has_addr2line.cpp
@@ -0,0 +1,25 @@
+// Copyright Antony Polukhin, 2016-2019.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <cstdlib>
+#include <string>
+
+#include <boost/config.hpp>
+#include <unwind.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+int main() {
+
+#ifdef BOOST_STACKTRACE_ADDR2LINE_LOCATION
+ std::string s = BOOST_STRINGIZE( BOOST_STACKTRACE_ADDR2LINE_LOCATION );
+ s += " -h";
+#else
+ std::string s = "/usr/bin/addr2line -h";
+#endif
+
+ return std::system(s.c_str());
+}
diff --git a/src/boost/libs/stacktrace/build/has_backtrace.cpp b/src/boost/libs/stacktrace/build/has_backtrace.cpp
new file mode 100644
index 00000000..9a99074c
--- /dev/null
+++ b/src/boost/libs/stacktrace/build/has_backtrace.cpp
@@ -0,0 +1,15 @@
+// Copyright Antony Polukhin, 2016-2019.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <backtrace.h>
+#include <unwind.h>
+
+int main() {
+ backtrace_state* state = backtrace_create_state(
+ 0, 1, 0, 0
+ );
+ (void)state;
+}
diff --git a/src/boost/libs/stacktrace/build/has_windbg.cpp b/src/boost/libs/stacktrace/build/has_windbg.cpp
new file mode 100644
index 00000000..17408be2
--- /dev/null
+++ b/src/boost/libs/stacktrace/build/has_windbg.cpp
@@ -0,0 +1,13 @@
+// Copyright Antony Polukhin, 2016-2019.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <cstring>
+#include <windows.h>
+#include "dbgeng.h"
+
+int main() {
+ ::CoInitializeEx(0, COINIT_MULTITHREADED);
+}
diff --git a/src/boost/libs/stacktrace/build/has_windbg_cached.cpp b/src/boost/libs/stacktrace/build/has_windbg_cached.cpp
new file mode 100644
index 00000000..71a6ab57
--- /dev/null
+++ b/src/boost/libs/stacktrace/build/has_windbg_cached.cpp
@@ -0,0 +1,28 @@
+// Copyright Antony Polukhin, 2016-2019.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/config.hpp>
+
+#include <string>
+#include <cstring>
+#include <windows.h>
+#include "dbgeng.h"
+
+#ifdef BOOST_NO_CXX11_THREAD_LOCAL
+# error Your compiler does not support C++11 thread_local storage. It`s impossible to build with BOOST_STACKTRACE_USE_WINDBG_CACHED.
+#endif
+
+int foo() {
+ static thread_local std::string i = std::string();
+
+ return static_cast<int>(i.size());
+}
+
+int main() {
+ ::CoInitializeEx(0, COINIT_MULTITHREADED);
+
+ return foo();
+}