File tree 3 files changed +27
-8
lines changed 3 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -142,17 +142,11 @@ prof-clean:
142
142
prof-use:
143
143
CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-use all
144
144
145
- # only php above 7.1.0 supports nullable return type
146
145
%_arginfo.h: %.stub.php
147
146
@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 \
149
148
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 $<; \
156
150
fi; \
157
151
fi;
158
152
Original file line number Diff line number Diff line change @@ -1876,6 +1876,30 @@ AC_DEFUN([PHP_PROG_RE2C],[
1876
1876
PHP_SUBST(RE2C)
1877
1877
] )
1878
1878
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
+
1879
1903
dnl ----------------------------------------------------------------------------
1880
1904
dnl Common setup macros: PHP_SETUP_<what>
1881
1905
dnl ----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ dnl Checks for some support/generator progs.
155
155
PHP_PROG_AWK
156
156
PHP_PROG_BISON([ 3.0.0] )
157
157
PHP_PROG_RE2C([ 0.13.4] )
158
+ PHP_PROG_PHP()
158
159
159
160
PHP_ARG_ENABLE([ re2c-cgoto] ,
160
161
[ whether to enable computed goto gcc extension with re2c] ,
You can’t perform that action at this time.
0 commit comments