On 11/03/2012 06:05 AM, Stefano Lattarini wrote: > Similar to AC_CONFIG_MACRO_DIR, but accepts more than one argument. > This will allow projects to use several m4 macro local dirs. This is > especially important for projects that are used as nested subpackages > of larger projects. > > See also: > <http://lists.gnu.org/archive/html/autoconf/2011-12/msg00037.html> > <http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00010.html> > > * lib/autoconf/general.m4 (AC_CONFIG_MACRO_DIRS): New. Expands to the > empty anyway, since it is only meant to be traced by tools like aclocal > and autoreconf. > (AC_CONFIG_MACRO_DIR): Updated comments to mark it as obsolescent. It > does not elicit warnings yet, for backward-compatibility. > * doc/autoconf.texi (@node "Input"): Document AC_CONFIG_MACRO_DIRS rather > than to the obsolescent AC_CONFIG_MACRO_DIR. > * NEWS: Update. > > Suggested-by: Eric Blake <[email protected]> > Helped-by: Nick Bowler <[email protected]> > Signed-off-by: Stefano Lattarini <[email protected]>
I'm adding my own sign-off and squashing this in; basically, I'm
relaxing the documentation to plan for my subsequent patches where
AC_CONFIG_MACRO_DIR will not be treated as obsolescent, but leaving your
initial implementation separate from my improvements to make it clear
what my improvements accomplish.
diff --git i/NEWS w/NEWS
index 495266a..6d5b5e9 100644
--- i/NEWS
+++ w/NEWS
@@ -11,13 +11,12 @@ GNU Autoconf NEWS - User visible changes.
** Macros
- AC_CONFIG_MACRO_DIRS
- Use this macro to declare the directory for local M4 macros for aclocal.
- It will be supported by future versions of aclocal (starting from the
- Automake 1.13 release).
-
-- AC_CONFIG_MACRO_DIR
- This macro is now obsolescent. AC_CONFIG_MACRO_DIRS Should be used
- instead.
+ New macro, used to declare multiple directories when looking for
+ local M4 macros. This macro overcomes some of the shortfalls in the
+ older AC_CONFIG_MACRO_DIR, which could only be used once; although
+ the older macro remains for compatibility with older tools. The
+ newer macro will be used by the upcoming Automake 1.13 release to
+ eliminate the need to specify ACLOCAL_AMFLAGS in Makefile.am.
- AC_PROG_CC now prefers C11 if available, falling back on C99 and
then on C89 as before.
diff --git i/doc/autoconf.texi w/doc/autoconf.texi
index 1d80a6d..de81c25 100644
--- i/doc/autoconf.texi
+++ w/doc/autoconf.texi
@@ -2109,27 +2109,32 @@ Input
local macros can be found using @code{AC_CONFIG_MACRO_DIRS}.
@defmac AC_CONFIG_MACRO_DIRS (@var{dir1} [@var{dir2} ... @var{dirN}])
+@defmacx AC_CONFIG_MACRO_DIR (@var{dir})
@acindex{CONFIG_MACRO_DIRS}
+@acindex{CONFIG_MACRO_DIR}
Specify the given directories as the location of additional local Autoconf
-macros. This macro is intended for use by future versions of commands like
+macros. These macros are intended for use by commands like
@command{autoreconf} or @command{aclocal} that trace macro calls; it should
be called directly from @file{configure.ac} so that tools that install
macros for @command{aclocal} can find the macros' declarations.
-This macro can be called multiple times and with multiple arguments; in
-such cases, directories in earlier calls are expected to be searched
-before directories in later calls, and directories appearing in the same
-call are expected to be searched in the order in which they appear in
-the call. For example, an usage like
+AC_CONFIG_MACRO_DIRS is the preferred form, and can be called multiple
+times and with multiple arguments; in such cases, directories in earlier
+calls are expected to be searched before directories in later calls, and
+directories appearing in the same call are expected to be searched in
+the order in which they appear in the call. For historical reasons, the
+macro AC_CONFIG_MACRO_DIR can also be used once, if it appears first,
+for tools such as older @command{libtool} that weren't prepared to
+handle multiple directories. For example, a usage like
@smallexample
-AC_CONFIG_MACRO_DIRS([dir1 dir2])
-AC_CONFIG_MACRO_DIRS([dir3])
-AC_CONFIG_MACRO_DIRS([dir4 dir5])
+AC_CONFIG_MACRO_DIR([dir1])
+AC_CONFIG_MACRO_DIRS([dir2])
+AC_CONFIG_MACRO_DIRS([dir3 dir4])
@end smallexample
should cause the directories to be searched in this order:
-@samp{dir1 dir2 dir3 dir4 dir5}.
+@samp{dir1 dir2 dir3 dir4}.
Note that if you use @command{aclocal} from Automake to generate
@file{aclocal.m4}, you must also set
diff --git i/lib/autoconf/general.m4 w/lib/autoconf/general.m4
index 44267b1..96deb1e 100644
--- i/lib/autoconf/general.m4
+++ w/lib/autoconf/general.m4
@@ -1737,8 +1737,7 @@ AC_DEFUN([AC_CONFIG_MACRO_DIRS], [])
# ------------------------
# Declare directory containing additional macros for aclocal.
# This is obsoleted by AC_CONFIG_MACRO_DIRS, and kept only for
-# backward compatibility. Future Autoconf versions should start
-# warning about it, in a year or so.
+# backward compatibility.
AC_DEFUN([AC_CONFIG_MACRO_DIR], [])
--
Eric Blake [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
