From f9db357623434e8583a22553d26aeaa375b97e05 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 25 Apr 2019 22:44:56 +0200 Subject: [PATCH] Automatically remove aclocal.m4 if present 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/build.mk | 4 +++- scripts/phpize.in | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build/build.mk b/build/build.mk index 2e261b7824..678cbe90af 100644 --- a/build/build.mk +++ b/build/build.mk @@ -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 diff --git a/scripts/phpize.in b/scripts/phpize.in index 7a10a369bf..0d89341a75 100644 --- a/scripts/phpize.in +++ b/scripts/phpize.in @@ -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 -- 2.49.0