@@ -70,7 +70,7 @@ function MONGODB_ADD_SOURCES(dir, file_list)
70
70
}
71
71
72
72
ARG_ENABLE ( "mongodb" , "MongoDB support" , "no" ) ;
73
- ARG_WITH ( "mongodb-sasl" , "MongoDB: Build against Cyrus- SASL" , "yes" ) ;
73
+ ARG_WITH ( "mongodb-sasl" , "MongoDB: Build with SASL (cyrus, sspi) " , "yes" ) ;
74
74
ARG_WITH ( "mongodb-client-side-encryption" , "MongoDB: Enable client-side encryption" , "yes" ) ;
75
75
76
76
if ( PHP_MONGODB != "no" ) {
@@ -232,15 +232,21 @@ if (PHP_MONGODB != "no") {
232
232
WARNING ( "mongodb libopenssl support not enabled, libs not found" ) ;
233
233
}
234
234
235
- // TODO: Support building with native GSSAPI (SSPI) on Windows
236
235
if ( PHP_MONGODB_SASL != "no" &&
237
236
CHECK_LIB ( "libsasl.lib" , "mongodb" , PHP_MONGODB ) &&
238
237
CHECK_HEADER_ADD_INCLUDE ( "sasl/sasl.h" , "CFLAGS_MONGODB" ) ) {
239
238
mongoc_opts . MONGOC_ENABLE_SASL = 1 ;
240
- mongoc_opts . MONGOC_ENABLE_SASL_CYRUS = 1 ;
241
239
242
- // Referenced by _mongoc_cyrus_verifyfile_cb in mongoc-cyrus.c on Windows
243
- ADD_FLAG ( "CFLAGS_MONGODB" , "/D MONGOC_CYRUS_PLUGIN_PATH_PREFIX=NULL" ) ;
240
+ if ( PHP_MONGODB_SASL == "yes" || PHP_MONGODB_SASL == "cyrus" ) {
241
+ mongoc_opts . MONGOC_ENABLE_SASL_CYRUS = 1 ;
242
+
243
+ // Referenced by _mongoc_cyrus_verifyfile_cb in mongoc-cyrus.c on Windows
244
+ ADD_FLAG ( "CFLAGS_MONGODB" , "/D MONGOC_CYRUS_PLUGIN_PATH_PREFIX=NULL" ) ;
245
+ } else if ( PHP_MONGODB_SASL == "sspi" ) {
246
+ mongoc_opts . MONGOC_ENABLE_SASL_SSPI = 1 ;
247
+ } else {
248
+ WARNING ( "mongodb sasl support not enabled, unknown value for PHP_MONGODB_SASL: " + PHP_MONGODB_SASL ) ;
249
+ }
244
250
245
251
if ( CHECK_FUNC_IN_HEADER ( "sasl/sasl.h" , "sasl_client_done" ) ) {
246
252
mongoc_opts . MONGOC_HAVE_SASL_CLIENT_DONE = 1 ;
0 commit comments