From 9e5650265c21245a1920ae444d70806600039195 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Wed, 12 Feb 2020 14:22:01 +0800 Subject: [PATCH] Fixed build (Only PHP above 7.1 could run the gen_stub.php) --- build/Makefile.global | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/Makefile.global b/build/Makefile.global index 81bf7bed21..7348e253c1 100644 --- a/build/Makefile.global +++ b/build/Makefile.global @@ -142,8 +142,15 @@ prof-clean: prof-use: CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-use all +# olny php above 7.1.0 supports nullable return type %_arginfo.h: %.stub.php - if type php >/dev/null 2>/dev/null; then php $(top_srcdir)/scripts/dev/gen_stub.php $<; fi + -@if type php >/dev/null 2>/dev/null; \ + then \ + if test `php -v | head -n1 | cut -d" " -f 2 | sed "s/$$/\n7.0.99/" | sort -rV | head -n1` != "7.0.99"; \ + then \ + php $(top_srcdir)/scripts/dev/gen_stub.php $<; \ + fi; \ + fi; # As we don't track includes, this is just a heuristic %.c: %_arginfo.h -- 2.40.0