]> granicus.if.org Git - php/commitdiff
Fixed build (Only PHP above 7.1 could run the gen_stub.php)
authorXinchen Hui <laruence@gmail.com>
Wed, 12 Feb 2020 06:22:01 +0000 (14:22 +0800)
committerXinchen Hui <laruence@gmail.com>
Wed, 12 Feb 2020 06:22:01 +0000 (14:22 +0800)
build/Makefile.global

index 81bf7bed2190796868e5b41bdd28d016ea68672f..7348e253c1cada85ebe7f3567a7f4567f7ad26e8 100644 (file)
@@ -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