File tree Expand file tree Collapse file tree 3 files changed +27
-8
lines changed
Expand file tree Collapse file tree 3 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -142,17 +142,11 @@ prof-clean:
142142prof-use:
143143 CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-use all
144144
145- # only php above 7.1.0 supports nullable return type
146145%_arginfo.h: %.stub.php
147146 @if test -e "$(top_srcdir)/build/gen_stub.php"; then \
148- if test ! -z "$(PHP_EXECUTABLE )" && test -x "$(PHP_EXECUTABLE )"; then \
147+ if test ! -z "$(PHP )" && test -x "$(PHP )"; then \
149148 echo Parse $< to generate $@;\
150- $(PHP_EXECUTABLE) $(top_srcdir)/build/gen_stub.php $<; \
151- elif type php >/dev/null 2>/dev/null; then \
152- if test `php -v | head -n1 | cut -d" " -f 2 | sed "s/$$/\n7.0.99/" | sort -rV | head -n1` != "7.0.99"; then \
153- echo Parse $< to generate $@;\
154- php $(top_srcdir)/build/gen_stub.php $<; \
155- fi; \
149+ $(PHP) $(top_srcdir)/build/gen_stub.php $<; \
156150 fi; \
157151 fi;
158152
Original file line number Diff line number Diff line change @@ -1876,6 +1876,30 @@ AC_DEFUN([PHP_PROG_RE2C],[
18761876 PHP_SUBST(RE2C)
18771877] )
18781878
1879+ AC_DEFUN ( [ PHP_PROG_PHP] ,[
1880+ AC_CHECK_PROG ( PHP , php , php )
1881+
1882+ if test -n "$PHP"; then
1883+ AC_MSG_CHECKING ( [ for php version] )
1884+ php_version=$($PHP -v | head -n1 | cut -d ' ' -f 2)
1885+ if test -z "$php_version"; then
1886+ php_version=0.0.0
1887+ fi
1888+ ac_IFS=$IFS; IFS="."
1889+ set $php_version
1890+ IFS=$ac_IFS
1891+ php_version_num=`expr [ $] {1:-0} \* 10000 + [ $] {2:-0} \* 100 + [ $] {3:-0}`
1892+ dnl Minimum supported version for gen_stubs.php is PHP 7.1.
1893+ if test "$php_version_num" -lt 70100; then
1894+ AC_MSG_RESULT ( [ $php_version (too old)] )
1895+ unset PHP
1896+ else
1897+ AC_MSG_RESULT ( [ $php_version (ok)] )
1898+ fi
1899+ fi
1900+ PHP_SUBST(PHP)
1901+ ] )
1902+
18791903dnl ----------------------------------------------------------------------------
18801904dnl Common setup macros: PHP_SETUP_<what>
18811905dnl ----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ dnl Checks for some support/generator progs.
155155PHP_PROG_AWK
156156PHP_PROG_BISON([ 3.0.0] )
157157PHP_PROG_RE2C([ 0.13.4] )
158+ PHP_PROG_PHP()
158159
159160PHP_ARG_ENABLE([ re2c-cgoto] ,
160161 [ whether to enable computed goto gcc extension with re2c] ,
You can’t perform that action at this time.
0 commit comments