-php: check $(bindir)/php
-
-$(srcdir)/php-versions.json: $(srcdir)/php-version.php
- curl -Sso $@ "http://php.net/releases/index.php?json&version=5&max=-1"
-
-$(srcdir)/php-$(PHP_VERSION)/configure: | $(srcdir)/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 \
+ echo extension=$$EXT_SONAME >> $(PECL_INI); \
+ fi \
+ done
+
+$(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)