Skip to content

Commit 9c5fb54

Browse files
committed
Improved the check
makefile.global is also used while building shared extension
1 parent df71503 commit 9c5fb54

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

build/Makefile.global

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,19 @@ prof-use:
144144

145145
# olny php above 7.1.0 supports nullable return type
146146
%_arginfo.h: %.stub.php
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;
147+
@if test -e "$(top_srcdir)/scripts/dev/gen_stub.php"; then \
148+
if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
149+
$(PHP_EXECUTABLE) $(top_srcdir)/scripts/dev/gen_stub.php $<; \
150+
elif type php >/dev/null 2>/dev/null; then \
151+
if test `php -v | head -n1 | cut -d" " -f 2 | sed "s/$$/\n7.0.99/" | sort -rV | head -n1` != "7.0.99"; then \
152+
php $(top_srcdir)/scripts/dev/gen_stub.php $<; \
153+
fi; \
154+
fi; \
155+
fi;
154156

155157
# As we don't track includes, this is just a heuristic
156158
%.c: %_arginfo.h
157-
touch $@
159+
@touch $@
158160

159161
.PHONY: all clean install distclean test prof-gen prof-clean prof-use
160162
.NOEXPORT:

0 commit comments

Comments
 (0)