diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-09-29 17:09:20 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-09-29 17:11:24 -0400 |
commit | 469c1a1b2ef323030531b0ca05e6f9337c0bbbe6 (patch) | |
tree | 5bfe6da7e1bc6ba6675174e661884e4bc731a6c7 /setupdwfl.h | |
parent | 83b019a3a45ff764d746588eb2839baa32257ed3 (diff) | |
download | systemtap-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.h | 10 |
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, |