Skip to content

PHPC-2270 and PHPC-2271: Bump to libmongoc 1.24.3 and update build configuration #1458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1170,9 +1170,9 @@ axes:
display_name: libmongoc version
values:
- id: "lowest-supported"
display_name: "1.24.2"
display_name: "1.24.3"
variables:
LIBMONGOC_VERSION: "1.24.2"
LIBMONGOC_VERSION: "1.24.3"
- id: "upcoming-stable"
display_name: "1.24-dev"
variables:
Expand Down
10 changes: 5 additions & 5 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ if test "$PHP_MONGODB" != "no"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_MSG_CHECKING(for libbson)
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libbson-1.0; then
if $PKG_CONFIG libbson-1.0 --atleast-version 1.24.2; then
if $PKG_CONFIG libbson-1.0 --atleast-version 1.24.3; then
PHP_MONGODB_BSON_CFLAGS=`$PKG_CONFIG libbson-1.0 --cflags`
PHP_MONGODB_BSON_LIBS=`$PKG_CONFIG libbson-1.0 --libs`
PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion`
PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)"
AC_MSG_RESULT(version $PHP_MONGODB_BSON_VERSION found)
else
AC_MSG_ERROR(system libbson must be upgraded to version >= 1.24.2)
AC_MSG_ERROR(system libbson must be upgraded to version >= 1.24.3)
fi
else
AC_MSG_ERROR(pkgconfig and libbson must be installed)
Expand All @@ -271,14 +271,14 @@ if test "$PHP_MONGODB" != "no"; then

AC_MSG_CHECKING(for libmongoc)
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libmongoc-1.0; then
if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.24.2; then
if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.24.3; then
PHP_MONGODB_MONGOC_CFLAGS=`$PKG_CONFIG libmongoc-1.0 --cflags`
PHP_MONGODB_MONGOC_LIBS=`$PKG_CONFIG libmongoc-1.0 --libs`
PHP_MONGODB_MONGOC_VERSION=`$PKG_CONFIG libmongoc-1.0 --modversion`
PHP_MONGODB_MONGOC_VERSION_STRING="System ($PHP_MONGODB_MONGOC_VERSION)"
AC_MSG_RESULT(version $PHP_MONGODB_MONGOC_VERSION found)
else
AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.24.2)
AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.24.3)
fi
else
AC_MSG_ERROR(pkgconfig and libmongoc must be installed)
Expand Down Expand Up @@ -344,6 +344,7 @@ if test "$PHP_MONGODB" != "no"; then

_include([scripts/autotools/CheckCompiler.m4])
_include([scripts/autotools/CheckHost.m4])
_include([scripts/autotools/PlatformFlags.m4])

_include([scripts/autotools/libbson/CheckAtomics.m4])
_include([scripts/autotools/libbson/CheckHeaders.m4])
Expand All @@ -357,7 +358,6 @@ if test "$PHP_MONGODB" != "no"; then
_include([scripts/autotools/libmongoc/CheckSSL.m4])
_include([scripts/autotools/libmongoc/CheckICU.m4])
_include([scripts/autotools/libmongoc/FindDependencies.m4])
_include([scripts/autotools/libmongoc/PlatformFlags.m4])
_include([scripts/autotools/libmongoc/Versions.m4])
_include([scripts/autotools/libmongoc/WeakSymbols.m4])

Expand Down
12 changes: 0 additions & 12 deletions scripts/autotools/CheckCompiler.m4
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ if test "$c_compiler" = "unknown"; then
AC_MSG_ERROR([Compiler GCC >= 4.1 or Clang >= 3.3 is required for C compilation])
fi

# GLibc 2.19 complains about both _BSD_SOURCE and _GNU_SOURCE. The _GNU_SOURCE
# contains everything anyway. So just use that.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <features.h>
#ifndef __GLIBC__
#error not glibc
#endif
]], [])],
LIBC_FEATURES="-D_GNU_SOURCE",
LIBC_FEATURES="-D_BSD_SOURCE")
AC_SUBST(LIBC_FEATURES)

AC_C_CONST
AC_C_INLINE
AC_C_TYPEOF
29 changes: 29 additions & 0 deletions scripts/autotools/PlatformFlags.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dnl Enable POSIX features up to POSIX.1-2008 plus the XSI extension and BSD-derived definitions.
dnl Both _BSD_SOURCE and _DEFAULT_SOURCE are defined for backwards-compatibility with glibc 2.19 and earlier.
dnl _BSD_SOURCE and _DEFAULT_SOURCE are required by `getpagesize`, `h_errno`, etc.
dnl _XOPEN_SOURCE=700 is required by `strnlen`, `strerror_l`, etc.
dnl https://man7.org/linux/man-pages/man7/feature_test_macros.7.html
dnl https://pubs.opengroup.org/onlinepubs/7908799/xsh/compilation.html
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -D_DEFAULT_SOURCE"
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS -D_XOPEN_SOURCE=700 -D_BSD_SOURCE -D_DEFAULT_SOURCE"

dnl Enable non-standard features on FreeBSD with __BSD_VISIBLE=1
if test "$os_freebsd" = "yes"; then
CPPFLAGS="$CPPFLAGS -D__BSD_VISIBLE=1"
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS -D__BSD_VISIBLE=1"
fi

AS_IF([test "$os_darwin" = "yes"],[
dnl Non-POSIX extensions are required by `_SC_NPROCESSORS_ONLN`.
dnl https://opensource.apple.com/source/Libc/Libc-1439.40.11/gen/compat.5.auto.html
CPPFLAGS="$CPPFLAGS -D_DARWIN_C_SOURCE"
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS -D_DARWIN_C_SOURCE"

dnl Ignore OpenSSL deprecation warnings on OSX
AX_CHECK_COMPILE_FLAG([-Wno-deprecated-declarations], [STD_CFLAGS="$STD_CFLAGS -Wno-deprecated-declarations"])

dnl We know there are some cast-align issues on OSX
AX_CHECK_COMPILE_FLAG([-Wno-cast-align], [STD_CFLAGS="$STD_CFLAGS -Wno-cast-align"])
AX_CHECK_COMPILE_FLAG([-Wno-unneeded-internal-declaration], [STD_CFLAGS="$STD_CFLAGS -Wno-unneeded-internal-declaration"])
AX_CHECK_COMPILE_FLAG([-Wno-error=unused-command-line-argument], [STD_CFLAGS="$STD_CFLAGS -Wno-error=unused-command-line-argument"])
])
4 changes: 0 additions & 4 deletions scripts/autotools/libbson/FindDependencies.m4
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if test "$os_win32" != "yes"; then
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS -D_DEFAULT_SOURCE"
fi

# Check for strnlen()
dnl AC_CHECK_FUNC isn't properly respecting _XOPEN_SOURCE for strnlen for unknown reason
AC_SUBST(BSON_HAVE_STRNLEN, 0)
Expand Down
16 changes: 0 additions & 16 deletions scripts/autotools/libmongoc/PlatformFlags.m4

This file was deleted.

2 changes: 1 addition & 1 deletion src/LIBMONGOC_VERSION_CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.2
1.24.3