summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e853b1c)
raw | patch | inline | side by side (parent: e853b1c)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 6 Nov 2010 10:53:42 +0000 (11:53 +0100) | ||
committer | Chris Lundquist <chris.lundquist@bluebox.net> | |
Tue, 24 Jan 2012 19:53:22 +0000 (11:53 -0800) |
configure.in | patch | blob | history |
diff --git a/configure.in b/configure.in
index bbdf2732cde8522a5a3203060df56dbac74f16cd..e8a6b12b2b1a66296475cc981100c34a6cd16b74 100644 (file)
--- a/configure.in
+++ b/configure.in
@@ -1242,14 +1242,6 @@ AC_CHECK_MEMBERS([kstat_io_t.nwritten, kstat_io_t.writes, kstat_io_t.nwrites, ks
# Checks for libraries begin here
#
-with_libmongoc="yes"
-AC_CHECK_LIB(mongoc, mongo_run_command,
-[
- AC_DEFINE(HAVE_LIBMONGOC, 1, [Define to 1 if you have the 'mongoc' library (-lmongoc).])
-],
-[with_libmongoc="no"])
-AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
-
with_libresolv="yes"
AC_CHECK_LIB(resolv, res_search,
[
fi
# }}}
+# --with-libmongoc {{{
+AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
+[
+ if test "x$withval" = "xyes"
+ then
+ with_libmongoc="yes"
+ else if test "x$withval" = "xno"
+ then
+ with_libmongoc="no"
+ else
+ with_libmongoc="yes"
+ LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
+ LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
+ fi; fi
+],
+[with_libmongoc="yes"])
+
+SAVE_CPPFLAGS="$CPPFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+
+CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
+LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
+
+if test "x$with_libmongoc" = "xyes"
+then
+ if test "x$LIBMONGOC_CPPFLAGS" != "x"
+ then
+ AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
+ fi
+ AC_CHECK_HEADERS(mongo.h,
+ [with_libmongoc="yes"],
+ [with_libmongoc="no ('mongo.h' not found)"],
+[#if HAVE_STDINT_H
+# define MONGO_HAVE_STDINT 1
+#else
+# define MONGO_USE_LONG_LONG_INT 1
+#endif
+])
+fi
+if test "x$with_libmongoc" = "xyes"
+then
+ if test "x$LIBMONGOC_LDFLAGS" != "x"
+ then
+ AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
+ fi
+ AC_CHECK_LIB(mongoc, mongo_run_command,
+ [with_libmongoc="yes"],
+ [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
+fi
+
+CPPFLAGS="$SAVE_CPPFLAGS"
+LDFLAGS="$SAVE_LDFLAGS"
+
+if test "x$with_libmongoc" = "xyes"
+then
+ BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
+ BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
+ AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
+ AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
+# }}}
+
# --with-libmysql {{{
with_mysql_config="mysql_config"
with_mysql_cflags=""