1# If --with-libbson=auto, determine if there is a system installed libbson
2# greater than our required version.
3AS_IF([test "x${with_libbson}" = xauto],
4      [PKG_CHECK_MODULES(BSON, [libbson-1.0 >= libbson_required_version],
5                         [with_libbson=system],
6                         [with_libbson=bundled])])
7
8# If we are to use the system, check for libbson enforcing success.
9AS_IF([test "x${with_libbson}" = xsystem],
10      [PKG_CHECK_MODULES(BSON,
11                         [libbson-1.0 >= libbson_required_version],
12                         [],
13                         [AC_MSG_ERROR([
14
15  --------------------------------------
16   The libbson-1.0 library could not be
17   found on your system. Please install
18   libbson-1.0  development  package or
19   set --with-libbson=auto.
20  --------------------------------------
21])])])
22
23# If we are using the bundled libbson, recurse into its configure.
24AS_IF([test "x${with_libbson}" = xbundled],[
25   AC_CONFIG_SUBDIRS([src/libbson])
26   AC_SUBST(BSON_CFLAGS, "-I${srcdir}/src/libbson/src/bson -Isrc/libbson/src/bson")
27   AC_SUBST(BSON_LIBS, "src/libbson/libbson-1.0.la")
28])
29