diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-11-10 10:54:44 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-11-10 13:02:12 +0100 |
commit | 838238295952cc86e5ccfe59113e6c315cf640ec (patch) | |
tree | ecce2e7693c3e04697e747644944a6c38890e035 /aclocal.in | |
parent | 256659b06280ab4be5103c760b777e26980863c3 (diff) | |
download | automake-838238295952cc86e5ccfe59113e6c315cf640ec.tar.gz |
aclocal: trace AC_CONFIG_MACRO_DIR_TRACE
This is now the documented way, and indeed the only correct way, to
support AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS in third-party
tools. See autoconf commit v2.69-45-g5269030 of 2012-11-09,
"AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks".
* aclocal.in (trace_used_macros): Trace 'AC_CONFIG_MACRO_DIR_TRACE'
rather than 'AC_CONFIG_MACRO_DIRS'. We still have to trace
'AC_CONFIG_MACRO_DIR' explicitly though, for compatibility with
Autoconf versions before 2.70.
* t/aclocal-macrodirs.tap: Enhance w.r.t. precedence of arguments
in one and several AC_CONFIG_MACRO_DIRS calls.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'aclocal.in')
-rw-r--r-- | aclocal.in | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/aclocal.in b/aclocal.in index 264ad752e..d4e7000b9 100644 --- a/aclocal.in +++ b/aclocal.in @@ -738,8 +738,11 @@ sub trace_used_macros () 'AC_DEFUN_ONCE', 'AU_DEFUN', '_AM_AUTOCONF_VERSION', + # FIXME: We still need to trace AC_CONFIG_MACRO_DIR + # for compatibility with older autoconf. Remove this + # when we can assume Autoconf 2.70 or later. 'AC_CONFIG_MACRO_DIR', - 'AC_CONFIG_MACRO_DIRS')), + 'AC_CONFIG_MACRO_DIR_TRACE')), # Do not trace $1 for all other macros as we do # not need it and it might contains harmful # characters (like newlines). @@ -769,18 +772,24 @@ sub trace_used_macros () { $ac_version = $arg1; } - elsif ($macro eq 'AC_CONFIG_MACRO_DIR') + elsif ($macro eq 'AC_CONFIG_MACRO_DIR_TRACE') { - @ac_config_macro_dirs = ($arg1); + push @ac_config_macro_dirs, $arg1; } - elsif ($macro eq 'AC_CONFIG_MACRO_DIRS') + # FIXME: We still need to trace AC_CONFIG_MACRO_DIR + # for compatibility with older autoconf. Remove this + # when we can assume Autoconf 2.70 or later. + elsif ($macro eq 'AC_CONFIG_MACRO_DIR') { - # Empty leading/trailing fields might be produced by split, - # hence the grep is really needed. - push @ac_config_macro_dirs, grep (/./, (split /\s+/, $arg1)); + @ac_config_macro_dirs = ($arg1); } } + # FIXME: in Autoconf >= 2.70, AC_CONFIG_MACRO_DIR calls + # AC_CONFIG_MACRO_DIR_TRACE behind the scenes, which could + # leave unwanted duplicates in @ac_config_macro_dirs. + @ac_config_macro_dirs = uniq @ac_config_macro_dirs; + $tracefh->close; return %traced; |