Skip to content

Commit 7ccb094

Browse files
authored
PHPC-2300: Update build configs for renamed libbson substitutions (#1474)
Bumps libmongoc to 1.25-dev
1 parent 2a3a9d8 commit 7ccb094

File tree

5 files changed

+38
-15
lines changed

5 files changed

+38
-15
lines changed

config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ if test "$PHP_MONGODB" != "no"; then
415415
PHP_MONGODB_COMMON_SOURCES="common-b64.c common-md5.c common-thread.c"
416416

417417
dnl Generated with: find src/libmongoc/src/kms-message/src -maxdepth 1 -name '*.c' -print0 | cut -sz -d / -f 6- | sort -dz | tr '\000' ' '
418-
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"
418+
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"
419419

420420
dnl Generated with: find src/libmongoc/src/libbson/src/bson -name '*.c' -print0 | cut -sz -d / -f 7- | sort -dz | tr '\000' ' '
421421
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"

config.w32

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,29 @@ function mongodb_generate_header(inpath, outpath, replacements)
2323
outfile.Close();
2424
}
2525

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+
2649
function mongodb_parse_version_file(inpath, prefix)
2750
{
2851
var infile = FSO.OpenTextFile(inpath, 1);
@@ -108,7 +131,7 @@ if (PHP_MONGODB != "no") {
108131
var PHP_MONGODB_COMMON_SOURCES="common-b64.c common-md5.c common-thread.c"
109132

110133
// 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";
112135

113136
// Generated with: find src/libmongoc/src/libbson/src/bson -name '*.c' -print0 | cut -sz -d / -f 7- | sort -dz | tr '\000' ' '
114137
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") {
170193
mongodb_generate_header(
171194
configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-version.h.in",
172195
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")
174197
);
175198

176199
var mongoc_opts = {

scripts/autotools/libbson/Versions.m4

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
BSON_CURRENT_FILE=[]PHP_EXT_SRCDIR(mongodb)[/src/LIBMONGOC_VERSION_CURRENT]
2-
BSON_VERSION=$(cat $BSON_CURRENT_FILE)
2+
libbson_VERSION_FULL=$(cat $BSON_CURRENT_FILE)
33

44
dnl Ensure newline for "cut" implementations that need it, e.g. HP-UX.
5-
BSON_MAJOR_VERSION=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f1 )
6-
BSON_MINOR_VERSION=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f2 )
7-
BSON_MICRO_VERSION=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f3 )
8-
BSON_PRERELEASE_VERSION=$(cut -s -d- -f2 $BSON_CURRENT_FILE)
5+
libbson_VERSION_MAJOR=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f1 )
6+
libbson_VERSION_MINOR=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f2 )
7+
libbson_VERSION_PATCH=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f3 )
8+
libbson_VERSION_PRERELEASE=$(cut -s -d- -f2 $BSON_CURRENT_FILE)
99

10-
AC_SUBST(BSON_VERSION)
11-
AC_SUBST(BSON_MAJOR_VERSION)
12-
AC_SUBST(BSON_MINOR_VERSION)
13-
AC_SUBST(BSON_MICRO_VERSION)
14-
AC_SUBST(BSON_PRERELEASE_VERSION)
10+
AC_SUBST(libbson_VERSION_FULL)
11+
AC_SUBST(libbson_VERSION_MAJOR)
12+
AC_SUBST(libbson_VERSION_MINOR)
13+
AC_SUBST(libbson_VERSION_PATCH)
14+
AC_SUBST(libbson_VERSION_PRERELEASE)

src/LIBMONGOC_VERSION_CURRENT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.25.0-20230815+gitd933a8c996
1+
1.25.0-20230922+git1c8da0ee19

src/libmongoc

Submodule libmongoc updated 262 files

0 commit comments

Comments
 (0)