]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AC_CONFIG_MACRO_DIRS: new macro, mostly for aclocal
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 17 Oct 2012 10:15:56 +0000 (12:15 +0200)
committerEric Blake <eblake@redhat.com>
Fri, 9 Nov 2012 22:45:44 +0000 (15:45 -0700)
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.
* doc/autoconf.texi (@node "Input"): Document AC_CONFIG_MACRO_DIRS as
preferred over AC_CONFIG_MACRO_DIR.
* NEWS: Update.

Suggested-by: Eric Blake <eblake@redhat.com>
Helped-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
NEWS
doc/autoconf.texi
lib/autoconf/general.m4

diff --git a/NEWS b/NEWS
index d3ff4b9c6433b610f3a0521eb64fa9bc507bf2ba..6d5b5e94b278093c9b2cefed804f056b096b12b4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,14 @@ GNU Autoconf NEWS - User visible changes.
 
 ** Macros
 
+- AC_CONFIG_MACRO_DIRS
+  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.
 
index a0c19d1d98e34704b982d9824f39447897b752b5..7697d0e7cfcc99d98987405608988b18b4133217 100644 (file)
@@ -2106,19 +2106,40 @@ files.  For instance it is called by macros like @code{AC_PROG_INSTALL}
 @end defmac
 
 Similarly, packages that use @command{aclocal} should declare where
-local macros can be found using @code{AC_CONFIG_MACRO_DIR}.
+local macros can be found using @code{AC_CONFIG_MACRO_DIRS}.
 
-@defmac AC_CONFIG_MACRO_DIR (@var{dir})
+@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 @var{dir} as the location of additional local Autoconf macros.
-This macro is intended for use by future versions of commands like
-@command{autoreconf} 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.
+Specify the given directories as the location of additional local Autoconf
+macros.  These macros are intended for use by commands like
+@command{autoreconf} or @command{aclocal} that trace macro calls; they should
+be called directly from @file{configure.ac} so that tools that install
+macros for @command{aclocal} can find the macros' declarations.
+
+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_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}.
 
 Note that if you use @command{aclocal} from Automake to generate
-@file{aclocal.m4}, you must also set @code{ACLOCAL_AMFLAGS = -I
-@var{dir}} in your top-level @file{Makefile.am}.  Due to a limitation in
+@file{aclocal.m4}, you must also set
+@code{ACLOCAL_AMFLAGS = -I @var{dir1} [-I @var{dir2} ... -I @var{dirN}]}
+in your top-level @file{Makefile.am}.  Due to a limitation in
 the Autoconf implementation of @command{autoreconf}, these include
 directives currently must be set on a single line in @file{Makefile.am},
 without any backslash-newlines.
index 51cee303f433a5e57d4763dc3ed5acae896911a0..96deb1e871e75ec238a84cc80c603eb468a0f52b 100644 (file)
@@ -1727,13 +1727,20 @@ AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 ## ------------------------ ##
 
 
+# AC_CONFIG_MACRO_DIRS(DIR-1 [DIR-2 ... DIR-n])
+# --------------------------------------------
+# Declare directories containing additional macros for aclocal.
+# This macro can be called multiple times, and with multiple arguments.
+AC_DEFUN([AC_CONFIG_MACRO_DIRS], [])
+
 # AC_CONFIG_MACRO_DIR(DIR)
 # ------------------------
 # Declare directory containing additional macros for aclocal.
+# This is obsoleted by AC_CONFIG_MACRO_DIRS, and kept only for
+# backward compatibility.
 AC_DEFUN([AC_CONFIG_MACRO_DIR], [])
 
 
-
 ## --------------------- ##
 ## Requiring aux files.  ##
 ## --------------------- ##