@@ -9,7 +9,13 @@ function mongodb_generate_header(inpath, outpath, replacements)
9
9
infile . Close ( ) ;
10
10
11
11
for ( var key in replacements ) {
12
- outdata = outdata . replace ( "@" + key + "@" , replacements [ key ] ) ;
12
+ var replacement = replacements [ key ] ;
13
+
14
+ if ( typeof replacement === 'string' ) {
15
+ replacement = replacement . replace ( / " / g, '\\"' ) ;
16
+ }
17
+
18
+ outdata = outdata . replace ( "@" + key + "@" , replacement ) ;
13
19
}
14
20
15
21
var outfile = FSO . CreateTextFile ( outpath , true ) ;
@@ -113,7 +119,10 @@ if (PHP_MONGODB != "no") {
113
119
MONGOC_ENABLE_SASL : 0 ,
114
120
MONGOC_HAVE_SASL_CLIENT_DONE : 0 ,
115
121
MONGOC_HAVE_WEAK_SYMBOLS : 0 ,
116
- MONGOC_NO_AUTOMATIC_GLOBALS : 1
122
+ MONGOC_NO_AUTOMATIC_GLOBALS : 1 ,
123
+ MONGOC_CC : "" ,
124
+ MONGOC_USER_SET_CFLAGS : "" ,
125
+ MONGOC_USER_SET_LDFLAGS : ""
117
126
} ;
118
127
119
128
if ( CHECK_LIB ( "ssleay32.lib" , "mongodb" , PHP_MONGODB ) &&
@@ -140,6 +149,15 @@ if (PHP_MONGODB != "no") {
140
149
WARNING ( "mongodb libsasl support not enabled, libs not found" ) ;
141
150
}
142
151
152
+ if ( typeof COMPILER_NAME === 'string' ) {
153
+ mongoc_opts . MONGOC_CC = COMPILER_NAME ;
154
+ } else if ( typeof VC_VERSIONS [ VCVERS ] === 'string' ) {
155
+ mongoc_opts . MONGOC_CC = VC_VERSIONS [ VCVERS ] ;
156
+ }
157
+
158
+ /* MONGOC_USER_SET_CFLAGS and MONGOC_USER_SET_LDFLAGS can be left blank, as we
159
+ * do not expect CFLAGS or LDFLAGS to be customized at build time. */
160
+
143
161
mongodb_generate_header (
144
162
configure_module_dirname + "/src/libmongoc/src/mongoc/mongoc-config.h.in" ,
145
163
configure_module_dirname + "/src/libmongoc/src/mongoc/mongoc-config.h" ,
0 commit comments