Skip to content

Commit 338f856

Browse files
Merge v1.19 into master (#1563)
2 parents 23364a1 + a136afb commit 338f856

File tree

7 files changed

+110
-83
lines changed

7 files changed

+110
-83
lines changed

.github/workflows/package-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
echo "PACKAGE_FILE=mongodb-${PACKAGE_VERSION}.tgz" >> "$GITHUB_ENV"
4545
4646
- name: "Create detached signature for PECL package"
47-
uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@main
47+
uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@v1
4848
with:
4949
filenames: ${{ env.PACKAGE_FILE }}
5050
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
@@ -146,7 +146,7 @@ jobs:
146146
php_mongodb.pdb
147147
148148
- name: "Create detached DLL signature"
149-
uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@main
149+
uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@v1
150150
with:
151151
filenames: php_mongodb.dll
152152
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
# our tag and creates the release tag. This is run inside the container in
107107
# order to create signed git artifacts
108108
- name: "Create package commit and release tag"
109-
uses: mongodb-labs/drivers-github-tools/garasign/git-sign@main
109+
uses: mongodb-labs/drivers-github-tools/garasign/git-sign@v1
110110
with:
111111
command: "$(pwd)/.github/workflows/commit-and-tag.sh ${{ env.PACKAGE_VERSION }} ${{ vars.GPG_KEY_ID }} tag-message"
112112
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
@@ -121,7 +121,7 @@ jobs:
121121

122122
# Create a signed "back to -dev" commit, again inside the container
123123
- name: "Create dev commit"
124-
uses: mongodb-labs/drivers-github-tools/garasign/git-sign@main
124+
uses: mongodb-labs/drivers-github-tools/garasign/git-sign@v1
125125
with:
126126
# Setup can be skipped as it was already done before
127127
skip_setup: true

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,41 @@ jobs:
7272
run: TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test
7373
env:
7474
MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}
75+
76+
pecl-test:
77+
name: "Test PECL package"
78+
runs-on: "ubuntu-latest"
79+
env:
80+
PHP_VERSION: "8.3"
81+
82+
steps:
83+
- name: "Checkout"
84+
uses: "actions/checkout@v4"
85+
with:
86+
submodules: true
87+
88+
- name: "Build Driver"
89+
id: build-driver
90+
uses: ./.github/actions/linux/build
91+
with:
92+
version: ${{ env.PHP_VERSION }}
93+
94+
- name: "Write changelog file for packaging"
95+
run: echo "Testing" > changelog
96+
97+
- name: "Build package.xml"
98+
run: "make package.xml RELEASE_NOTES_FILE=$(pwd)/changelog"
99+
100+
- name: "Build PECL package"
101+
run: "make package"
102+
103+
# PECL always uses the version for the package name.
104+
# Read it from the version file and store in env to use when uploading artifacts
105+
- name: "Read current package version"
106+
run: |
107+
PACKAGE_VERSION=$(./bin/update-release-version.php get-version)
108+
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> "$GITHUB_ENV"
109+
echo "PACKAGE_FILE=mongodb-${PACKAGE_VERSION}.tgz" >> "$GITHUB_ENV"
110+
111+
- name: "Install release archive to verify correctness"
112+
run: sudo pecl install ${{ env.PACKAGE_FILE }}

config.m4

Lines changed: 63 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,28 @@ if test "$PHP_MONGODB" != "no"; then
2424
dnl Check PHP version is compatible with this extension
2525
AC_MSG_CHECKING([PHP version])
2626

27-
if test -z "$PHP_CONFIG"; then
28-
AC_MSG_ERROR([php-config not found])
29-
fi
27+
if test -z "${PHP_VERSION_ID}"; then
28+
if test -z "$PHP_CONFIG"; then
29+
AC_MSG_ERROR([php-config not found])
30+
fi
3031

31-
PHP_MONGODB_PHP_VERSION=`${PHP_CONFIG} --version`
32-
PHP_MONGODB_PHP_VERSION_ID=`${PHP_CONFIG} --vernum`
32+
PHP_MONGODB_PHP_VERSION=`${PHP_CONFIG} --version`
33+
PHP_MONGODB_PHP_VERSION_ID=`${PHP_CONFIG} --vernum`
34+
else
35+
PHP_MONGODB_PHP_VERSION="${PHP_VERSION}"
36+
PHP_MONGODB_PHP_VERSION_ID="${PHP_VERSION_ID}"
37+
fi
3338

3439
AC_MSG_RESULT($PHP_MONGODB_PHP_VERSION)
3540

3641
if test "$PHP_MONGODB_PHP_VERSION_ID" -lt "70400"; then
3742
AC_MSG_ERROR([not supported. Need a PHP version >= 7.4.0 (found $PHP_MONGODB_PHP_VERSION)])
3843
fi
3944

45+
PHP_MONGODB_STD_CFLAGS=""
46+
PHP_MONGODB_DEV_CFLAGS=""
47+
PHP_MONGODB_COVERAGE_CFLAGS=""
48+
4049
PHP_ARG_ENABLE([mongodb-developer-flags],
4150
[whether to enable developer build flags],
4251
[AS_HELP_STRING([--enable-mongodb-developer-flags],
@@ -46,54 +55,53 @@ if test "$PHP_MONGODB" != "no"; then
4655
PHP_MONGODB_VALIDATE_ARG([PHP_MONGODB_DEVELOPER_FLAGS], [yes no])
4756

4857
if test "$PHP_MONGODB_DEVELOPER_FLAGS" = "yes"; then
58+
PHP_MONGODB_STD_CFLAGS="-g -O0 -Wall"
59+
4960
dnl Warn about functions which might be candidates for format attributes
50-
AX_CHECK_COMPILE_FLAG(-Wmissing-format-attribute, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmissing-format-attribute" ,, -Werror)
61+
AX_CHECK_COMPILE_FLAG(-Wmissing-format-attribute, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wmissing-format-attribute" ,, -Werror)
5162
dnl Avoid duplicating values for an enum
52-
AX_CHECK_COMPILE_FLAG(-Wduplicate-enum, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wduplicate-enum" ,, -Werror)
63+
AX_CHECK_COMPILE_FLAG(-Wduplicate-enum, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wduplicate-enum" ,, -Werror)
5364
dnl Warns on mismatches between #ifndef and #define header guards
54-
AX_CHECK_COMPILE_FLAG(-Wheader-guard, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wheader-guard" ,, -Werror)
65+
AX_CHECK_COMPILE_FLAG(-Wheader-guard, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wheader-guard" ,, -Werror)
5566
dnl logical not of a non-boolean expression
56-
AX_CHECK_COMPILE_FLAG(-Wlogical-not-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-not-parentheses" ,, -Werror)
67+
AX_CHECK_COMPILE_FLAG(-Wlogical-not-parentheses, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wlogical-not-parentheses" ,, -Werror)
5768
dnl Warn about suspicious uses of logical operators in expressions
58-
AX_CHECK_COMPILE_FLAG(-Wlogical-op, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op" ,, -Werror)
69+
AX_CHECK_COMPILE_FLAG(-Wlogical-op, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wlogical-op" ,, -Werror)
5970
dnl memory error detector.
6071
dnl FIXME: -fsanitize=address,undefined for clang. The AX_CHECK_COMPILE_FLAG macro isn't happy about that string :(
61-
AX_CHECK_COMPILE_FLAG(-fsanitize-address, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fsanitize-address" ,, -Werror)
72+
AX_CHECK_COMPILE_FLAG(-fsanitize-address, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -fsanitize-address" ,, -Werror)
6273
dnl Enable frame debugging
63-
AX_CHECK_COMPILE_FLAG(-fno-omit-frame-pointer, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-omit-frame-pointer" ,, -Werror)
74+
AX_CHECK_COMPILE_FLAG(-fno-omit-frame-pointer, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -fno-omit-frame-pointer" ,, -Werror)
6475
dnl Make sure we don't optimize calls
65-
AX_CHECK_COMPILE_FLAG(-fno-optimize-sibling-calls, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-optimize-sibling-calls" ,, -Werror)
66-
AX_CHECK_COMPILE_FLAG(-Wlogical-op-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op-parentheses" ,, -Werror)
67-
AX_CHECK_COMPILE_FLAG(-Wpointer-bool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wpointer-bool-conversion" ,, -Werror)
68-
AX_CHECK_COMPILE_FLAG(-Wbool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wbool-conversion" ,, -Werror)
69-
AX_CHECK_COMPILE_FLAG(-Wloop-analysis, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wloop-analysis" ,, -Werror)
70-
AX_CHECK_COMPILE_FLAG(-Wsizeof-array-argument, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wsizeof-array-argument" ,, -Werror)
71-
AX_CHECK_COMPILE_FLAG(-Wstring-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wstring-conversion" ,, -Werror)
72-
AX_CHECK_COMPILE_FLAG(-Wno-variadic-macros, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-variadic-macros" ,, -Werror)
73-
AX_CHECK_COMPILE_FLAG(-Wno-sign-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-sign-compare" ,, -Werror)
74-
AX_CHECK_COMPILE_FLAG(-fstack-protector, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fstack-protector" ,, -Werror)
75-
AX_CHECK_COMPILE_FLAG(-fno-exceptions, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-exceptions" ,, -Werror)
76-
AX_CHECK_COMPILE_FLAG(-Wformat-security, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-security" ,, -Werror)
77-
AX_CHECK_COMPILE_FLAG(-Wformat-nonliteral, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-nonliteral" ,, -Werror)
78-
AX_CHECK_COMPILE_FLAG(-Winit-self, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Winit-self" ,, -Werror)
79-
AX_CHECK_COMPILE_FLAG(-Wwrite-strings, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wwrite-strings" ,, -Werror)
80-
AX_CHECK_COMPILE_FLAG(-Wenum-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wenum-compare" ,, -Werror)
81-
AX_CHECK_COMPILE_FLAG(-Wempty-body, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wempty-body" ,, -Werror)
82-
AX_CHECK_COMPILE_FLAG(-Wparentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wparentheses" ,, -Werror)
83-
AX_CHECK_COMPILE_FLAG(-Wmaybe-uninitialized, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmaybe-uninitialized" ,, -Werror)
84-
AX_CHECK_COMPILE_FLAG(-Wimplicit-fallthrough, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wimplicit-fallthrough" ,, -Werror)
85-
AX_CHECK_COMPILE_FLAG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror" ,, -Werror)
86-
AX_CHECK_COMPILE_FLAG(-Wextra, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wextra" ,, -Werror)
87-
AX_CHECK_COMPILE_FLAG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter" ,, -Werror)
88-
AX_CHECK_COMPILE_FLAG(-Wno-unused-but-set-variable, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-but-set-variable" ,, -Werror)
89-
AX_CHECK_COMPILE_FLAG(-Wno-missing-field-initializers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-missing-field-initializers",, -Werror)
76+
AX_CHECK_COMPILE_FLAG(-fno-optimize-sibling-calls, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -fno-optimize-sibling-calls" ,, -Werror)
77+
AX_CHECK_COMPILE_FLAG(-Wlogical-op-parentheses, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wlogical-op-parentheses" ,, -Werror)
78+
AX_CHECK_COMPILE_FLAG(-Wpointer-bool-conversion, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wpointer-bool-conversion" ,, -Werror)
79+
AX_CHECK_COMPILE_FLAG(-Wbool-conversion, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wbool-conversion" ,, -Werror)
80+
AX_CHECK_COMPILE_FLAG(-Wloop-analysis, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wloop-analysis" ,, -Werror)
81+
AX_CHECK_COMPILE_FLAG(-Wsizeof-array-argument, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wsizeof-array-argument" ,, -Werror)
82+
AX_CHECK_COMPILE_FLAG(-Wstring-conversion, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wstring-conversion" ,, -Werror)
83+
AX_CHECK_COMPILE_FLAG(-Wno-variadic-macros, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wno-variadic-macros" ,, -Werror)
84+
AX_CHECK_COMPILE_FLAG(-Wno-sign-compare, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wno-sign-compare" ,, -Werror)
85+
AX_CHECK_COMPILE_FLAG(-fstack-protector, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -fstack-protector" ,, -Werror)
86+
AX_CHECK_COMPILE_FLAG(-fno-exceptions, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -fno-exceptions" ,, -Werror)
87+
AX_CHECK_COMPILE_FLAG(-Wformat-security, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wformat-security" ,, -Werror)
88+
AX_CHECK_COMPILE_FLAG(-Wformat-nonliteral, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wformat-nonliteral" ,, -Werror)
89+
AX_CHECK_COMPILE_FLAG(-Winit-self, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Winit-self" ,, -Werror)
90+
AX_CHECK_COMPILE_FLAG(-Wwrite-strings, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wwrite-strings" ,, -Werror)
91+
AX_CHECK_COMPILE_FLAG(-Wenum-compare, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wenum-compare" ,, -Werror)
92+
AX_CHECK_COMPILE_FLAG(-Wempty-body, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wempty-body" ,, -Werror)
93+
AX_CHECK_COMPILE_FLAG(-Wparentheses, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wparentheses" ,, -Werror)
94+
AX_CHECK_COMPILE_FLAG(-Wmaybe-uninitialized, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wmaybe-uninitialized" ,, -Werror)
95+
AX_CHECK_COMPILE_FLAG(-Wimplicit-fallthrough, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wimplicit-fallthrough" ,, -Werror)
96+
AX_CHECK_COMPILE_FLAG(-Werror, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Werror" ,, -Werror)
97+
AX_CHECK_COMPILE_FLAG(-Wextra, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wextra" ,, -Werror)
98+
AX_CHECK_COMPILE_FLAG(-Wno-unused-parameter, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wno-unused-parameter" ,, -Werror)
99+
AX_CHECK_COMPILE_FLAG(-Wno-unused-but-set-variable, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wno-unused-but-set-variable" ,, -Werror)
100+
AX_CHECK_COMPILE_FLAG(-Wno-missing-field-initializers, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wno-missing-field-initializers",, -Werror)
90101

91102
if test "$PHP_MONGODB_PHP_VERSION_ID" -ge "80108"; then
92-
AX_CHECK_COMPILE_FLAG(-Wstrict-prototypes, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wstrict-prototypes",, -Werror)
103+
AX_CHECK_COMPILE_FLAG(-Wstrict-prototypes, PHP_MONGODB_DEV_CFLAGS="$PHP_MONGODB_DEV_CFLAGS -Wstrict-prototypes",, -Werror)
93104
fi
94-
95-
MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS"
96-
STD_CFLAGS="-g -O0 -Wall"
97105
fi
98106

99107

@@ -110,13 +118,11 @@ if test "$PHP_MONGODB" != "no"; then
110118
AC_MSG_ERROR(code coverage is not supported for static builds)
111119
fi
112120

113-
COVERAGE_CFLAGS="--coverage -g"
114-
COVERAGE_LDFLAGS="--coverage"
115-
116-
MONGODB_SHARED_LIBADD="$MONGODB_SHARED_LIBADD $COVERAGE_LDFLAGS"
121+
PHP_MONGODB_COVERAGE_CFLAGS="--coverage -g"
122+
MONGODB_SHARED_LIBADD="$MONGODB_SHARED_LIBADD --coverage"
117123
fi
118124

119-
PHP_MONGODB_CFLAGS="$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS"
125+
PHP_MONGODB_CFLAGS="$PHP_MONGODB_STD_CFLAGS $PHP_MONGODB_DEV_CFLAGS $PHP_MONGODB_COVERAGE_CFLAGS"
120126

121127
PHP_MONGODB_SOURCES="\
122128
php_phongo.c \
@@ -307,7 +313,7 @@ if test "$PHP_MONGODB" != "no"; then
307313
fi
308314

309315
if test "$PHP_MONGODB_SYSTEM_LIBS" = "no"; then
310-
PHP_MONGODB_BUNDLED_CFLAGS="$STD_CFLAGS -DBSON_COMPILATION -DMONGOC_COMPILATION"
316+
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_STD_CFLAGS -DBSON_COMPILATION -DMONGOC_COMPILATION"
311317

312318
dnl CheckUtf8Proc.m4 will modify this when using bundled utf8proc
313319
PHP_MONGODB_UTF8PROC_CFLAGS=""
@@ -318,6 +324,9 @@ if test "$PHP_MONGODB" != "no"; then
318324
dnl Endian.m4 will modify this when using bundled libmongocrypt
319325
PHP_MONGODB_LIBMONGOCRYPT_CFLAGS=""
320326

327+
dnl Save CPPFLAGS, which PlatformFlags.m4 modifies for subsequent M4 scripts
328+
old_CPPFLAGS="$CPPFLAGS"
329+
321330
dnl Avoid using AC_CONFIG_MACRO_DIR, which might conflict with PHP
322331
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/m4/ax_check_compile_flag.m4)
323332
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/m4/ax_prototype.m4)
@@ -350,6 +359,9 @@ if test "$PHP_MONGODB" != "no"; then
350359
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongocrypt/Endian.m4)
351360
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongocrypt/Version.m4)
352361

362+
dnl Restore CPPFLAGS once all M4 scripts have executed
363+
CPPFLAGS="$old_CPPFLAGS"
364+
353365
PHP_MONGODB_BSON_VERSION_STRING="Bundled ($libbson_VERSION_FULL)"
354366
PHP_MONGODB_MONGOC_VERSION_STRING="Bundled ($libmongoc_VERSION_FULL)"
355367

@@ -510,7 +522,6 @@ if test "$PHP_MONGODB" != "no"; then
510522
dnl This must come after PHP_NEW_EXTENSION, otherwise the srcdir won't be set
511523
PHP_ADD_MAKEFILE_FRAGMENT
512524

513-
dnl The libmongocrypt line intentionally uses the PHP_LIBBSON flag as that decides whether to build against bundled or system libraries.
514525
AC_CONFIG_COMMANDS_POST([
515526
if test "$enable_static" = "no"; then
516527
echo "
@@ -519,9 +530,10 @@ mongodb was configured with the following options:
519530
Build configuration:
520531
CC : $CC
521532
CFLAGS : $CFLAGS
522-
Extra CFLAGS : $STD_CFLAGS $EXTRA_CFLAGS
523-
Developers flags (slow) : $MAINTAINER_CFLAGS
524-
Code Coverage flags (extra slow) : $COVERAGE_CFLAGS
533+
CPPFLAGS : $CPPFLAGS
534+
Extra flags : $PHP_MONGODB_STD_CFLAGS
535+
Developer flags (slow) : $PHP_MONGODB_DEV_CFLAGS
536+
Code Coverage flags (extra slow) : $PHP_MONGODB_COVERAGE_CFLAGS
525537
libmongoc : $PHP_MONGODB_BSON_VERSION_STRING
526538
libbson : $PHP_MONGODB_MONGOC_VERSION_STRING
527539
libmongocrypt : $PHP_MONGODB_MONGOCRYPT_VERSION_STRING

scripts/autotools/CheckCompiler.m4

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dnl so call it once more to ensure C99 remains enabled
1616
m4_version_prereq([2.70],,[AC_PROG_CC_C99])
1717

1818
# Check that an appropriate C compiler is available.
19+
# Note: BEGIN_IGNORE_DEPRECATIONS macro requires GCC 4.6+.
1920
c_compiler="unknown"
2021
AC_LANG_PUSH([C])
2122
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
@@ -26,26 +27,12 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
2627
#define GCC_VERSION (__GNUC__ * 10000 \
2728
+ __GNUC_MINOR__ * 100 \
2829
+ __GNUC_PATCHLEVEL__)
29-
#if GCC_VERSION < 40100
30+
#if GCC_VERSION < 40600
3031
#error Not a supported GCC compiler
3132
#endif
3233
#endif
3334
])], [c_compiler="gcc"], [])
3435

35-
# If our BEGIN_IGNORE_DEPRECATIONS macro won't work, pass
36-
# -Wno-deprecated-declarations
37-
38-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
39-
#if !defined(__clang__) && defined(__GNUC__)
40-
#define GCC_VERSION (__GNUC__ * 10000 \
41-
+ __GNUC_MINOR__ * 100 \
42-
+ __GNUC_PATCHLEVEL__)
43-
#if GCC_VERSION < 40600
44-
#error Does not support deprecation warning pragmas
45-
#endif
46-
#endif
47-
])], [], [STD_CFLAGS="$STD_CFLAGS -Wno-deprecated-declarations"])
48-
4936
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
5037
#if defined(__clang__)
5138
#define CLANG_VERSION (__clang_major__ * 10000 \
@@ -65,7 +52,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
6552
AC_LANG_POP([C])
6653

6754
if test "$c_compiler" = "unknown"; then
68-
AC_MSG_ERROR([Compiler GCC >= 4.1 or Clang >= 3.3 is required for C compilation])
55+
AC_MSG_ERROR([Compiler GCC >= 4.6 or Clang >= 3.3 is required for C compilation])
6956
fi
7057

7158
AC_C_CONST

0 commit comments

Comments
 (0)