]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Makefile: use new Spirit headers where available
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 24 Jan 2011 00:09:14 +0000 (16:09 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 24 Jan 2011 15:44:48 +0000 (07:44 -0800)
Use new boost::spirit header files where available, to eliminate the
annoying compiler warning on newer systems.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
configure.ac
src/Makefile.am
src/crush/grammar.h

index 8dc66c09a396c7c8e5821719d75d5027c3ec752e..4c46b28912d13e3ab5816316c6918cd85eac09e7 100644 (file)
@@ -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])
 
index fd5c7f0d9e70951c7c48bed4d5cd01ce4c724407..2a4629f912f479904e8b22547963c9513f5d5ea8 100644 (file)
@@ -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
 
index 8c7a46679535bec77c27961aa249c3c2c417b8eb..2e61750f497709bb92ab4fac23b9b7dd36d68c70 100644 (file)
 
 //#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>