From: Colin Patrick McCabe Date: Mon, 24 Jan 2011 00:09:14 +0000 (-0800) Subject: Makefile: use new Spirit headers where available X-Git-Tag: v0.25~256 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ffb208e343b42078ba34a3b5e4d74eff4b8a4d71;p=ceph.git Makefile: use new Spirit headers where available Use new boost::spirit header files where available, to eliminate the annoying compiler warning on newer systems. Signed-off-by: Colin McCabe --- diff --git a/configure.ac b/configure.ac index 8dc66c09a396..4c46b28912d1 100644 --- a/configure.ac +++ b/configure.ac @@ -154,10 +154,11 @@ AC_HEADER_SYS_WAIT # 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]) diff --git a/src/Makefile.am b/src/Makefile.am index fd5c7f0d9e70..2a4629f912f4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -376,6 +376,10 @@ LDADD = 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 diff --git a/src/crush/grammar.h b/src/crush/grammar.h index 8c7a46679535..2e61750f4977 100644 --- a/src/crush/grammar.h +++ b/src/crush/grammar.h @@ -17,9 +17,16 @@ //#define BOOST_SPIRIT_DEBUG +#ifdef USE_BOOST_SPIRIT_OLD_HDR #include #include #include +#else +#define BOOST_SPIRIT_USE_OLD_NAMESPACE +#include +#include +#include +#endif using namespace boost::spirit; struct crush_grammar : public grammar