@@ -23,6 +23,29 @@ function mongodb_generate_header(inpath, outpath, replacements)
23
23
outfile . Close ( ) ;
24
24
}
25
25
26
+ /* TODO: Consolidate these parsing functions once the libbson and libmongoc
27
+ * substitutions become consistent again. */
28
+ function mongodb_parse_libbson_version_file ( inpath )
29
+ {
30
+ var infile = FSO . OpenTextFile ( inpath , 1 ) ;
31
+ var version = infile . ReadLine ( ) ;
32
+ infile . Close ( ) ;
33
+
34
+ var prefix = "libbson_" ;
35
+ var xyz_pre = version . split ( "-" ) ;
36
+ var xyz = xyz_pre [ 0 ] . split ( "." ) ;
37
+ var pre = xyz_pre . length > 1 ? xyz_pre [ 1 ] : "" ;
38
+
39
+ var replacements = { } ;
40
+ replacements [ prefix + "VERSION_FULL" ] = version ;
41
+ replacements [ prefix + "VERSION_MAJOR" ] = xyz [ 0 ] ;
42
+ replacements [ prefix + "VERSION_MINOR" ] = xyz [ 1 ] ;
43
+ replacements [ prefix + "VERSION_PATCH" ] = xyz [ 2 ] ;
44
+ replacements [ prefix + "VERSION_PRERELEASE" ] = pre ;
45
+
46
+ return replacements ;
47
+ }
48
+
26
49
function mongodb_parse_version_file ( inpath , prefix )
27
50
{
28
51
var infile = FSO . OpenTextFile ( inpath , 1 ) ;
@@ -108,7 +131,7 @@ if (PHP_MONGODB != "no") {
108
131
var PHP_MONGODB_COMMON_SOURCES = "common-b64.c common-md5.c common-thread.c"
109
132
110
133
// Generated with: find src/libmongoc/src/kms-message/src -maxdepth 1 -name '*.c' -print0 | cut -sz -d / -f 6- | sort -dz | tr '\000' ' '
111
- var PHP_MONGODB_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_port.c kms_request.c kms_request_opt.c kms_request_str.c kms_response.c kms_response_parser.c sort.c" ;
134
+ var PHP_MONGODB_KMS_MESSAGE_SOURCES = "hexlify.c kms_azure_request.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_gcp_request.c kms_kmip_reader_writer.c kms_kmip_request.c kms_kmip_response.c kms_kmip_response_parser .c kms_kv_list.c kms_message.c kms_port.c kms_request.c kms_request_opt.c kms_request_str.c kms_response.c kms_response_parser.c sort.c" ;
112
135
113
136
// Generated with: find src/libmongoc/src/libbson/src/bson -name '*.c' -print0 | cut -sz -d / -f 7- | sort -dz | tr '\000' ' '
114
137
var PHP_MONGODB_BSON_SOURCES = "bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c" ;
@@ -170,7 +193,7 @@ if (PHP_MONGODB != "no") {
170
193
mongodb_generate_header (
171
194
configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-version.h.in" ,
172
195
configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-version.h" ,
173
- mongodb_parse_version_file ( configure_module_dirname + "/src/LIBMONGOC_VERSION_CURRENT" , "BSON_ ")
196
+ mongodb_parse_libbson_version_file ( configure_module_dirname + "/src/LIBMONGOC_VERSION_CURRENT" )
174
197
) ;
175
198
176
199
var mongoc_opts = {
0 commit comments