From 083e33ede35492a77a28dba4bb856dcd0492f723 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:04:47 -0500 Subject: [PATCH 1/9] PHPC-2477: BSON_HAVE_ATOMIC constants are obsolete CDRIVER-4124 removed BSON_HAVE_ATOMIC_32_ADD_AND_FETCH and BSON_HAVE_ATOMIC_64_ADD_AND_FETCH --- config.m4 | 1 - config.w32 | 2 -- scripts/autotools/libbson/CheckAtomics.m4 | 23 ----------------------- 3 files changed, 26 deletions(-) delete mode 100644 scripts/autotools/libbson/CheckAtomics.m4 diff --git a/config.m4 b/config.m4 index 28998f5e8..75672f8d4 100644 --- a/config.m4 +++ b/config.m4 @@ -338,7 +338,6 @@ if test "$PHP_MONGODB" != "no"; then m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/CheckHost.m4) m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/PlatformFlags.m4) - m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/CheckAtomics.m4) m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/CheckHeaders.m4) m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/Endian.m4) m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/FindDependencies.m4) diff --git a/config.w32 b/config.w32 index dbded6599..138939e16 100644 --- a/config.w32 +++ b/config.w32 @@ -130,8 +130,6 @@ if (PHP_MONGODB != "no") { BSON_OS: 2, BSON_HAVE_STDBOOL_H: 0, BSON_HAVE_STRINGS_H: 0, - BSON_HAVE_ATOMIC_32_ADD_AND_FETCH: 0, - BSON_HAVE_ATOMIC_64_ADD_AND_FETCH: 0, BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES: 0, BSON_HAVE_CLOCK_GETTIME: 0, BSON_HAVE_STRNLEN: 0, diff --git a/scripts/autotools/libbson/CheckAtomics.m4 b/scripts/autotools/libbson/CheckAtomics.m4 deleted file mode 100644 index 3071e36df..000000000 --- a/scripts/autotools/libbson/CheckAtomics.m4 +++ /dev/null @@ -1,23 +0,0 @@ -AC_LANG_PUSH([C]) -AC_MSG_CHECKING([for __sync_add_and_fetch_4]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int32_t v = 1; return __sync_add_and_fetch_4 (&v, (int32_t)10);]])], - [AC_MSG_RESULT(yes) - have_sync_add_and_fetch_4=yes], - [AC_MSG_RESULT(no) - have_sync_add_and_fetch_4=no]) -AS_IF([test "$have_sync_add_and_fetch_4" = "yes"], - [AC_SUBST(BSON_HAVE_ATOMIC_32_ADD_AND_FETCH, 1)], - [AC_SUBST(BSON_HAVE_ATOMIC_32_ADD_AND_FETCH, 0)]) - -AC_MSG_CHECKING([for __sync_add_and_fetch_8]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int64_t v; return __sync_add_and_fetch_8 (&v, (int64_t)10);]])], - [AC_MSG_RESULT(yes) - have_sync_add_and_fetch_8=yes], - [AC_MSG_RESULT(no) - have_sync_add_and_fetch_8=no]) -AS_IF([test "$have_sync_add_and_fetch_8" = "yes"], - [AC_SUBST(BSON_HAVE_ATOMIC_64_ADD_AND_FETCH, 1)], - [AC_SUBST(BSON_HAVE_ATOMIC_64_ADD_AND_FETCH, 0)]) -AC_LANG_POP([C]) From 6d6e0ebfb5b1ae579e00a9a0de304a7f15b34ed6 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:06:06 -0500 Subject: [PATCH 2/9] PHPC-2477: BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES is obsolete CDRIVER-2694 removed BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES --- config.w32 | 1 - scripts/autotools/libbson/FindDependencies.m4 | 23 ------------------- 2 files changed, 24 deletions(-) diff --git a/config.w32 b/config.w32 index 138939e16..ddd23eebb 100644 --- a/config.w32 +++ b/config.w32 @@ -130,7 +130,6 @@ if (PHP_MONGODB != "no") { BSON_OS: 2, BSON_HAVE_STDBOOL_H: 0, BSON_HAVE_STRINGS_H: 0, - BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES: 0, BSON_HAVE_CLOCK_GETTIME: 0, BSON_HAVE_STRNLEN: 0, BSON_HAVE_SNPRINTF: 0, diff --git a/scripts/autotools/libbson/FindDependencies.m4 b/scripts/autotools/libbson/FindDependencies.m4 index f365f6c21..d567f88a5 100644 --- a/scripts/autotools/libbson/FindDependencies.m4 +++ b/scripts/autotools/libbson/FindDependencies.m4 @@ -96,26 +96,3 @@ AX_PTHREAD([ ],[ AC_MSG_ERROR([libbson requires pthreads on non-Windows platforms.]) ]) - - -# The following is borrowed from the guile configure script. -# -# On past versions of Solaris, believe 8 through 10 at least, you -# had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };". -# This is contrary to POSIX: -# http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html -# Check here if this style is required. -# -# glibc (2.3.6 at least) works both with or without braces, so the -# test checks whether it works without. -# -AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 0) -AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces], - bson_cv_need_braces_on_pthread_once_init, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include - pthread_once_t foo = PTHREAD_ONCE_INIT;]])], - [bson_cv_need_braces_on_pthread_once_init=no], - [bson_cv_need_braces_on_pthread_once_init=yes])]) -if test "$bson_cv_need_braces_on_pthread_once_init" = yes; then - AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 1) -fi From 4542dd09ddf2dcab6d782327cbd35b5076cde2e6 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:07:27 -0500 Subject: [PATCH 3/9] PHPC-2477: BSON_HAVE_REALLOCF is obsolete BSON_HAVE_REALLOCF was no longer used when libbson was vendored in CDRIVER-2416 --- config.w32 | 1 - scripts/autotools/libbson/FindDependencies.m4 | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/config.w32 b/config.w32 index ddd23eebb..163283b7f 100644 --- a/config.w32 +++ b/config.w32 @@ -134,7 +134,6 @@ if (PHP_MONGODB != "no") { BSON_HAVE_STRNLEN: 0, BSON_HAVE_SNPRINTF: 0, BSON_HAVE_STRLCPY: 0, - BSON_HAVE_REALLOCF: 0, BSON_NEEDS_SET_OUTPUT_FORMAT: 0, BSON_HAVE_TIMESPEC: 0, BSON_EXTRA_ALIGN: 0, diff --git a/scripts/autotools/libbson/FindDependencies.m4 b/scripts/autotools/libbson/FindDependencies.m4 index d567f88a5..da0961fe0 100644 --- a/scripts/autotools/libbson/FindDependencies.m4 +++ b/scripts/autotools/libbson/FindDependencies.m4 @@ -13,20 +13,6 @@ if test "$bson_cv_have_strnlen" = yes; then AC_SUBST(BSON_HAVE_STRNLEN, 1) fi -# Check for reallocf() (BSD/Darwin) -AC_SUBST(BSON_HAVE_REALLOCF, 0) -AC_CACHE_CHECK([for reallocf], - bson_cv_have_reallocf, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -int reallocf () { return 0; } -]])], - [bson_cv_have_reallocf=no], - [bson_cv_have_reallocf=yes])]) -if test "$bson_cv_have_reallocf" = yes; then - AC_SUBST(BSON_HAVE_REALLOCF, 1) -fi - # Check for syscall() AC_SUBST(BSON_HAVE_SYSCALL_TID, 0) AC_CACHE_CHECK([for syscall], From 7968a61c93f22b49930857278c3f82db3317b391 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:09:50 -0500 Subject: [PATCH 4/9] PHPC-2477: BSON_HAVE_SYSCALL_TID is obsolete CDRIVER-2771 removed outstanding references to BSON_HAVE_SYSCALL_TID --- config.w32 | 1 - scripts/autotools/libbson/FindDependencies.m4 | 26 ------------------- 2 files changed, 27 deletions(-) diff --git a/config.w32 b/config.w32 index 163283b7f..63f4ba279 100644 --- a/config.w32 +++ b/config.w32 @@ -137,7 +137,6 @@ if (PHP_MONGODB != "no") { BSON_NEEDS_SET_OUTPUT_FORMAT: 0, BSON_HAVE_TIMESPEC: 0, BSON_EXTRA_ALIGN: 0, - BSON_HAVE_SYSCALL_TID: 0, BSON_HAVE_DECIMAL128: 0, BSON_HAVE_GMTIME_R: 0, BSON_HAVE_RAND_R: 0, diff --git a/scripts/autotools/libbson/FindDependencies.m4 b/scripts/autotools/libbson/FindDependencies.m4 index da0961fe0..ea86a27b1 100644 --- a/scripts/autotools/libbson/FindDependencies.m4 +++ b/scripts/autotools/libbson/FindDependencies.m4 @@ -13,32 +13,6 @@ if test "$bson_cv_have_strnlen" = yes; then AC_SUBST(BSON_HAVE_STRNLEN, 1) fi -# Check for syscall() -AC_SUBST(BSON_HAVE_SYSCALL_TID, 0) -AC_CACHE_CHECK([for syscall], - bson_cv_have_syscall_tid, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -int syscall () { return 0; } -]])], - [bson_cv_have_syscall_tid=no], - [bson_cv_have_syscall_tid=yes])]) -if test "$bson_cv_have_syscall_tid" = yes -a "$os_darwin" != "yes"; then - AC_CACHE_CHECK([for SYS_gettid], - bson_cv_have_sys_gettid_tid, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -int gettid () { return SYS_gettid; } - ]])], - [bson_cv_have_sys_gettid_tid=yes], - [bson_cv_have_sys_gettid_tid=no])]) - if test "$bson_cv_have_sys_gettid_tid" = yes; then - AC_SUBST(BSON_HAVE_SYSCALL_TID, 1) - fi -fi - # Check for snprintf() AC_SUBST(BSON_HAVE_SNPRINTF, 0) AC_CHECK_FUNC(snprintf, [AC_SUBST(BSON_HAVE_SNPRINTF, 1)]) From 63f1269d4fee5855da2b945a1b9dbdaac7e43258 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:12:13 -0500 Subject: [PATCH 5/9] PHPC-2477: BSON_NEEDS_SET_OUTPUT_FORMAT is obsolete --- config.w32 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config.w32 b/config.w32 index 63f4ba279..48f2b53f5 100644 --- a/config.w32 +++ b/config.w32 @@ -134,7 +134,6 @@ if (PHP_MONGODB != "no") { BSON_HAVE_STRNLEN: 0, BSON_HAVE_SNPRINTF: 0, BSON_HAVE_STRLCPY: 0, - BSON_NEEDS_SET_OUTPUT_FORMAT: 0, BSON_HAVE_TIMESPEC: 0, BSON_EXTRA_ALIGN: 0, BSON_HAVE_DECIMAL128: 0, @@ -143,10 +142,6 @@ if (PHP_MONGODB != "no") { BSON_HAVE_ARC4RANDOM_BUF: 0 }; - if (CHECK_FUNC_IN_HEADER("stdio.h", "_set_output_format")) { - bson_opts.BSON_NEEDS_SET_OUTPUT_FORMAT = 1; - } - mongodb_generate_header( configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-config.h.in", configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-config.h", From 04a6678d428e17e3879f0267ee94603a09c15f05 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:12:48 -0500 Subject: [PATCH 6/9] PHPC-2477: BSON_HAVE_DECIMAL128 is obsolete --- config.w32 | 1 - 1 file changed, 1 deletion(-) diff --git a/config.w32 b/config.w32 index 48f2b53f5..de15625a5 100644 --- a/config.w32 +++ b/config.w32 @@ -136,7 +136,6 @@ if (PHP_MONGODB != "no") { BSON_HAVE_STRLCPY: 0, BSON_HAVE_TIMESPEC: 0, BSON_EXTRA_ALIGN: 0, - BSON_HAVE_DECIMAL128: 0, BSON_HAVE_GMTIME_R: 0, BSON_HAVE_RAND_R: 0, BSON_HAVE_ARC4RANDOM_BUF: 0 From 152fb8c034557d2afa88c38a39d8068d2cadcaf2 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:13:16 -0500 Subject: [PATCH 7/9] PHPC-2477: BSON_HAVE_ARC4RANDOM_BUF is obsolete --- config.w32 | 3 +-- scripts/autotools/libbson/FindDependencies.m4 | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/config.w32 b/config.w32 index de15625a5..a87930888 100644 --- a/config.w32 +++ b/config.w32 @@ -137,8 +137,7 @@ if (PHP_MONGODB != "no") { BSON_HAVE_TIMESPEC: 0, BSON_EXTRA_ALIGN: 0, BSON_HAVE_GMTIME_R: 0, - BSON_HAVE_RAND_R: 0, - BSON_HAVE_ARC4RANDOM_BUF: 0 + BSON_HAVE_RAND_R: 0 }; mongodb_generate_header( diff --git a/scripts/autotools/libbson/FindDependencies.m4 b/scripts/autotools/libbson/FindDependencies.m4 index ea86a27b1..2472e0a1b 100644 --- a/scripts/autotools/libbson/FindDependencies.m4 +++ b/scripts/autotools/libbson/FindDependencies.m4 @@ -39,10 +39,6 @@ AC_CHECK_FUNC(gmtime_r, [AC_SUBST(BSON_HAVE_GMTIME_R, 1)]) AC_SUBST(BSON_HAVE_RAND_R, 0) AC_CHECK_FUNC(rand_r, [AC_SUBST(BSON_HAVE_RAND_R, 1)]) -# Check for arc4random_buf() -AC_SUBST(BSON_HAVE_ARC4RANDOM_BUF, 0) -AC_CHECK_FUNC(arc4random_buf, [AC_SUBST(BSON_HAVE_ARC4RANDOM_BUF, 1)]) - # Check for pthreads. We might need to make this better to handle mingw, # but I actually think it is okay to just check for it even though we will # use win32 primatives. From c43676efc5a5e23dac9522c52f567de635392377 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:16:16 -0500 Subject: [PATCH 8/9] PHPC-2477: MONGOC_ENABLE_SASL_GSSAPI is obsolete CDRIVER-2654 removed MONGOC_ENABLE_SASL_GSSAPI. PHPC-2312 removed it from Autotools, but it was left behind in config.w32. --- config.w32 | 1 - 1 file changed, 1 deletion(-) diff --git a/config.w32 b/config.w32 index a87930888..954621215 100644 --- a/config.w32 +++ b/config.w32 @@ -175,7 +175,6 @@ if (PHP_MONGODB != "no") { MONGOC_ENABLE_MONGODB_AWS_AUTH: 0, MONGOC_ENABLE_SASL: 0, MONGOC_ENABLE_SASL_CYRUS: 0, - MONGOC_ENABLE_SASL_GSSAPI: 0, MONGOC_ENABLE_SASL_SSPI: 0, MONGOC_ENABLE_SRV: 0, MONGOC_ENABLE_RDTSCP: 0, From 2bdd9b1cef6d466eb01daf8e522503eb95283c3f Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 28 Jan 2025 14:18:27 -0500 Subject: [PATCH 9/9] PHPC-2477: MONGOC_HAVE_WEAK_SYMBOLS is obsolete CDRIVER-2600 removed MONGOC_HAVE_WEAK_SYMBOLS --- config.m4 | 1 - config.w32 | 1 - scripts/autotools/libmongoc/WeakSymbols.m4 | 9 --------- 3 files changed, 11 deletions(-) delete mode 100644 scripts/autotools/libmongoc/WeakSymbols.m4 diff --git a/config.m4 b/config.m4 index 75672f8d4..57f2c42c5 100644 --- a/config.m4 +++ b/config.m4 @@ -351,7 +351,6 @@ if test "$PHP_MONGODB" != "no"; then m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/Endian.m4) m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/FindDependencies.m4) m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/Versions.m4) - m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/WeakSymbols.m4) dnl This include modifies the value of $PHP_MONGODB_CLIENT_SIDE_ENCRYPTION to "yes" dnl or "no" depending on whether dependencies for libmongocrypt are fulfilled diff --git a/config.w32 b/config.w32 index 954621215..91199a87b 100644 --- a/config.w32 +++ b/config.w32 @@ -183,7 +183,6 @@ if (PHP_MONGODB != "no") { MONGOC_HAVE_SASL_CLIENT_DONE: 0, MONGOC_HAVE_SCHED_GETCPU: 0, MONGOC_HAVE_SOCKLEN: 1, - MONGOC_HAVE_WEAK_SYMBOLS: 0, MONGOC_NO_AUTOMATIC_GLOBALS: 1, MONGOC_SOCKET_ARG2: "struct sockaddr", MONGOC_SOCKET_ARG3: "socklen_t", diff --git a/scripts/autotools/libmongoc/WeakSymbols.m4 b/scripts/autotools/libmongoc/WeakSymbols.m4 deleted file mode 100644 index 1a54a4fe7..000000000 --- a/scripts/autotools/libmongoc/WeakSymbols.m4 +++ /dev/null @@ -1,9 +0,0 @@ -AC_MSG_CHECKING(if weak symbols are supported) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -__attribute__((weak)) void __dummy(void *x) { } -void f(void *x) { __dummy(x); } -]], [[ ]] -)], -[AC_MSG_RESULT(yes) -AC_SUBST(MONGOC_HAVE_WEAK_SYMBOLS, 1)], -[AC_MSG_RESULT(no)])