aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older autoconf as well
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 14 Nov 2012 15:54:38 +0000 (16:54 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 15 Nov 2012 12:47:03 +0000 (13:47 +0100)
commit326cd5f0797b32616a7a6caaa854b04c4ebd53f7
treeb32508f7540875fd4afb81c784adbe67a0e35e14
parentb7c507eadfa7b9ef40ba433dee0d231432ab7c39
aclocal: tracing AC_CONFIG_MACRO_DIRS can work with older autoconf as well

This will allow our users to interact also with pre-2.70 autoconf without
need for the user to add ACLOCAL_AMFLAGS in Makefile.am.  For example,
before this change, in order to have aclocal look for macros in 'm4/dir1'
and 'm4/dir2' also when (say) autoconf 2.69 was used, our users would
have had to add something like:

    ACLOCAL_AMFLAGS = -I m4/dir1 -I m4/dir2

in Makefile.am, in addition to the

    AC_CONFIG_MACRO_DIRS([m4/dir1 m4/dir2])

in configure.ac.  Now, the AC_CONFIG_MACRO_DIRS call is enough.

See the long-winded discussion on automake bug#12845 for more details:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12845>

* aclocal.in ($ac_config_macro_dirs_fallback): New global variable,
contains m4 code to issue a fallback definition of AC_CONFIG_MACRO_DIRS
as an alias for the private macro _AM_CONFIG_MACRO_DIRS.
(trace_used_macros): Handle and trace that macro.  Do some code
reorganization and fix related botched indentation while at it.
(write_aclocal): Output '$ac_config_macro_dirs_fallback' early in
the generated aclocal.m4.
* t/aclocal-macrodirs.tap: Run unconditionally, even with older
autoconf.
* t/subpkg-macrodir.sh: Likewise.
* doc/automake.texi: Document only AC_CONFIG_MACRO_DIRS, rather
than AC_CONFIG_MACRO_DIR.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
aclocal.in
doc/automake.texi
t/aclocal-macrodirs.tap
t/subpkg-macrodir.sh