dnl ref) https://github.com/kjdev/php-ext-jq/blob/master/config.m4
AC_MSG_CHECKING(PHP version)
if test ! -z "$phpincludedir"; then
- PHP_VERSION=`grep 'PHP_VERSION ' $phpincludedir/main/php_version.h | sed -e 's/.*"\([[0-9\.]]*\)".*/\1/g' 2>/dev/null`
+ PHP_VERSION=`grep 'PHP_VERSION ' $phpincludedir/main/php_version.h | sed -e 's/.*"\([[0-9\.]]*\)[["-]].*/\1/g' 2>/dev/null`
elif test ! -z "$PHP_CONFIG"; then
PHP_VERSION=`$PHP_CONFIG --version 2>/dev/null`
fi
if test $PHP_MAJOR_VERSION -eq 5 -a $PHP_MINOR_VERSION -lt 1; then
AC_MSG_ERROR([need at least PHP 5.1 or newer])
-fi
\ No newline at end of file
+fi