jer 14/08/05 16:36:59 Added: pmacct-1.5.0_rc3-mongodb.patch Log: Add support for newer versions of dev-libs/mongo-c-driver (bug #518624). (Portage version: 2.2.11-r1/cvs/Linux x86_64, signed Manifest commit with key A792A613)
Revision Changes Path 1.1 net-analyzer/pmacct/files/pmacct-1.5.0_rc3-mongodb.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pmacct/files/pmacct-1.5.0_rc3-mongodb.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/pmacct/files/pmacct-1.5.0_rc3-mongodb.patch?rev=1.1&content-type=text/plain Index: pmacct-1.5.0_rc3-mongodb.patch =================================================================== --- a/configure.in +++ b/configure.in @@ -68,36 +68,6 @@ AC_MSG_RESULT(no) ) -dnl: shared object handling -AC_MSG_CHECKING([whether to disable shared objects]) -AC_ARG_ENABLE(so, - [ --disable-so Disable shared objects (default: no)], - if test x$enableval = x"yes" ; then - AC_MSG_RESULT(no) - AC_CHECK_FUNC(dlopen, [ USING_DLOPEN="yes" ], []) - AC_CHECK_LIB(dl, dlopen, - [ USING_DLOPEN="yes" - LIBS="${LIBS} -ldl" ], - []) - if test x"$USING_DLOPEN" != x"yes"; then - AC_MSG_ERROR(Unable to find dlopen(). Try with --disable-so) - fi - else - AC_MSG_RESULT(yes) - fi - , - AC_MSG_RESULT(no) - AC_CHECK_FUNC(dlopen, [ USING_DLOPEN="yes" ], []) - AC_CHECK_LIB(dl, dlopen, - [ USING_DLOPEN="yes" - LIBS="${LIBS} -ldl" ], - []) - if test x"$USING_DLOPEN" != x"yes"; then - AC_MSG_ERROR(Unable to find dlopen(). Try with --disable-so) - fi -) -dnl finish: shared object handling - dnl os specific flags case "$host_os" in OSF*) @@ -736,106 +706,31 @@ dnl finish: pgsql handling dnl start: mongodb handling + +AC_PROG_CC_C99 +PKG_PROG_PKG_CONFIG + AC_MSG_CHECKING(whether to enable MongoDB support) AC_ARG_ENABLE(mongodb, - [ --enable-mongodb Enable MongoDB support (default: no)], - [ case "$enableval" in - yes) + [ --enable-mongodb Enable MongoDB support (default: no)],[ AC_MSG_RESULT(yes) -dnl USING_SQL="yes" - - AC_ARG_WITH(mongodb-libs, - [ --with-mongodb-libs=DIR Search for MongoDB libs in the specified directory], - [ - AC_LINEARIZE_PATH($withval, withval=$absdir) - LIBS="${LIBS} -L$withval" - MONGODBLIB=$withval - MONGODBLIBFOUND=1 - ]) - - if test x"$MONGODBLIB" != x""; then - AC_MSG_CHECKING(your own MongoDB library) - if test -r $MONGODBLIB/libmongoc.a -o -r $MONGODBLIB/libmongoc.so; then - AC_MSG_RESULT(ok) - else - AC_MSG_RESULT(no) - AC_MSG_ERROR(ERROR: missing MongoDB library in $MONGODBLIB) - fi - fi - if test x"$MONGODBLIBFOUND" = x""; then - AC_MSG_CHECKING([default locations for libmongoc]) - if test -r /usr/lib/libmongoc.a -o -r /usr/lib/libmongoc.so; then - AC_MSG_RESULT([found in /usr/lib]) - MONGODBLIBFOUND=1 - elif test -r /usr/lib64/libmongoc.a -o -r /usr/lib64/libmongoc.so; then - LIBS="${LIBS} -L/usr/lib64" - AC_MSG_RESULT([found in /usr/lib64]) - MONGODBLIBFOUND=1 - elif test -r /usr/local/lib/libmongoc.a -o -r /usr/local/lib/libmongoc.so; then - LIBS="${LIBS} -L/usr/local/lib" - AC_MSG_RESULT([found in /usr/local/lib]) - MONGODBLIBFOUND=1 - else - AC_MSG_RESULT([not found]) - fi - fi - - if test x"$MONGODBLIBFOUND" = x""; then - AC_CHECK_LIB([mongoc], [mongo_connect], [], [AC_MSG_ERROR([ - ERROR: missing MongoDB library. Refer to: http://api.mongodb.org/c/ - ])]) - else - LIBS="${LIBS} -lmongoc" - fi - - AC_ARG_WITH(mongodb-includes, - [ --with-mongodb-includes=DIR Search for MongoDB includes in the specified directory], - [ - AC_LINEARIZE_PATH($withval, withval=$absdir) - INCLUDES="${INCLUDES} -I$withval" - MONGODBINCLUDES=$withval - MONGODBINCLUDESFOUND=1 - ]) - - if test x"$MONGODBINCLUDES" != x""; then - AC_MSG_CHECKING(your own MongoDB headers) - if test -r $MONGODBINCLUDES/mongo.h; then - AC_MSG_RESULT(ok) - else - AC_MSG_RESULT(no) - AC_MSG_ERROR(ERROR: missing MongoDB headers in $MONGODBINCLUDES) - fi - fi - - if test x"$MONGODBINCLUDESFOUND" = x""; then - AC_MSG_CHECKING([default locations for mongo.h]) - if test -r /usr/include/mongo.h; then - AC_MSG_RESULT([found in /usr/include]) - MONGODBINCLUDESFOUND=1; - elif test -r /usr/local/include/mongo.h; then - INCLUDES="${INCLUDES} -I/usr/local/include" - AC_MSG_RESULT([found in /usr/local/include]) - MONGODBINCLUDESFOUND=1; - fi - if test x"$MONGODBINCLUDESFOUND" = x""; then - AC_MSG_RESULT([not found]) - fi - fi - - if test x"$MONGODBINCLUDESFOUND" = x""; then - AC_CHECK_HEADER([mongo.h],, - [AC_MSG_ERROR(ERROR: missing MongoDB headers)]) - fi + PKG_CHECK_MODULES(mongo, libmongoc-1.0,[ + INCLUDES="$INCLUDES $mongo_CFLAGS" + LIBS="$LIBS $mongo_LIBS" + ], + AC_CHECK_HEADERS([mongo.h],[],AC_MSG_ERROR([missing MongoDB headers])) + AC_CHECK_LIB(dl, dlopen,[],AC_MSG_ERROR([Unable to find dlopen()])) + AC_CHECK_LIB([mongoc],[mongo_connect],[ + AC_DEFINE(WITH_MONGODB, 1) + PLUGINS="${PLUGINS} mongodb_plugin.c" + LIBS="$LIBS -lmongoc" + ], + AC_MSG_ERROR([ERROR: missing MongoDB library. Refer to: http://api.mongodb.org/c/]) + ) + )] +) - AC_DEFINE(WITH_MONGODB, 1) - PLUGINS="${PLUGINS} mongodb_plugin.c" - ;; - no) - AC_MSG_RESULT(no) - ;; - esac ], -AC_MSG_RESULT(no)) dnl finish: mongodb handling AC_MSG_CHECKING(whether to enable SQLite3 support)
