[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/6] aclocal: smash newlines in arguments of traced macros
From: |
Stefano Lattarini |
Subject: |
[PATCH 4/6] aclocal: smash newlines in arguments of traced macros |
Date: |
Sat, 3 Nov 2012 13:36:21 +0100 |
This change fixes the existing issues with AC_CONFIG_MACRO_DIRS
containing newlines:
<http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00000.html>
Likely, it will also allow a less involved implementation of the
AM_EXTRA_RECURSIVE_TARGETS macro (but that is left for potential
follow-up patches).
* aclocal.in (trace_used_macros): When calling autom4te, pass its
'--trace' option an argument containing '${::}%' rather than '$1'.
According to the autoconf manual (as of version 2.69), that will expand
to the concatenation, with the '::' string, of all the arguments passed
to a macro, with all newline characters in such arguments smashed.
Related adjustments when handling the macro AC_CONFIG_MACRO_DIRS, to
ensure leading whitespace in its argument are handled correctly.
* t/aclocal-macrodirs.tap ("AC_CONFIG_MACRO_DIRS: extra whitespace"):
No longer declare it as an xfailing test.
Signed-off-by: Stefano Lattarini <address@hidden>
---
aclocal.in | 6 ++++--
t/aclocal-macrodirs.tap | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/aclocal.in b/aclocal.in
index 751ab49..0220a7d 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -725,7 +725,7 @@ sub trace_used_macros ()
# All candidate macros.
$traces .= join (' ',
- (map { "--trace='$_:\$f::\$n::\$1'" }
+ (map { "--trace='$_:\$f::\$n::\${::}%'" }
('AC_DEFUN',
'AC_DEFUN_ONCE',
'AU_DEFUN',
@@ -767,7 +767,9 @@ sub trace_used_macros ()
}
elsif ($macro eq 'AC_CONFIG_MACRO_DIRS')
{
- push @ac_config_macro_dirs, split (/\s+/, $arg1);
+ # Empty leading/trailing fields might be produced by split,
+ # hence the grep is really needed.
+ push @ac_config_macro_dirs, grep (/./, (split /\s+/, $arg1));
}
}
diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap
index 9350b87..81ca75e 100755
--- a/t/aclocal-macrodirs.tap
+++ b/t/aclocal-macrodirs.tap
@@ -152,7 +152,7 @@ test_end
#---------------------------------------------------------------------------
-test_begin "AC_CONFIG_MACRO_DIRS: extra whitespace" TODO
+test_begin "AC_CONFIG_MACRO_DIRS: extra whitespace"
bslash=\\
--
1.8.0
- [PATCH 0/6] Support for AC_CONFIG_MACRO_DIRS in aclocal, Stefano Lattarini, 2012/11/03
- [PATCH 2/6] aclocal: diagnose non-existing directories in AC_CONFIG_MACRO_DIRS better, Stefano Lattarini, 2012/11/03
- [PATCH 3/6] tests: better coverage for AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/03
- [PATCH 4/6] aclocal: smash newlines in arguments of traced macros,
Stefano Lattarini <=
- [PATCH 1/6] aclocal: multiple local m4 macro dirs with AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/03
- [PATCH 5/6] coverage: expose a bug in aclocal (spurious warnings), Stefano Lattarini, 2012/11/03
- [PATCH 6/6] aclocal: avoid spurious warnings from autom4te with AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/03
[PATCHv2 0/8] Support for AC_CONFIG_MACRO_DIRS in Automake, Stefano Lattarini, 2012/11/10