From 902cefcce4cd5987e47ee51d033d4dfdbf0d617f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 17 Feb 2001 02:34:18 +0000 Subject: [PATCH] 2001-02-16 Alexandre Duret-Lutz * automake.in (unquote_m4_arg): New function. (scan_one_configure_file): Call unquote_m4_arg on AM_CONFIG_HEADER argument, so that AM_CONFIG_HEADER([foobar.h]) works. --- ChangeLog | 7 +++++++ TODO | 2 ++ automake.in | 32 +++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2141da65..e27863c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-02-16 Alexandre Duret-Lutz + + * automake.in (unquote_m4_arg): New function. + (scan_one_configure_file): Call unquote_m4_arg on + AM_CONFIG_HEADER argument, so that AM_CONFIG_HEADER([foobar.h]) + works. + 2001-02-15 Tom Tromey * config.guess, config.sub: New versions from FSF. diff --git a/TODO b/TODO index aaa4f5cd..42d1eb49 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +have 'make check' print tests which are skipped + we need a document describing automake from the end user's point of view eg describe INSTALL_HEADER there, among other things diff --git a/automake.in b/automake.in index ef8c2b6f..b0848411 100755 --- a/automake.in +++ b/automake.in @@ -4445,7 +4445,7 @@ sub scan_one_autoconf_file $config_header_line = $.; local ($one_hdr); - foreach $one_hdr (split (' ', $2)) + foreach $one_hdr (split (' ', &unquote_m4_arg ($2))) { push (@config_fullnames, $one_hdr); if ($one_hdr =~ /^([^:]+):(.+)$/) @@ -7816,6 +7816,36 @@ sub my_glob return <${pat}>; } +# Remove one level of brackets and strip leading spaces, +# as does m4 to function arguments. +sub unquote_m4_arg +{ + $_ = shift; + s/^\s*//; + + my @letters = split //; + my @result = (); + my $depth = 0; + + foreach (@letters) + { + if ($_ eq '[') + { + ++$depth; + next if $depth == 1; + } + elsif ($_ eq ']') + { + --$depth; + next if $depth == 0; + # don't count orphan right brackets + $depth = 0 if $depth < 0; + } + push @result, $_; + } + return join '', @result; +} + ################################################################ # Print an error message and set exit status. -- 2.43.5