]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Define AC_REQUIRE_AUX_FILE with AC_DEFUN.
authorZack Weinberg <zackw@panix.com>
Thu, 5 Nov 2020 13:59:46 +0000 (08:59 -0500)
committerZack Weinberg <zackw@panix.com>
Thu, 5 Nov 2020 13:59:46 +0000 (08:59 -0500)
Some widely used Automake recipes involve putting AC_REQUIRE_AUX_FILE
at top level of a configure script, and it uses AC_REQUIRE now, so it
needs to be defined with AC_DEFUN.

* lib/autoconf/general.m4 (AC_REQUIRE_AUX_FILE): Define with AC_DEFUN.
* tests/torture.at (Missing auxiliary files (foreign)): New test.

lib/autoconf/general.m4
tests/torture.at

index 4ec2317cbb3c3744091405b83a54367987ef9573..b74a441f0d6bc3f9fab917804b0ab1bc0b00b35c 100644 (file)
@@ -1789,7 +1789,7 @@ AC_DEFUN([AC_CONFIG_AUX_DIRS],
 # required auxiliary files, the script will bomb out.  This macro may also
 # be used as a trace hook by tools that wish to identify all of the required
 # auxiliary files.
-m4_define([AC_REQUIRE_AUX_FILE],
+AC_DEFUN([AC_REQUIRE_AUX_FILE],
 [AS_LITERAL_WORD_IF([$1],
   [m4_do(
     [AC_REQUIRE([_AC_INIT_AUX_DIR])],
index a96af65142d14bc62dc510b7110eff173ea5f9cc..46466f3442ad05952d9fd6969b9049a02dbbcc6d 100644 (file)
@@ -1964,7 +1964,7 @@ AT_CLEANUP
 ## Missing auxiliary files.  ##
 ## ------------------------- ##
 
-AT_SETUP([Missing auxiliary files])
+AT_SETUP([Missing auxiliary files (config.*)])
 AT_KEYWORDS([autoreconf])
 
 # Prevent autoreconf from running aclocal, which might not exist,
@@ -2023,6 +2023,12 @@ AT_CHECK([test ! -e build-aux/install-sh])
 
 AT_CHECK_CONFIGURE
 
+AT_CLEANUP
+
+
+AT_SETUP([Missing auxiliary files (install-sh)])
+AT_KEYWORDS([autoreconf])
+
 # Repeat all the above tests with a configure script that _doesn't_
 # need config.{sub,guess} but does need install-sh.
 
@@ -2062,6 +2068,47 @@ AT_CHECK_CONFIGURE
 
 AT_CLEANUP
 
+
+AT_SETUP([Missing auxiliary files (foreign)])
+AT_KEYWORDS([autoreconf])
+
+# If an aux file is required that autoreconf doesn't know how to install,
+# it shouldn't suggest autoreconf --install.
+# This also verifies that AC_REQUIRE_AUX_FILE can be used outside of a
+# macro definition, which was always the intent, and was recommended
+# usage in some automake recipes, but which was broken in autoconf
+# beta 2.69d (see https://savannah.gnu.org/support/?110363).
+
+AT_DATA([configure.ac],
+[[AC_INIT([GNU foo], [1.0])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_REQUIRE_AUX_FILE([tap-driver.sh])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([], [1], [ignore],
+[configure: error: cannot find required auxiliary files: tap-driver.sh
+])
+
+AT_CHECK([autoreconf], 1, [],
+[configure.ac: error: required file 'tap-driver.sh' not found
+])
+AT_CHECK([test ! -e build-aux])
+
+AT_CHECK([autoreconf --install], 1, [],
+[configure.ac: error: required file 'tap-driver.sh' not found
+])
+# autoreconf --install always creates the aux directory.
+AT_CHECK([test -e build-aux])
+
+touch build-aux/tap-driver.sh
+
+AT_CHECK([autoreconf])
+AT_CHECK_CONFIGURE
+
+AT_CLEANUP
+
 ## ------------------------------ ##
 ## Files clobbered by AC_OPENMP.  ##
 ## ------------------------------ ##