diff options
author | David Tardon <dtardon@redhat.com> | 2016-02-21 10:17:25 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-02-21 15:39:28 +0100 |
commit | ab5ca68deb6404d20d932d25d8f34c0201ae2668 (patch) | |
tree | ce56f59bfc0bf4b709d295df1bdcb000c6353af2 | |
parent | 8f4eec7dae72af1b98c596c58ae480ad955e99d3 (diff) |
make boost dep unconditional
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | configure.ac | 71 | ||||
-rw-r--r-- | src/lib/WinText602Parser.h | 4 | ||||
-rw-r--r-- | src/lib/libsw602_utils.h | 11 |
4 files changed, 14 insertions, 74 deletions
@@ -1,7 +1,7 @@ libsw602 is a library and a set of tools for reading and converting Software602 documents. -libsw602 requires librevenge to build. +libsw602 requires boost and librevenge to build. For convenience of use in third-party projects the library is available under two licenses: GNU Lesser GPL 2.1+ and MPL 2.0+. diff --git a/configure.ac b/configure.ac index 01c58fb..826a9ca 100644 --- a/configure.ac +++ b/configure.ac @@ -47,70 +47,17 @@ PKG_CHECK_MODULES([REVENGE],[ AC_SUBST(REVENGE_CFLAGS) AC_SUBST(REVENGE_LIBS) -# ======== -# shared_ptr implementation -# ======== -AC_ARG_WITH(sharedptr, - [AS_HELP_STRING([--with-sharedptr=boost|c++11|tr1], - [Use Boost|std::memory|std::tr1::memory for shared ptr implementation])], - [with_sharedptr="$withval"], - [with_sharedptr=boost] -) -AS_CASE([$with_sharedptr], - [boost|c++11|tr1], [], - [AC_MSG_ERROR([Unknown value of shared_ptr provider: $with_sharedptr])] +# ================== +# Find boost headers +# ================== +AC_CHECK_HEADERS( + boost/shared_ptr.hpp \ + , + [], + [AC_MSG_ERROR([Requires boost headers not found.])], + [] ) -AS_IF([test "x$with_sharedptr" = "xc++11"], [ - AC_MSG_CHECKING([for c++11 shared ptr]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM( - [[#include <memory>]], - [[std::shared_ptr<int> p;]] - ) - ], [ - AC_MSG_RESULT([yes]) - AC_DEFINE([SHAREDPTR_STD],[1],[Use C++11 implementation of shared_ptr]) - ], [ - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find C++11 implementation of shared_ptr]) - ], [ - [#include <memory>] - ]) -]) -AS_IF([test "x$with_sharedptr" = "xtr1"], [ - AC_MSG_CHECKING([for tr1 shared ptr]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM( - [[#include <tr1/memory>]], - [[std::tr1::shared_ptr<int> p;]] - ) - ], [ - AC_MSG_RESULT([yes]) - AC_DEFINE([SHAREDPTR_TR1],[1],[Use TR1 implementation of shared_ptr]) - ], [ - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find TR1 implementation of shared_ptr]) - ], [ - [#include <tr1/memory>] - ]) -]) -AS_IF([test "x$with_sharedptr" = "xboost"], [ - AC_MSG_CHECKING([for boost shared ptr]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM( - [[#include <boost/shared_ptr.hpp>]], - [[boost::shared_ptr<int> p;]] - ) - ], [ - AC_MSG_RESULT([yes]) - AC_DEFINE([SHAREDPTR_BOOST],[1],[Use Boost implementation of shared_ptr]) - ], [ - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find Boost implementation of shared_ptr]) - ]) -]) - # ================================= # Libtool/Version Makefile settings # ================================= diff --git a/src/lib/WinText602Parser.h b/src/lib/WinText602Parser.h index 74e0447..ef77702 100644 --- a/src/lib/WinText602Parser.h +++ b/src/lib/WinText602Parser.h @@ -10,6 +10,8 @@ #ifndef INCLUDED_WINTEXT602PARSER_H #define INCLUDED_WINTEXT602PARSER_H +#include <boost/shared_ptr.hpp> + #include <librevenge/librevenge.h> #include "libsw602_utils.h" @@ -82,7 +84,7 @@ private: librevenge::RVNGInputStream *m_input; librevenge::RVNGTextInterface *m_document; - shared_ptr<WinText602SectionMap> m_sectionMap; + boost::shared_ptr<WinText602SectionMap> m_sectionMap; }; } // namespace libsw602 diff --git a/src/lib/libsw602_utils.h b/src/lib/libsw602_utils.h index f97db9c..1decfac 100644 --- a/src/lib/libsw602_utils.h +++ b/src/lib/libsw602_utils.h @@ -51,16 +51,7 @@ typedef __int64 int64_t; #endif -#if defined(SHAREDPTR_TR1) -#include <tr1/memory> -using std::tr1::shared_ptr; -#elif defined(SHAREDPTR_STD) -#include <memory> -using std::shared_ptr; -#else #include <boost/shared_ptr.hpp> -using boost::shared_ptr; -#endif /** an noop deleter used to transform a librevenge pointer in a false shared_ptr */ template <class T> @@ -69,7 +60,7 @@ struct SW602_shared_ptr_noop_deleter void operator()(T *) {} }; -typedef shared_ptr<librevenge::RVNGInputStream> RVNGInputStreamPtr; +typedef boost::shared_ptr<librevenge::RVNGInputStream> RVNGInputStreamPtr; // debug message includes source file and line number //#define VERBOSE_DEBUG 1 |