Commit
4e7064d173d2b5b22e159fcf52d22b10213b67b8 removed the usage of
`aclocal.m4`. When using Git repositories, many times cleaning of the
generated files is not done prior to running phpize or buildconf. For
example:
git clone git://github.com/php/php-src
cd php-src
git checkout PHP-7.3
./buildconf
./configure
git checkout PHP-7.4
./buildconf # -> warnings
./configure # -> errors
To not accidentally include `aclocal.m4` file in the generated configure
this enhances build system experience a bit more by removing aclocal.m4
file prior to start building configure file using phpize or buildconf.
@build/buildcheck.sh $@
configure: configure.ac $(PHP_M4_FILES)
+# Remove aclocal.m4 if present. It is automatically included by autoconf but
+# not used by the PHP build system since PHP 7.4.
@echo rebuilding $@
- @rm -f $@
+ @rm -f $@ aclocal.m4
@$(PHP_AUTOCONF) $(PHP_AUTOCONF_FLAGS)
$(config_h_in): configure
phpize_autotools()
{
+ # Remove aclocal.m4 if present. It is automatically included by autoconf but
+ # not used by the PHP build system since PHP 7.4.
+ rm -f aclocal.m4
+
$PHP_AUTOCONF || exit 1
$PHP_AUTOHEADER || exit 1