summaryrefslogtreecommitdiffstats
path: root/setupdwfl.h
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-09-29 17:09:20 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-09-29 17:11:24 -0400
commit469c1a1b2ef323030531b0ca05e6f9337c0bbbe6 (patch)
tree5bfe6da7e1bc6ba6675174e661884e4bc731a6c7 /setupdwfl.h
parent83b019a3a45ff764d746588eb2839baa32257ed3 (diff)
downloadsystemtap-steved-469c1a1b2ef323030531b0ca05e6f9337c0bbbe6.tar.gz
systemtap-steved-469c1a1b2ef323030531b0ca05e6f9337c0bbbe6.tar.xz
systemtap-steved-469c1a1b2ef323030531b0ca05e6f9337c0bbbe6.zip
build fix: use boost shared_ptr if libstdc++ to old to have <tr1/memory>
* configure.ac: Look for tr1/memory and boost/shared_ptr.hpp * setupdwfl.h (shared_ptr): Define conditionally based on above. * systemtap.spec (with_boost): New parameter, default-off.
Diffstat (limited to 'setupdwfl.h')
-rw-r--r--setupdwfl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/setupdwfl.h b/setupdwfl.h
index 743ce668..0c3cc63e 100644
--- a/setupdwfl.h
+++ b/setupdwfl.h
@@ -16,7 +16,15 @@
#include <string>
#include <vector>
+#if defined(HAVE_TR1_MEMORY)
#include <tr1/memory>
+using std::tr1::shared_ptr;
+#elif defined(HAVE_BOOST_SHARED_PTR_HPP)
+#include <boost/shared_ptr.hpp>
+using boost::shared_ptr;
+#else
+#error "No shared_ptr implementation found; get boost or modern g++"
+#endif
extern "C" {
#include <elfutils/libdwfl.h>
@@ -29,7 +37,7 @@ public:
~StapDwfl() { if (dwfl) dwfl_end (dwfl); }
Dwfl *dwfl;
};
-typedef std::tr1::shared_ptr<StapDwfl> DwflPtr;
+typedef shared_ptr<StapDwfl> DwflPtr;
DwflPtr setup_dwfl_kernel(const std::string &name,
unsigned *found,