Skip to content

Instantly share code, notes, and snippets.

@jbergstroem
Last active August 29, 2015 14:22
Show Gist options
  • Save jbergstroem/f25202f6f2178dd42304 to your computer and use it in GitHub Desktop.
Save jbergstroem/f25202f6f2178dd42304 to your computer and use it in GitHub Desktop.
libmongoc-1.0 support in collectd
--- configure.ac 2015-05-27 17:51:35.609705819 +1000
+++ configure.ac.new 2015-06-10 13:20:30.417584160 +1000
@@ -2546,9 +2546,15 @@
[
if test "x$withval" = "xyes"
then
- with_libmongoc="yes"
+ with_libmongoc="yes"
+ if test "x$PKG_CONFIG" != "x"
+ then
+ LIBMONGOC_CPPFLAGS="`$PKG_CONFIG --cflags libmongoc-1.0`"
+ LIBMONGOC_LDFLAGS="`$PKG_CONFIG --libs libmongoc-1.0`"
+ fi
else if test "x$withval" = "xno"
then
with_libmongoc="no"
else
with_libmongoc="yes"
@@ -2569,9 +2575,9 @@
then
AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
fi
- AC_CHECK_HEADERS(mongo.h,
+ AC_CHECK_HEADERS(mongoc.h,
[with_libmongoc="yes"],
- [with_libmongoc="no ('mongo.h' not found)"],
+ [with_libmongoc="no ('mongoc.h' not found)"],
[#if HAVE_STDINT_H
# define MONGO_HAVE_STDINT 1
#else
@@ -2585,9 +2591,10 @@
then
AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
fi
- AC_CHECK_LIB(mongoc, mongo_run_command,
+ AC_CHECK_LIB(mongoc-1.0, mongoc_init,
[with_libmongoc="yes"],
- [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
+ [with_libmongoc="no (symbol 'mongoc_init' not found)"],
+ [$with_mongoc_libs])
fi
CPPFLAGS="$SAVE_CPPFLAGS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment