Skip to content

PHPC-1496: Add support for compiling with libmongocrypt #1065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
url = https://github.com/mongodb/mongo-c-driver.git
branch = 1.2.0-dev
ignore = untracked
[submodule "src/libmongocrypt"]
path = src/libmongocrypt
url = git://github.com/mongodb/libmongocrypt.git
40 changes: 28 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,24 @@ If something goes awry in the test VM, you can reload it by running:
make test-bootstrap
```

## Updating libmongoc and libbson
## Updating libmongoc, libbson, and libmongocrypt

The PHP driver can use either system libraries or bundled versions of libmongoc
and libbson. If a new version of libmongoc is available, the submodule and build
configuration will need to be updated to reflect the new sources and/or package
version.
The PHP driver can use either system libraries or bundled versions of
libmongoc, libbson, and libmongocrypt. If a new version of either library is
available, the submodule and build configuration will need to be updated to
reflect the new sources and/or package version.

### Update libmongoc to the latest version
### Updating libmongoc and libbson

#### Update libmongoc to the latest version

```
$ cd src/libmongoc
$ git fetch
$ git checkout 1.15.0
```

### Ensure libmongoc version information is correct
#### Ensure libmongoc version information is correct

The build process for Autotools and Windows rely on
`src/LIBMONGOC_VERSION_CURRENT` to infer version information for libmongoc and
Expand All @@ -200,7 +202,7 @@ $ make libmongoc-version-current
Alternatively, the `build/calc_release_version.py` script in libmongoc can be
executed directly.

### Update sources in build configurations
#### Update sources in build configurations

The Autotools and Windows build configurations (`config.m4` and `config.w32`,
respectively) define several variables (e.g. `PHP_MONGODB_MONGOC_SOURCES`) that
Expand All @@ -212,7 +214,7 @@ should be run to regenerate that particular list of source files. In the event
that either libmongoc or libbson introduce a new source directory, that will
need to be manually added (follow prior art).

### Update package dependencies
#### Update package dependencies

The Autotools configuration additionally includes some `pkg-config` commands for
using libmongoc and libbson as system libraries (in lieu of a bundled build).
Expand All @@ -229,7 +231,7 @@ if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.15.0; then
AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.15.0)
```

### Update tested versions in evergreen configuration
#### Update tested versions in evergreen configuration

Evergreen tests against multiple versions of libmongoc. When updating to a newer
libmongoc version, make sure to update the `libmongoc-version` build axis in
Expand All @@ -239,13 +241,13 @@ libmongoc:
`r1.x` branch)
- The upcoming minor release of libmongoc (e.g. the `master` branch)

### Update sources in PECL package generation script
#### Update sources in PECL package generation script

If either libmongoc or libbson introduce a new source directory, that may also
require updating the glob patterns in the `bin/prep-release.php` script to
ensure new source files will be included in any generated PECL package.

### Test and commit your changes
#### Test and commit your changes

Verify that the upgrade was successful by ensuring that the driver can compile
using both the bundled sources and system libraries for libmongoc and libbson,
Expand All @@ -256,6 +258,20 @@ of the above files/paths. For example:
$ git commit -m "Bump libmongoc to 1.15.0" config.m4 config.w32 src/libmongoc src/LIBMONGOC_VERSION_CURRENT
```

### Updating libmongocrypt

To update libmongocrypt, the steps are similar to the above:

```
$ cd src/libmongocrypt
$ git fetch
$ git checkout 1.0.1
$ make libmongocrypt-version-current
```

Package dependencies in `config.m4` must also be updated, as do the sources in
the PECL generation script.

## Releasing

The follow steps outline the release process for a maintenance branch (e.g.
Expand Down
3 changes: 3 additions & 0 deletions Makefile.frag
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ package.xml:

libmongoc-version-current:
cd src/libmongoc/ && python build/calc_release_version.py > ../LIBMONGOC_VERSION_CURRENT

libmongocrypt-version-current:
cd src/libmongocrypt/ && cmake -P ./cmake/GetVersion.cmake 2> ../LIBMONGOCRYPT_VERSION_CURRENT
10 changes: 10 additions & 0 deletions bin/prep-release.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function get_files() {

"src/*.{c,h}",
"src/LIBMONGOC_VERSION_CURRENT",
"src/LIBMONGOCRYPT_VERSION_CURRENT",

"src/MongoDB/*.{c,h}",
"src/MongoDB/Exception/*.{c,h}",
Expand All @@ -54,6 +55,15 @@ function get_files() {
"src/libmongoc/src/libmongoc/src/mongoc/*.{c,def,defs,h,h.in}",
"src/libmongoc/src/zlib-1.2.11/*.{c,h,h.in}",
"src/libmongoc/VERSION*",

"src/libmongocrypt-compat/*.{c,h}",
"src/libmongocrypt-compat/mongocrypt/*.{c,h}",
"src/libmongocrypt/src/*.{c,h}",
"src/libmongocrypt/src/crypto/*.{c,h}",
"src/libmongocrypt/src/os_posix/*.{c,h}",
"src/libmongocrypt/src/os_win/*.{c,h}",
"src/libmongocrypt/kms-message/src/*.{c,h}",
"src/libmongocrypt/kms-message/src/message/*.{c,h}",
),
'test' => array(
"Vagrantfile",
Expand Down
92 changes: 89 additions & 3 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ if test "$PHP_MONGODB" != "no"; then
[MongoDB: Use system libmongoc [default=no]])],
[no],
[no])
PHP_ARG_WITH([mongodb-client-side-encryption],
[whether to enable client-side encryption],
[AS_HELP_STRING([--with-mongodb-client-side-encryption=@<:@auto/yes/no@:>@],
[MongoDB: Enable client-side encryption [default=auto]])],
[auto],
[no])

if test "$PHP_LIBBSON" != "no"; then
if test "$PHP_LIBMONGOC" = "no"; then
Expand Down Expand Up @@ -230,8 +236,38 @@ if test "$PHP_MONGODB" != "no"; then
AC_DEFINE(HAVE_SYSTEM_LIBMONGOC, 1, [Use system libmongoc])
fi

if test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" != "no" -a "$PHP_LIBBSON" = "yes"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_MSG_CHECKING(for libmongocrypt)

if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libmongocrypt-1.0; then
if $PKG_CONFIG libmongocrypt-1.0 --atleast-version 1.0.1; then
PHP_MONGODB_MONGOCRYPT_CFLAGS=`$PKG_CONFIG libmongocrypt-1.0 --cflags`
PHP_MONGODB_MONGOCRYPT_LIBS=`$PKG_CONFIG libmongocrypt-1.0 --libs`
PHP_MONGODB_MONGOCRYPT_VERSION=`$PKG_CONFIG libmongocrypt-1.0 --modversion`
AC_MSG_RESULT(version $PHP_MONGODB_MONGOCRYPT_VERSION found)

PHP_MONGODB_CFLAGS="$PHP_MONGODB_CFLAGS $PHP_MONGODB_MONGOCRYPT_CFLAGS"
PHP_EVAL_LIBLINE($PHP_MONGODB_MONGOCRYPT_LIBS, MONGODB_SHARED_LIBADD)
AC_DEFINE(HAVE_SYSTEM_LIBMONGOCRYPT, 1, [Use system libmongocrypt])
elif test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" = "yes"; then
AC_MSG_ERROR(system libmongocrypt must be upgraded to version >= 1.0.1)
else
AC_MSG_RESULT(found an older version, compiling without client-side encryption)
fi
else
if test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" = "yes"; then
AC_MSG_ERROR(pkgconfig and libmongocrypt must be installed)
else
AC_MSG_RESULT(not found, compiling without client-side encryption)
fi
fi
fi

if test "$PHP_LIBBSON" = "no" -a "$PHP_LIBMONGOC" = "no"; then
PHP_MONGODB_BUNDLED_CFLAGS="$STD_CFLAGS -DBSON_COMPILATION -DMONGOC_COMPILATION"
dnl TODO: MONGOCRYPT-219 makes the -std argument obsolete
PHP_MONGODB_LIBMONGOCRYPT_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS -std=gnu99"

dnl M4 doesn't know if we're building statically or as a shared module, so
dnl attempt to include both paths while ignoring errors. If neither path
Expand Down Expand Up @@ -273,6 +309,11 @@ if test "$PHP_MONGODB" != "no"; then
_include([scripts/autotools/libmongoc/Versions.m4])
_include([scripts/autotools/libmongoc/WeakSymbols.m4])

dnl This include modifies the value of $PHP_MONGODB_CLIENT_SIDE_ENCRYPTION to "yes"
dnl or "no" depending on whether dependencies for libmongocrypt are fulfilled
_include([scripts/autotools/libmongocrypt/CheckSSL.m4])
_include([scripts/autotools/libmongocrypt/Version.m4])

m4_popdef([_include])

AC_SUBST(BSON_EXTRA_ALIGN, 0)
Expand All @@ -283,16 +324,19 @@ if test "$PHP_MONGODB" != "no"; then
AC_SUBST(MONGOC_ENABLE_SHM_COUNTERS, 0)
AC_SUBST(MONGOC_TRACE, 1)

dnl TODO: Replace with detection for libmongocrypt for PHPC-1293
AC_SUBST(MONGOC_ENABLE_CLIENT_SIDE_ENCRYPTION, 0)

dnl Assignments for metadata handshake. Leave CFLAGS/LDFLAGS empty as they
dnl would likely cause platform info (PHP version) to be truncated. We can
dnl consider restoring CFLAGS/LDFLAGS once CDRIVER-3134 is resolved.
AC_SUBST(MONGOC_CC, [$CC])
AC_SUBST(MONGOC_USER_SET_CFLAGS, [])
AC_SUBST(MONGOC_USER_SET_LDFLAGS, [])

if test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" = "yes"; then
AC_SUBST(MONGOC_ENABLE_CLIENT_SIDE_ENCRYPTION, 1)
else
AC_SUBST(MONGOC_ENABLE_CLIENT_SIDE_ENCRYPTION, 0)
fi

dnl On MacOS, use gcut from the coreutils brew package instead of cut
dnl Generated with: find src/libmongoc/src/common -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
PHP_MONGODB_COMMON_SOURCES="common-b64.c common-md5.c"
Expand Down Expand Up @@ -342,6 +386,46 @@ if test "$PHP_MONGODB" != "no"; then
PHP_MONGODB_ADD_BUILD_DIR([src/libmongoc/src/zlib-1.2.11/])
AC_CONFIG_FILES([${ac_config_dir}/src/libmongoc/src/zlib-1.2.11/zconf.h])
fi

if test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" = "yes"; then
AC_SUBST(MONGOCRYPT_ENABLE_TRACE, 1)

dnl Generated with: find src/libmongocrypt/src -maxdepth 1 -name '*.c' -print0 | cut -sz -d / -f 4- | sort -dz | tr '\000' ' '
PHP_MONGODB_MONGOCRYPT_SOURCES="mongocrypt-binary.c mongocrypt-buffer.c mongocrypt.c mongocrypt-cache.c mongocrypt-cache-collinfo.c mongocrypt-cache-key.c mongocrypt-ciphertext.c mongocrypt-crypto.c mongocrypt-ctx.c mongocrypt-ctx-datakey.c mongocrypt-ctx-decrypt.c mongocrypt-ctx-encrypt.c mongocrypt-key-broker.c mongocrypt-key.c mongocrypt-kms-ctx.c mongocrypt-log.c mongocrypt-marking.c mongocrypt-opts.c mongocrypt-status.c mongocrypt-traverse-util.c"

dnl Generated with: find src/libmongocrypt/src/crypto -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
PHP_MONGODB_MONGOCRYPT_CRYPTO_SOURCES="cng.c commoncrypto.c libcrypto.c none.c"

dnl Generated with: find src/libmongocrypt/src/os_posix -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
PHP_MONGODB_MONGOCRYPT_OS_POSIX_SOURCES="os_mutex.c os_once.c"

dnl Generated with: find src/libmongocrypt/src/os_win -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
PHP_MONGODB_MONGOCRYPT_OS_WIN_SOURCES="os_mutex.c os_once.c"

dnl Generated with: find src/libmongocrypt/kms-message/src -maxdepth 1 -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
PHP_MONGODB_MONGOCRYPT_KMS_MESSAGE_SOURCES="hexlify.c kms_b64.c kms_caller_identity_request.c kms_crypto_apple.c kms_crypto_libcrypto.c kms_crypto_none.c kms_crypto_windows.c kms_decrypt_request.c kms_encrypt_request.c kms_kv_list.c kms_message.c kms_request.c kms_request_opt.c kms_request_str.c kms_response.c kms_response_parser.c sort.c"

PHP_MONGODB_ADD_SOURCES([src/libmongocrypt/src/], $PHP_MONGODB_MONGOCRYPT_SOURCES, $PHP_MONGODB_LIBMONGOCRYPT_CFLAGS)
PHP_MONGODB_ADD_SOURCES([src/libmongocrypt/src/crypto/], $PHP_MONGODB_MONGOCRYPT_CRYPTO_SOURCES, $PHP_MONGODB_LIBMONGOCRYPT_CFLAGS)
PHP_MONGODB_ADD_SOURCES([src/libmongocrypt/src/os_posix/], $PHP_MONGODB_MONGOCRYPT_OS_POSIX_SOURCES, $PHP_MONGODB_LIBMONGOCRYPT_CFLAGS)
PHP_MONGODB_ADD_SOURCES([src/libmongocrypt/src/os_win/], $PHP_MONGODB_MONGOCRYPT_OS_WIN_SOURCES, $PHP_MONGODB_LIBMONGOCRYPT_CFLAGS)
PHP_MONGODB_ADD_SOURCES([src/libmongocrypt/kms-message/src/], $PHP_MONGODB_MONGOCRYPT_KMS_MESSAGE_SOURCES, $PHP_MONGODB_LIBMONGOCRYPT_CFLAGS)

PHP_MONGODB_ADD_INCLUDE([src/libmongocrypt/src/])
PHP_MONGODB_ADD_INCLUDE([src/libmongocrypt/kms-message/src/])
PHP_MONGODB_ADD_INCLUDE([src/libmongocrypt-compat/])

PHP_MONGODB_ADD_BUILD_DIR([src/libmongocrypt/src/])
PHP_MONGODB_ADD_BUILD_DIR([src/libmongocrypt/src/crypto/])
PHP_MONGODB_ADD_BUILD_DIR([src/libmongocrypt/src/os_posix/])
PHP_MONGODB_ADD_BUILD_DIR([src/libmongocrypt/src/os_win/])
PHP_MONGODB_ADD_BUILD_DIR([src/libmongocrypt/kms-message/src/])

AC_CONFIG_FILES([
${ac_config_dir}/src/libmongocrypt/src/mongocrypt-config.h
${ac_config_dir}/src/libmongocrypt/src/mongocrypt.h
])
fi
fi

PHP_NEW_EXTENSION(mongodb, $PHP_MONGODB_SOURCES, $ext_shared,, $PHP_MONGODB_CFLAGS)
Expand Down Expand Up @@ -373,6 +457,7 @@ if test "$PHP_MONGODB" != "no"; then
dnl This must come after PHP_NEW_EXTENSION, otherwise the srcdir won't be set
PHP_ADD_MAKEFILE_FRAGMENT

dnl The libmongocrypt line intentionally uses the PHP_LIBBSON flag as that decides whether to build against bundled or system libraries.
AC_CONFIG_COMMANDS_POST([
if test "$enable_static" = "no"; then
echo "
Expand All @@ -385,6 +470,7 @@ Build configuration:
Code Coverage flags (extra slow) : $COVERAGE_CFLAGS
System mongoc : $PHP_LIBMONGOC
System libbson : $PHP_LIBBSON
System libmongocrypt : $PHP_LIBBSON
LDFLAGS : $LDFLAGS
EXTRA_LDFLAGS : $EXTRA_LDFLAGS
MONGODB_SHARED_LIBADD : $MONGODB_SHARED_LIBADD
Expand Down
59 changes: 58 additions & 1 deletion config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function mongodb_parse_version_file(inpath, prefix)

ARG_ENABLE("mongodb", "MongoDB support", "no");
ARG_WITH("mongodb-sasl", "MongoDB: Build against Cyrus-SASL", "yes");
ARG_WITH("mongodb-client-side-encryption", "MongoDB: Enable client-side encryption", "yes");

if (PHP_MONGODB != "no") {
/* Note: ADD_EXTENSION_DEP() cannot be used to declare that we depend on the
Expand Down Expand Up @@ -148,7 +149,6 @@ if (PHP_MONGODB != "no") {
MONGOC_ENABLE_SSL: 0,
MONGOC_ENABLE_CRYPTO: 0,
MONGOC_ENABLE_CRYPTO_SYSTEM_PROFILE: 0,
// TODO: Replace with detection for libmongocrypt for PHPC-1293
MONGOC_ENABLE_CLIENT_SIDE_ENCRYPTION: 0,
MONGOC_ENABLE_COMPRESSION_SNAPPY: 0,
MONGOC_ENABLE_COMPRESSION_ZLIB: 0,
Expand Down Expand Up @@ -226,6 +226,63 @@ if (PHP_MONGODB != "no") {
WARNING("mongodb libsasl support not enabled, libs not found");
}

if (PHP_MONGODB_CLIENT_SIDE_ENCRYPTION != "no" && mongoc_ssl_found) {
mongoc_opts.MONGOC_ENABLE_CLIENT_SIDE_ENCRYPTION = 1;

ADD_FLAG("CFLAGS_MONGODB", "/I" + configure_module_dirname + "/src/libmongocrypt/src");
ADD_FLAG("CFLAGS_MONGODB", "/I" + configure_module_dirname + "/src/libmongocrypt/kms-message/src");
ADD_FLAG("CFLAGS_MONGODB", "/I" + configure_module_dirname + "/src/libmongocrypt-compat");
ADD_FLAG("CFLAGS_MONGODB", "/D KMS_MESSAGE_ENABLE_CRYPTO=1 /D KMS_MESSAGE_ENABLE_CRYPTO_LIBCRYPTO=1");

var mongocrypt_opts = {
MONGOCRYPT_ENABLE_TRACE: 1,
MONGOCRYPT_ENABLE_CRYPTO: 1,
MONGOCRYPT_ENABLE_CRYPTO_LIBCRYPTO: 1,
// TODO: Support building with Secure Channel on Windows
MONGOCRYPT_ENABLE_CRYPTO_CNG: 0,
// Secure Transport does not apply to Windows
MONGOCRYPT_ENABLE_CRYPTO_COMMON_CRYPTO: 0
};

// Generated with: find src/libmongocrypt/src -maxdepth 1 -name '*.c' -print0 | cut -sz -d / -f 4- | sort -dz | tr '\000' ' '
var PHP_MONGODB_MONGOCRYPT_SOURCES="mongocrypt-binary.c mongocrypt-buffer.c mongocrypt.c mongocrypt-cache.c mongocrypt-cache-collinfo.c mongocrypt-cache-key.c mongocrypt-ciphertext.c mongocrypt-crypto.c mongocrypt-ctx.c mongocrypt-ctx-datakey.c mongocrypt-ctx-decrypt.c mongocrypt-ctx-encrypt.c mongocrypt-key-broker.c mongocrypt-key.c mongocrypt-kms-ctx.c mongocrypt-log.c mongocrypt-marking.c mongocrypt-opts.c mongocrypt-status.c mongocrypt-traverse-util.c";

// Generated with: find src/libmongocrypt/src/crypto -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
var PHP_MONGODB_MONGOCRYPT_CRYPTO_SOURCES="cng.c commoncrypto.c libcrypto.c none.c";

// Generated with: find src/libmongocrypt/src/os_posix -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
var PHP_MONGODB_MONGOCRYPT_OS_POSIX_SOURCES="os_mutex.c os_once.c";

// Generated with: find src/libmongocrypt/src/os_win -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
var PHP_MONGODB_MONGOCRYPT_OS_WIN_SOURCES="os_mutex.c os_once.c";

// Generated with: find src/libmongocrypt/kms-message/src -maxdepth 1 -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' '
var PHP_MONGODB_MONGOCRYPT_KMS_MESSAGE_SOURCES="hexlify.c kms_b64.c kms_caller_identity_request.c kms_crypto_apple.c kms_crypto_libcrypto.c kms_crypto_none.c kms_crypto_windows.c kms_decrypt_request.c kms_encrypt_request.c kms_kv_list.c kms_message.c kms_request.c kms_request_opt.c kms_request_str.c kms_response.c kms_response_parser.c sort.c";

ADD_SOURCES(configure_module_dirname + "/src/libmongocrypt/src", PHP_MONGODB_MONGOCRYPT_SOURCES, "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/libmongocrypt/src/crypto", PHP_MONGODB_MONGOCRYPT_SOURCES, "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/libmongocrypt/src/os_posix", PHP_MONGODB_MONGOCRYPT_OS_POSIX_SOURCES, "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/libmongocrypt/src/os_win", PHP_MONGODB_MONGOCRYPT_OS_WIN_SOURCES, "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/libmongocrypt/kms-message/src", PHP_MONGODB_MONGOCRYPT_KMS_MESSAGE_SOURCES, "mongodb");

var mongocrypt_version = mongodb_parse_version_file(configure_module_dirname + "/src/LIBMONGOCRYPT_VERSION_CURRENT", "")
mongocrypt_opts.MONGOCRYPT_BUILD_VERSION = mongocrypt_version.VERSION;

mongodb_generate_header(
configure_module_dirname + "/src/libmongocrypt/src/mongocrypt-config.h.in",
configure_module_dirname + "/src/libmongocrypt/src/mongocrypt-config.h",
mongocrypt_opts
);

mongodb_generate_header(
configure_module_dirname + "/src/libmongocrypt/src/mongocrypt.h.in",
configure_module_dirname + "/src/libmongocrypt/src/mongocrypt.h",
mongocrypt_opts
);
} else if (PHP_MONGODB_CLIENT_SIDE_ENCRYPTION != "no") {
WARNING("mongodb libmongocrypt support not enabled, crypto libs not found");
}

if (CHECK_LIB("dnsapi.lib", "mongodb", PHP_MONGODB) &&
CHECK_HEADER_ADD_INCLUDE("windns.h", "CFLAGS_MONGODB")) {
mongoc_opts.MONGOC_HAVE_DNSAPI = 1;
Expand Down
Loading