Skip to content

PHPC-2275: Always consult php-config for PHP version check in config.m4 #1477

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 1 commit into from
Oct 10, 2023
Merged
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
15 changes: 6 additions & 9 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ if test "$PHP_MONGODB" != "no"; then
dnl Check PHP version is compatible with this extension
AC_MSG_CHECKING([PHP version])

PHP_MONGODB_PHP_VERSION=$PHP_VERSION
PHP_MONGODB_PHP_VERSION_ID=$PHP_VERSION_ID

if test -z "$PHP_MONGODB_PHP_VERSION"; then
if test -z "$PHP_CONFIG"; then
AC_MSG_ERROR([php-config not found])
fi
PHP_MONGODB_PHP_VERSION=`${PHP_CONFIG} --version`
PHP_MONGODB_PHP_VERSION_ID=`echo "${PHP_MONGODB_PHP_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 100 + [$]2) * 100 + [$]3;}'`
if test -z "$PHP_CONFIG"; then
AC_MSG_ERROR([php-config not found])
fi

PHP_MONGODB_PHP_VERSION=`${PHP_CONFIG} --version`
PHP_MONGODB_PHP_VERSION_ID=`${PHP_CONFIG} --vernum`

AC_MSG_RESULT($PHP_MONGODB_PHP_VERSION)

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