Skip to content

Commit 80b9f3e

Browse files
committed
Compile with no-cast-qual for PHP 5.3
1 parent c5eb198 commit 80b9f3e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

config.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ if test "$MONGODB" != "no"; then
111111
PHP_CHECK_GCC_ARG(-Wdeclaration-after-statement, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdeclaration-after-statement")
112112
dnl PHP_CHECK_GCC_ARG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror")
113113

114+
PHP_MONGODB_FOUND_VERSION=`${PHP_CONFIG} --version`
115+
PHP_MONGODB_FOUND_VERNUM=`echo "${PHP_MONGODB_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 100 + [$]2) * 100 + [$]3;}'`
116+
117+
if test "$PHP_MONGODB_FOUND_VERNUM" -ge "50400"; then
118+
PHP_CHECK_GCC_ARG(-Wno-cast-qual, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-cast-qual")
119+
fi
114120

115121
MAINTAINER_CFLAGS="-Wextra $_MAINTAINER_CFLAGS -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-missing-field-initializers"
116122
STD_CFLAGS="-g -O0 -Wall"

0 commit comments

Comments
 (0)