Skip to content

Commit 912987c

Browse files
committed
Use both mongodb and openssl extension paths for CHECK_LIB
The ldap extensions' config.w32 uses PHP_LDAP as its search path, so we'll continue to start with PHP_MONGODB as a rule of thumb. Since we currently declare a dependency on the OpenSSL extension, it makes sense to also include it in our search path in case it was customized at build time. Based on the openssl extension's config.w32, crypt32.lib is a system library and needs no extra search path.
1 parent a7a361a commit 912987c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

config.w32

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,15 @@ if (PHP_MONGODB != "no") {
126126
MONGOC_USER_SET_LDFLAGS: ""
127127
};
128128

129-
if (CHECK_LIB("ssleay32.lib", "mongodb", PHP_MONGODB) &&
130-
CHECK_LIB("libeay32.lib", "mongodb", PHP_MONGODB) &&
131-
CHECK_LIB("crypt32.lib", "mongodb", PHP_MONGODB) &&
129+
var mongoc_ssl_path_to_check = PHP_MONGODB;
130+
131+
if (typeof PHP_OPENSSL === 'string') {
132+
mongoc_ssl_path_to_check += ";" + PHP_OPENSSL;
133+
}
134+
135+
if (CHECK_LIB("ssleay32.lib", "mongodb", mongoc_ssl_path_to_check) &&
136+
CHECK_LIB("libeay32.lib", "mongodb", mongoc_ssl_path_to_check) &&
137+
CHECK_LIB("crypt32.lib", "mongodb") &&
132138
CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_MONGODB")) {
133139
mongoc_opts.MONGOC_ENABLE_SSL_OPENSSL = 1;
134140
mongoc_opts.MONGOC_ENABLE_CRYPTO_LIBCRYPTO = 1;

0 commit comments

Comments
 (0)