Automatically remove aclocal.m4 if present

Commit 4e7064d173 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.
This commit is contained in:
Peter Kokot 2019-04-25 22:44:56 +02:00
parent 78bed33862
commit f9db357623
2 changed files with 7 additions and 1 deletions

View file

@ -31,8 +31,10 @@ $(stamp): build/buildcheck.sh
@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

View file

@ -157,6 +157,10 @@ phpize_replace_prefix()
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