# spirit?
AC_LANG([C++])
-AC_DEFINE([HAVE_BOOST_SPIRIT_CORE_HPP], [], [Description])
-AC_CHECK_HEADER([boost/spirit.hpp],
- [AC_DEFINE([HAVE_BOOST_SPIRIT_CORE_HPP])],
- [AC_MSG_ERROR([Sorry you need to install the Boost spirit parser library (libboost-dev on debian)])])
+
+AC_CHECK_HEADER([boost/spirit/include/classic_core.hpp], [],
+ [AC_CHECK_HEADER([boost/spirit.hpp], [use_bspirit_old_hdr=yes],
+ AC_MSG_FAILURE(["Can't find boost spirit headers"]))])
+AM_CONDITIONAL(USE_BOOST_SPIRIT_OLD_HDR, [test "$use_bspirit_old_hdr" = "yes"])
AC_LANG([C])
AM_CXXFLAGS = -Wall -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -rdynamic
+if USE_BOOST_SPIRIT_OLD_HDR
+AM_CXXFLAGS += -DUSE_BOOST_SPIRIT_OLD_HDR
+endif
+
AM_CFLAGS = -Wall -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -rdynamic
AM_LDFLAGS = -Wl,--as-needed
//#define BOOST_SPIRIT_DEBUG
+#ifdef USE_BOOST_SPIRIT_OLD_HDR
#include <boost/spirit/core.hpp>
#include <boost/spirit/tree/ast.hpp>
#include <boost/spirit/tree/tree_to_xml.hpp>
+#else
+#define BOOST_SPIRIT_USE_OLD_NAMESPACE
+#include <boost/spirit/include/classic_core.hpp>
+#include <boost/spirit/include/classic_ast.hpp>
+#include <boost/spirit/include/classic_tree_to_xml.hpp>
+#endif
using namespace boost::spirit;
struct crush_grammar : public grammar<crush_grammar>