[PATCH] build: check for mongodb headers

Mark McLoughlin markmc at redhat.com
Wed Apr 27 17:23:07 UTC 2011


On my Fedora 14 system, without mongodb-devel I was seeing:

      CXX    meta.o
    meta.cpp:34:35: fatal error: mongo/client/dbclient.h: No such file or directory
    compilation terminated.

The header is C++ so we need AC_LANGUAGE_PUSH and, similar to meta.cpp,
we need to undefine VERSION before including the header.

Note, the AC_CHECK_LIB approach doesn't seem sufficient because the
mongodb package in Fedora doesn't ship versioned shared libraries with an
unversioned symlink in the -devel package.

With the new check, we fail with:

  checking for mongo/client/dbclient.h... no
  configure: error: Missing Mongo DB client development library: mongodb-devel
---
 configure.ac |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 103c18a..81ecf76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,15 @@ gl_LIBXML2([2.6.0])
 AC_CHECK_HEADER([gc.h], ,
   [AC_MSG_ERROR([Missing GC development library: gc-devel or libgc-dev])])
 
+AC_LANG_PUSH([C++])
+AC_CHECK_HEADER([mongo/client/dbclient.h], ,
+  [AC_MSG_ERROR([Missing Mongo DB client development library: mongodb-devel])],
+  [#ifdef VERSION
+#undef VERSION
+#endif
+])
+AC_LANG_POP
+
 # from http://www.gnu.org/software/autoconf-archive/
 AX_BOOST_BASE
 AX_BOOST_SYSTEM
-- 
1.7.4.4



More information about the iwhd-devel mailing list