Skip to content

Commit 9e56502

Browse files
committed
Fixed build (Only PHP above 7.1 could run the gen_stub.php)
1 parent 5cf9710 commit 9e56502

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

build/Makefile.global

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,15 @@ prof-clean:
142142
prof-use:
143143
CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-use all
144144

145+
# olny php above 7.1.0 supports nullable return type
145146
%_arginfo.h: %.stub.php
146-
if type php >/dev/null 2>/dev/null; then php $(top_srcdir)/scripts/dev/gen_stub.php $<; fi
147+
-@if type php >/dev/null 2>/dev/null; \
148+
then \
149+
if test `php -v | head -n1 | cut -d" " -f 2 | sed "s/$$/\n7.0.99/" | sort -rV | head -n1` != "7.0.99"; \
150+
then \
151+
php $(top_srcdir)/scripts/dev/gen_stub.php $<; \
152+
fi; \
153+
fi;
147154

148155
# As we don't track includes, this is just a heuristic
149156
%.c: %_arginfo.h

0 commit comments

Comments
 (0)