]> granicus.if.org Git - php/commitdiff
Automatically remove aclocal.m4 if present
authorPeter Kokot <peterkokot@gmail.com>
Thu, 25 Apr 2019 20:44:56 +0000 (22:44 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Sun, 28 Apr 2019 19:05:34 +0000 (21:05 +0200)
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
scripts/phpize.in

index 2e261b7824f0b789b76c20da1c6cde338dd1c3d4..678cbe90afd250dcf9f6b6a6a841a479e26c24fa 100644 (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
index 7a10a369bf8e1e838f6fdcfc21587e7bf69448df..0d89341a75f7b2f14ec83a3d41f9955ff03e406a 100644 (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