aclocal: multiple local m4 macro dirs with AC_CONFIG_MACRO_DIRS
A new macro 'AC_CONFIG_MACRO_DIRS' has been recently introduced in
autoconf (and is expected to appear in the autoconf 2.70 release),
allowing us to declare several local m4 macro directories for a
package.
It can be done either passing several arguments to a single invocation:
AC_CONFIG_MACRO_DIRS([dir1 dir2])
or issuing more invocations:
AC_CONFIG_MACRO_DIRS([dir1])
AC_CONFIG_MACRO_DIRS([dir2])
or a combination of the two:
AC_CONFIG_MACRO_DIRS([dir1 dir2])
AC_CONFIG_MACRO_DIRS([dir3])
This will allow projects to use several m4 macro local dirs, without the
need to use ACLOCAL_AMFLAGS (which we want to make obsolete and finally
remove). This is especially important for projects that are used as
nested subpackages of larger projects.
For more information and rationales, refer to these past discussions:
<http://lists.gnu.org/archive/html/autoconf/2011-12/msg00037.html>
<http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00010.html>
<http://lists.gnu.org/archive/html/autoconf-patches/2012-07/msg00000.html>
<http://lists.gnu.org/archive/html/autoconf-patches/2012-07/msg00012.html>
<http://thread.gmane.org/gmane.comp.sysutils.autoconf.patches/8037/>
<http://thread.gmane.org/gmane.comp.sysutils.autoconf.patches/8087>
<http://thread.gmane.org/gmane.comp.sysutils.automake.patches/8956>
as well as to Automake commit
v1.12.1-165-gcd1a9cc of 2012-07-03,
"aclocal: deprecate ACLOCAL_AMFLAGS, trace AC_CONFIG_MACRO_DIR instead",
autoconf commit
v2.69-42-gd73770f of 2012-10-17, "AC_CONFIG_MACRO_DIRS:
new macro, mostly for aclocal".
* aclocal.in ($ac_config_macro_dir): Turn this global scalar it into ...
(@ac_config_macro_dirs): ... this global array.
(trace_used_macros): Update '@ac_config_macro_dirs' instead of
re-defining '$ac_config_macro_dir'. Cater to calls the now-preferred
macro 'AC_CONFIG_MACRO_DIRS' in addition to the "obsolescent" one
AC_CONFIG_MACRO_DIR.
(main loop): Append '@ac_config_macro_dirs', not '$ac_config_macro_dir',
to '@user_includes'.
* t/subpkg-macrodir.sh: New test.
* t/aclocal-macrodirs.tap: Likewise.
* t/list-of-tests.mk: Add them.
* t/aclocal-macrodir.tap: Adjust and extend a little to keep it more in
sync with 'aclocal-macrodirs.tap'.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>