-php: check $(bindir)/php
-
-$(PHP_VERSIONS_JSON): $(srcdir)/php-version.php
- curl -Sso $@ "http://php.net/releases/index.php?json&version=$(PHP_VERSION_MAJOR)&max=-1"
-
-$(srcdir)/php-$(PHP_VERSION)/configure: | $(PHP_VERSIONS_JSON)
- if test $(PHP_VERSION) = "master"; then \
- cd $(srcdir) && git clone --depth 1 -b master https://github.com/php/php-src php-master && cd php-master && ./buildconf; \
- else \
- curl -Ss $(PHP_MIRROR)/php-$(PHP_VERSION).tar.bz2 | tar xj -C $(srcdir); \
- fi
-
-$(srcdir)/php-$(PHP_VERSION)/Makefile: $(srcdir)/php-$(PHP_VERSION)/configure | $(PHP_VERSIONS_JSON)
- cd $(srcdir)/php-$(PHP_VERSION) && ./configure -C --prefix=$(prefix)
-
-$(srcdir)/php-$(PHP_VERSION)/sapi/cli/php: $(srcdir)/php-$(PHP_VERSION)/Makefile | $(PHP_VERSIONS_JSON)
+php: check $(bindir)/php | $(PECL_INI)
+ -for EXT_SONAME in $(extdir)/*.so; do \
+ EXT_SONAME=$$(basename $$EXT_SONAME); \
+ if test "$$EXT_SONAME" != "*.so" && ! grep -q extension=$$EXT_SONAME $(PECL_INI); then \
+ if test "$$EXT_SONAME" = "opcache.so"; then \
+ echo zend_extension=$$EXT_SONAME >> $(PECL_INI); \
+ else \
+ echo extension=$$EXT_SONAME >> $(PECL_INI); \
+ fi; \
+ fi \
+ done
+
+$(srcdir)/php-$(PHP_VERSION)/configure: | $(PHP_RELEASES)
+ cd $(srcdir) && awk -F "\t" '/^$(PHP)\t/{exit system($$3)}' <$|
+
+$(srcdir)/php-$(PHP_VERSION)/Makefile: $(srcdir)/php-$(PHP_VERSION)/configure | $(PHP_RELEASES)
+ cd $(srcdir)/php-$(PHP_VERSION) && ./configure --cache-file=config.cache --prefix=$(prefix)
+
+$(srcdir)/php-$(PHP_VERSION)/sapi/cli/php: $(srcdir)/php-$(PHP_VERSION)/Makefile | $(PHP_RELEASES)